Merge pull request #16 from nasa/Testing-Scripts
Fixed bug in xplaneConnect.c
This commit is contained in:
@@ -89,6 +89,7 @@ struct xpcSocket openUDP(unsigned short port_number, const char *xpIP, unsigned
|
|||||||
|
|
||||||
#if (__APPLE__ || __linux)
|
#if (__APPLE__ || __linux)
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
|
int optval = 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Setup Port
|
// Setup Port
|
||||||
@@ -147,6 +148,10 @@ struct xpcSocket openUDP(unsigned short port_number, const char *xpIP, unsigned
|
|||||||
return theSocket;
|
return theSocket;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Options
|
||||||
|
setsockopt(theSocket.sock, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval));
|
||||||
|
setsockopt(theSocket.sock, SOL_SOCKET, SO_REUSEPORT, &optval, sizeof(optval));
|
||||||
|
|
||||||
//Bind
|
//Bind
|
||||||
if ( bind(theSocket.sock, (struct sockaddr *) &server, sizeof(server)) == -1)
|
if ( bind(theSocket.sock, (struct sockaddr *) &server, sizeof(server)) == -1)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user