Created empty TCPNetworkManager; needs work, I don't even like the name

This commit is contained in:
Kayne Ruse
2013-05-02 01:17:56 +10:00
parent 95f2d212ef
commit b935fcf1d1
7 changed files with 147 additions and 16 deletions
+32
View File
@@ -0,0 +1,32 @@
#ifndef TCPNETWORKMANAGER_HPP_
#define TCPNETWORKMANAGER_HPP_
#include "SDL_net/SDL_net.h"
class TCPNetworkManager {
public:
TCPNetworkManager();
~TCPNetworkManager();
void Init(int maxConnections);
void Quit();
int AcceptConnections();
int CheckSockets();
int Send(int index, const void* data, int len);
int SendAll(const void* data, int len);
int OpenSocket(const char* host, int port);
TCPsocket GetSocket(int index);
int CloseSocket(int index);
int GetMaxConnections();
int GetCurrentConnections();
private:
TCPsocket serverSocket;
SDLNet_SocketSet socketSet;
int maxConnections, currentConnections;
};
#endif