#pragma once #include #include #include #define DEFAULT_MAX_PACKET_SIZE 250 class UDPbase { int mChannel; IPaddress mIPAddress; protected: std::vector UDPsocks; public: UDPbase (const char* host, const Uint16 port); UDPbase (const char* host, const Uint16 port, const int channel); ~UDPbase (void); int ResolveHost (IPaddress*, const char*, const Uint16); UDPsocket UDP_Open (void); UDPsocket UDP_Open (const Uint16 port); void UDP_Close (UDPsocket sock); int UDP_Bind (UDPsocket sock, const int channel); void UDP_Unbind (UDPsocket sock, const int channel); IPaddress* UDP_GetPeerAddress (UDPsocket sock, const int channel); void CloseAllSockets (void); int getChannel (void) const { return mChannel; } UDPsocket getSocket (const size_t idx) const { return UDPsocks.at (idx); } std::string toString (void); };