check and warn about failure to set reuseaddr

This commit is contained in:
Richard Frith-Macdonald 2018-02-08 06:08:41 +00:00
parent a211bb4aee
commit ab822a35a3

View file

@ -2672,8 +2672,11 @@ setNonBlocking(SOCKET fd)
*/
int status = 1;
setsockopt([self _sock], SOL_SOCKET, SO_REUSEADDR,
(char *)&status, (OPTLEN)sizeof(status));
if (setsockopt([self _sock], SOL_SOCKET, SO_REUSEADDR,
(char *)&status, (OPTLEN)sizeof(status)) < 0)
{
NSDebugMLLog(@"GSTcpTune", @"setsockopt reuseaddr failed");
}
}
#endif