Initial network files

This commit is contained in:
Adam Honse 2020-04-11 13:42:32 -05:00
parent 01e0808e41
commit 594f66ab23
8 changed files with 225 additions and 0 deletions

27
NetworkServer.cpp Normal file
View file

@ -0,0 +1,27 @@
#include "NetworkServer.h"
NetworkServer::NetworkServer(std::vector<RGBController *>& control) : controllers(control)
{
//Start a TCP server and launch threads
port.tcp_server("1337");
}
void NetworkServer::ConnectionThread()
{
//This thread handles client connections
while(1)
{
port.tcp_server_listen();
}
}
void NetworkServer::ListenThread()
{
//This thread handles messages received from clients
while(1)
{
//Listen for request
//Request received, select functionality based on request ID
}
}