summaryrefslogtreecommitdiff
path: root/toxcore/TCP_server.c
diff options
context:
space:
mode:
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) {