Use std::thread for NetworkServer threads
This commit is contained in:
parent
6e426b1403
commit
81acc47cd6
2 changed files with 16 additions and 63 deletions
|
|
@ -2,6 +2,8 @@
|
|||
#include "NetworkProtocol.h"
|
||||
#include "net_port.h"
|
||||
|
||||
#include <thread>
|
||||
|
||||
#pragma once
|
||||
|
||||
class NetworkServer
|
||||
|
|
@ -9,15 +11,18 @@ class NetworkServer
|
|||
public:
|
||||
NetworkServer(std::vector<RGBController *>& control);
|
||||
|
||||
void ConnectionThread();
|
||||
void ListenThread(SOCKET * client_sock);
|
||||
void ConnectionThreadFunction();
|
||||
void ListenThreadFunction(SOCKET * client_sock);
|
||||
|
||||
void SendReply_ControllerCount(SOCKET * client_sock);
|
||||
void SendReply_ControllerData(SOCKET * client_sock, unsigned int dev_idx);
|
||||
|
||||
protected:
|
||||
std::vector<RGBController *>& controllers;
|
||||
std::vector<RGBController *>& controllers;
|
||||
|
||||
std::vector<std::thread *> ListenThreads;
|
||||
std::thread * ConnectionThread;
|
||||
|
||||
private:
|
||||
net_port port;
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue