Banking_System_Server  1.0.0
Qt-based banking app for user/admin account management, transactions, secure server communication via PostgreSQL/Supabase.
serverhandler.h
Go to the documentation of this file.
1 
8 #ifndef SERVERHANDLER_H
9 #define SERVERHANDLER_H
10 
11 #include <QEventLoop>
12 #include <QObject>
13 #include <QDebug>
14 #include <QRunnable>
15 #include <QThread>
16 #include <QCryptographicHash>
17 #include <QByteArray>
18 #include <QMutex>
19 #include "RequestManager.h"
20 #include <QTcpServer>
21 #include <QTcpSocket>
22 
30 class ServerHandler : public QObject, public QRunnable
31 {
32  Q_OBJECT
33 public:
44  explicit ServerHandler(QMutex* m, qintptr handle = 0, QObject* parent = nullptr);
45 
52 
60  void readyRead();
61 
69  void run();
70 
71 private:
72  qintptr handle_;
73  QTcpSocket* clientSocket_;
74  QMutex* Mutex_;
75  RequestManager* requestManager;
76 };
77 
78 #endif // SERVERHANDLER_H
This file contains the declaration of the RequestManager class, which handles incoming requests and d...
The RequestManager class handles incoming requests and dispatches them to the appropriate request han...
Definition: RequestManager.h:38
The ServerHandler class handles incoming client connections in a separate thread.
Definition: serverhandler.h:31
ServerHandler(QMutex *m, qintptr handle=0, QObject *parent=nullptr)
Constructs a ServerHandler object with the specified parameters.
Definition: serverhandler.cpp:3
~ServerHandler()
Destructor for the ServerHandler class.
Definition: serverhandler.cpp:11
void run()
Implements QRunnable's run method to handle the client connection.
Definition: serverhandler.cpp:56
void readyRead()
Slot to handle readyRead signal from QTcpSocket.
Definition: serverhandler.cpp:22