#pragma once #include #include #include #include /* MTU */ #define MAX_PACKET_SIZE (1024*1024) class Server { bool mProcessPacketCallbackRunning; SDL_TimerID mProcessPacketCallbackTimerID; static Uint32 ProcessPacketCallback (Uint32, void*); public: std::vector UDPsocks; SDLNet_SocketSet SocketSet; UDPpacket **UDPPacketV; Server (void) { mProcessPacketCallbackRunning = false; UDPsocks.clear (); SocketSet = NULL; UDPPacketV = NULL; } Server (const char* host, const Uint16 port); UDPsocket UDP_Open (Uint16 port); void UDP_CloseAll (void); void ProcessPacket (UDPpacket* packet); void Start (void); void Stop (void); bool ProcessPacketCallbackRunning (void) { return mProcessPacketCallbackRunning; } };