Browse Source

Fix set_reuse_address on non-Windows platforms.

Broken after cae0d8853d7a373ad8720289c12c7c2e7b5ef240 .
Fabio Alessandrelli 5 years ago
parent
commit
19ef28a614
1 changed files with 0 additions and 2 deletions
  1. 0 2
      drivers/unix/net_socket_posix.cpp

+ 0 - 2
drivers/unix/net_socket_posix.cpp

@@ -676,8 +676,6 @@ void NetSocketPosix::set_reuse_address_enabled(bool p_enabled) {
 // On Windows, enabling SO_REUSEADDR actually would also enable reuse port, very bad on TCP. Denying...
 // On Windows, enabling SO_REUSEADDR actually would also enable reuse port, very bad on TCP. Denying...
 // Windows does not have this option, SO_REUSEADDR in this magical world means SO_REUSEPORT
 // Windows does not have this option, SO_REUSEADDR in this magical world means SO_REUSEPORT
 #ifndef WINDOWS_ENABLED
 #ifndef WINDOWS_ENABLED
-	if (_is_stream)
-		return;
 	int par = p_enabled ? 1 : 0;
 	int par = p_enabled ? 1 : 0;
 	if (setsockopt(_sock, SOL_SOCKET, SO_REUSEADDR, SOCK_CBUF(&par), sizeof(int)) < 0) {
 	if (setsockopt(_sock, SOL_SOCKET, SO_REUSEADDR, SOCK_CBUF(&par), sizeof(int)) < 0) {
 		WARN_PRINT("Unable to set socket REUSEADDR option!");
 		WARN_PRINT("Unable to set socket REUSEADDR option!");