final app

This commit is contained in:
2020-01-11 07:05:54 +01:00
parent dcfb945c0b
commit 31fe531703
68 changed files with 62242 additions and 129 deletions

30
Server/Server.h Normal file
View File

@@ -0,0 +1,30 @@
#pragma once
#include <vector>
#include <SocketLibrary/SocketLibrary.h>
using namespace SocketLibrary;
class Server
{
struct clientInfo {
Socket connection;
Endpoint listening;
std::string name;
time_t lastActiveTime;
};
public:
Result Initialize(Endpoint ip);
Result IncomingConnection();
Result CheckConnection();
Result SendToClients();
private:
Socket listeningSocketTCP;
Socket broadcastSenderUDP;
std::vector<clientInfo> connections;
fd_set master_fd;
timeval waitTime = { 0, 1000 };
Endpoint ownEndpoint;
public:
bool sendUDP = true;
};