Fix setsockopt() to match previous precident of setsockopt() usage (as seen

later in the setBroadcast() function.)
This commit is contained in:
Curtis L. Olson
2010-11-12 15:52:33 -06:00
parent 6b58afe823
commit 50315a7346

View File

@@ -199,8 +199,13 @@ bool Socket::open ( bool stream )
//
if ( stream ) {
int opt_boolean = 1;
setsockopt( handle, SOL_SOCKET, SO_REUSEADDR,
(char *)&opt_boolean, sizeof(opt_boolean) );
#if defined(_WIN32) || defined(__CYGWIN__)
setsockopt( handle, SOL_SOCKET, SO_REUSEADDR, (char *)&opt_boolean,
sizeof(opt_boolean) );
#else
setsockopt( handle, SOL_SOCKET, SO_REUSEADDR, &opt_boolean,
sizeof(opt_boolean) );
#endif
}
return (handle != -1);