summaryrefslogtreecommitdiff
path: root/toxcore/TCP_server.c
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2015-04-11 20:24:39 -0400
committerirungentoo <irungentoo@gmail.com>2015-04-11 20:24:39 -0400
commit405558258d82e8cd14bb93e5d21702af180299ef (patch)
tree27069e55d263d8c9e31b1d0d13dfd228c3c72103 /toxcore/TCP_server.c
parent11b750c7450d8a31b03380b7865f6ce6159e0b6d (diff)
Enable SO_REUSEADDR on TCP server socket.
Diffstat (limited to 'toxcore/TCP_server.c')
-rw-r--r--toxcore/TCP_server.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/toxcore/TCP_server.c b/toxcore/TCP_server.c
index d7401de8..f07df2c6 100644
--- a/toxcore/TCP_server.c
+++ b/toxcore/TCP_server.c
@@ -925,6 +925,10 @@ static sock_t new_listening_TCP_socket(int family, uint16_t port)
925 ok = set_socket_dualstack(sock); 925 ok = set_socket_dualstack(sock);
926 } 926 }
927 927
928 if (ok) {
929 ok = set_socket_reuseaddr(sock);
930 }
931
928 ok = ok && bind_to_port(sock, family, port) && (listen(sock, TCP_MAX_BACKLOG) == 0); 932 ok = ok && bind_to_port(sock, family, port) && (listen(sock, TCP_MAX_BACKLOG) == 0);
929 933
930 if (!ok) { 934 if (!ok) {