5 #define WIN32_LEAN_AND_MEAN
8 #define INVALID_SOCKET -1
16 bool Connect(
const char* pServerAddr,
unsigned short nPort);
19 bool CreateUDPSocket(
unsigned short& nUDPPort,
bool bBroadcast =
false);
20 int Receive(
char* rtDataBuff,
int nDataBufSize,
bool bHeader,
int nTimeout,
21 unsigned int* ipAddr =
nullptr);
22 bool Send(
const char* pSendBuf,
int nSize);
24 unsigned int nFilterAddr = 0);
33 void SetErrorString();
39 SOCKET mUDPBroadcastSocket;
41 unsigned long mLastError;
bool IsLocalAddress(unsigned int nAddr) const
bool Send(const char *pSendBuf, int nSize)
bool SendUDPBroadcast(const char *pSendBuf, int nSize, short nPort, unsigned int nFilterAddr=0)
unsigned short GetUdpBroadcastServerPort()
int Receive(char *rtDataBuff, int nDataBufSize, bool bHeader, int nTimeout, unsigned int *ipAddr=nullptr)
bool CreateUDPSocket(unsigned short &nUDPPort, bool bBroadcast=false)
unsigned short GetUdpServerPort()
bool Connect(const char *pServerAddr, unsigned short nPort)