final app
This commit is contained in:
30
Server/Server.h
Normal file
30
Server/Server.h
Normal 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;
|
||||
};
|
||||
Reference in New Issue
Block a user