Set SO_EXCLUSIVEADDRUSE option on Windows
This should prevent potential port hijacking.
This commit is contained in:
parent
08ed4a2354
commit
1f957649b0
@ -117,6 +117,9 @@ namespace fr
|
|||||||
//todo: Perhaps allow for these settings to be modified
|
//todo: Perhaps allow for these settings to be modified
|
||||||
int one = 1;
|
int one = 1;
|
||||||
setsockopt(get_socket_descriptor(), SOL_TCP, TCP_NODELAY, (char*)&one, sizeof(one));
|
setsockopt(get_socket_descriptor(), SOL_TCP, TCP_NODELAY, (char*)&one, sizeof(one));
|
||||||
|
#ifdef _WIN32
|
||||||
|
setsockopt(get_socket_descriptor(), SOL_SOCKET, SO_EXCLUSIVEADDRUSE, (char*)&one, sizeof(one));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void Socket::set_inet_version(Socket::IP version)
|
void Socket::set_inet_version(Socket::IP version)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user