![]() |
Banking_System_Server
1.0.0
Qt-based banking app for user/admin account management, transactions, secure server communication via PostgreSQL/Supabase.
|
The Server class extends QTcpServer to handle incoming network connections. More...
#include <server.h>
Public Slots | |
void | start (qint16 port=2222) |
Starts the server and listens for incoming connections on the specified port. More... | |
void | quit () |
Stops the server by closing the listening socket. | |
Public Member Functions | |
Server (QObject *parent=nullptr) | |
Constructs a Server object with an optional parent. More... | |
~Server () | |
Destructor for the Server class. More... | |
Protected Member Functions | |
void | incomingConnection (qintptr handle) override |
Handles incoming connections by creating and starting a ServerHandler instance. More... | |
The Server class extends QTcpServer to handle incoming network connections.
This class sets up a TCP server, manages incoming connections using a thread pool, and handles incoming requests with instances of the ServerHandler class. It supports multithreaded processing and provides methods to start and stop the server.
|
explicit |
Constructs a Server object with an optional parent.
Initializes the thread pool and mutex, and sets the maximum thread count for handling incoming connections.
parent | The parent QObject. |
Server::~Server | ( | ) |
Destructor for the Server class.
Cleans up resources by clearing and deleting the thread pool.
|
overrideprotected |
Handles incoming connections by creating and starting a ServerHandler instance.
handle | The socket descriptor for the incoming connection. |
|
slot |
Starts the server and listens for incoming connections on the specified port.
port | The port number to listen on (default is 2222). |