Server Server - PanTomko/SK_Projekt1 GitHub Wiki

Server Class

Primary focus of this class is to manage upcoming connections, list of witch is "connected_peers". All client are crated and started by server moment after accepting new connection. Server class works in main thread (QT gui thread).

overloaded functions

void incomingConnection( qintptr handle )

functions

void void handleClientToken(Client* client, TOKEN token)
void void start()

incomingConnection( qintptr handle ) overload

This is overload of QTcpServer::incomingConnection where handle is socket descriptor. Here are new clients are being made and started.

void start()

Puts server in listening mode waiting for new connections.

void handleClientToken(Client* client, TOKEN token)

This functions starts on client thread after client emitting signal "tokenRecived". Depending on token server will handle them in one of :
  • void handleToken_UPLOAD(Client* client);
  • void handleToken_DELETE(Client* client);
  • void handleToken_DOWNLOAD(Client* client);
⚠️ **GitHub.com Fallback** ⚠️