diff --git a/C/src/xplaneConnect.c b/C/src/xplaneConnect.c index 03a8361..04110ea 100755 --- a/C/src/xplaneConnect.c +++ b/C/src/xplaneConnect.c @@ -140,8 +140,6 @@ struct xpcSocket openUDP(unsigned short port_number, const char *xpIP, unsigned } #elif (__APPLE__ || __linux) // Create a SOCKET - theSocket.sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); - if ((theSocket.sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) { perror((char*) "ERROR: openUDP- "); @@ -161,10 +159,10 @@ struct xpcSocket openUDP(unsigned short port_number, const char *xpIP, unsigned #endif //Set Timout - int msTimeOut = 500; + int usTimeOut = 500; #ifdef _WIN32 - DWORD msTimeOutWin = 1; + 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 */