#ifndef NET_MASTER_H #define NET_MASTER_H #include "NET_Client.h" #define MAXCLIENTS 100 class NET_Master { public: /*private*/ NET_Client *clientList[MAXCLIENTS]; int serverfd; struct sockaddr_in serversocket; int serverPort; NET_Client *mostRecentClientRecv; int uniqueIdCounter; bool pure; //if true, pure connect/send/recv; //if false, sends clientname after connect;packet length header in send/recv public: NET_Master(int serverPort, bool is_pure=false); virtual ~NET_Master(); // NET_Client *read(void *buf, int bufsize); // int write(void *buf, int bufsize); NET_Client *readNetMsg(void *buf, int *size); NET_Client *getNextClient(NET_Client *cli); void deleteClient(NET_Client *client); NET_Client *checkNewConnection(); NET_Client *waitNewConnection(); int getClientNum(NET_Client *cli); int getblocking(); void setblocking(int isblocking); }; #endif