Banking_System_Server  1.0.0
Qt-based banking app for user/admin account management, transactions, secure server communication via PostgreSQL/Supabase.
server.h
Go to the documentation of this file.
1 
8 #ifndef SERVER_H
9 #define SERVER_H
10 
11 #include <QObject>
12 #include <QDebug>
13 #include <QAbstractSocket>
14 #include <QTcpServer>
15 #include <QTcpSocket>
16 #include <QDate>
17 #include <QTime>
18 #include <QList>
19 #include <QThreadPool>
20 #include <QThread>
21 #include <QMutex>
22 
23 #include "serverhandler.h"
24 
32 class Server : public QTcpServer
33 {
34  Q_OBJECT
35 public:
45  explicit Server(QObject* parent = nullptr);
46 
52  ~Server();
53 
54 signals:
55  // No signals defined for this class
56 
57 public slots:
64  void start(qint16 port = 2222);
65 
69  void quit();
70 
71 protected:
78  void incomingConnection(qintptr handle) override;
79 
80 private:
81  QThreadPool* threadPool;
82  QMutex* Mutex_;
83 };
84 
85 #endif // SERVER_H
The Server class extends QTcpServer to handle incoming network connections.
Definition: server.h:33
void quit()
Stops the server by closing the listening socket.
Definition: server.cpp:37
~Server()
Destructor for the Server class.
Definition: server.cpp:12
void incomingConnection(qintptr handle) override
Handles incoming connections by creating and starting a ServerHandler instance.
Definition: server.cpp:43
void start(qint16 port=2222)
Starts the server and listens for incoming connections on the specified port.
Definition: server.cpp:20
Server(QObject *parent=nullptr)
Constructs a Server object with an optional parent.
Definition: server.cpp:3
This file contains the declaration of the ServerHandler class, which handles incoming client connecti...