Reverted timeout changes and added clarifying comment.

This commit is contained in:
jwatkins42
2014-12-02 21:32:45 -08:00
parent f582d7fec0
commit d70148b98d

View File

@@ -159,14 +159,14 @@ struct xpcSocket openUDP(unsigned short port_number, const char *xpIP, unsigned
#endif
//Set Timout
int msTimeOut = 500;
int usTimeOut = 500;
#ifdef _WIN32
DWORD msTimeOutWin = msTimeOut;
DWORD msTimeOutWin = 1; // Minimum socket timeout in Windows is 1ms
setsockopt(theSocket.sock, SOL_SOCKET, SO_RCVTIMEO, (char *)&msTimeOutWin, sizeof(msTimeOutWin));
#else
tv.tv_sec = 0; /* Sec Timeout */
tv.tv_usec = msTimeOut * 1000; // Microsec Timeout
tv.tv_usec = msTimeOut; // Microsec Timeout
setsockopt(theSocket.sock, SOL_SOCKET, SO_RCVTIMEO, (char *) &tv, sizeof(struct timeval));
#endif