aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net/tcpserver.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/tcpserver.c b/net/tcpserver.c
index db7a4b1..677ba2f 100644
--- a/net/tcpserver.c
+++ b/net/tcpserver.c
@@ -930,11 +930,10 @@ static void *tcpserver_new(t_floatarg fportno)
server.sin_addr.s_addr = INADDR_ANY;
/* enable reuse of local address */
#ifdef _WIN32
- if (setsockopt(sockfd, SOL_SOCKET, SO_SNDBUF, (char*)&optVal, optLen) == SOCKET_ERROR)
+ if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, (char*)&optVal, optLen) == SOCKET_ERROR)
#else
if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, (char*)&optVal, optLen) == -1)
#endif
-// if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval)) < 0)
sys_sockerror("tcpserver: setsockopt SO_REUSEADDR");
/* assign server port number */