Banking_System_Server  1.0.0
Qt-based banking app for user/admin account management, transactions, secure server communication via PostgreSQL/Supabase.
Server Class Reference

The Server class extends QTcpServer to handle incoming network connections. More...

#include <server.h>

Inheritance diagram for Server:
Inheritance graph
Collaboration diagram for Server:
Collaboration graph

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Server()

Server::Server ( QObject *  parent = nullptr)
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.

Parameters
parentThe parent QObject.

◆ ~Server()

Server::~Server ( )

Destructor for the Server class.

Cleans up resources by clearing and deleting the thread pool.

Member Function Documentation

◆ incomingConnection()

void Server::incomingConnection ( qintptr  handle)
overrideprotected

Handles incoming connections by creating and starting a ServerHandler instance.

Parameters
handleThe socket descriptor for the incoming connection.

◆ start

void Server::start ( qint16  port = 2222)
slot

Starts the server and listens for incoming connections on the specified port.

Parameters
portThe port number to listen on (default is 2222).

The documentation for this class was generated from the following files: