Merge pull request #16 from nasa/Testing-Scripts

Fixed bug in xplaneConnect.c
This commit is contained in:
Christopher Teubert
2014-12-01 15:10:11 -08:00

View File

@@ -89,6 +89,7 @@ struct xpcSocket openUDP(unsigned short port_number, const char *xpIP, unsigned
#if (__APPLE__ || __linux)
struct timeval tv;
int optval = 1;
#endif
// Setup Port
@@ -147,6 +148,10 @@ struct xpcSocket openUDP(unsigned short port_number, const char *xpIP, unsigned
return theSocket;
}
// Options
setsockopt(theSocket.sock, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval));
setsockopt(theSocket.sock, SOL_SOCKET, SO_REUSEPORT, &optval, sizeof(optval));
//Bind
if ( bind(theSocket.sock, (struct sockaddr *) &server, sizeof(server)) == -1)
{