summaryrefslogtreecommitdiff
path: root/platform/windows
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2015-10-19 18:48:34 -0300
committerJuan Linietsky <reduzio@gmail.com>2015-10-19 18:48:34 -0300
commit2b12a8109dda1f47f9b75a5de91d7d00c1f25869 (patch)
tree3f3775c304e76ea2776d336c9a471d99359872c0 /platform/windows
parent5d86a25f4d04b21559f0d4edbd4e70dc01ea6685 (diff)
parent0a02c28b2be8e8271d5f3ffb95a4b09f91c3bd32 (diff)
Merge branch 'master' of https://github.com/okamstudio/godot
Diffstat (limited to 'platform/windows')
-rw-r--r--platform/windows/tcp_server_winsock.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/platform/windows/tcp_server_winsock.cpp b/platform/windows/tcp_server_winsock.cpp
index bf7e85aebb..cc689d9dcf 100644
--- a/platform/windows/tcp_server_winsock.cpp
+++ b/platform/windows/tcp_server_winsock.cpp
@@ -79,6 +79,13 @@ Error TCPServerWinsock::listen(uint16_t p_port,const List<String> *p_accepted_ho
my_addr.sin_addr.s_addr = INADDR_ANY; // automatically fill with my IP TODO: use p_accepted_hosts
memset(my_addr.sin_zero, '\0', sizeof my_addr.sin_zero);
+ int reuse=1;
+ if(setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, (char *)&reuse, sizeof(reuse)) < 0) {
+
+ printf("REUSEADDR failed!");
+ }
+
+
if (bind(sockfd, (struct sockaddr *)&my_addr, sizeof my_addr) != SOCKET_ERROR) {
if (::listen(sockfd, SOMAXCONN) == SOCKET_ERROR) {