diff options
author | Astonex <softukitu@gmail.com> | 2013-07-27 02:45:58 +0100 |
---|---|---|
committer | Astonex <softukitu@gmail.com> | 2013-07-27 02:45:58 +0100 |
commit | 37a300f9021cbf8c5e6e1134ae8eee9c33307eb7 (patch) | |
tree | 64648fd4154b175a2be9b8b0aab6bb617a1658c6 /core | |
parent | 92398844a05bf5f0ce4333e0d4bd03c6e6633f77 (diff) |
Close the socket in shutdown_networking()
Diffstat (limited to 'core')
-rw-r--r-- | core/network.c | 3 | ||||
-rw-r--r-- | core/network.h | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/core/network.c b/core/network.c index bc6738ac..d4e25c82 100644 --- a/core/network.c +++ b/core/network.c | |||
@@ -166,7 +166,10 @@ int init_networking(IP ip ,uint16_t port) | |||
166 | void shutdown_networking() | 166 | void shutdown_networking() |
167 | { | 167 | { |
168 | #ifdef WIN32 | 168 | #ifdef WIN32 |
169 | closesocket(sock); | ||
169 | WSACleanup(); | 170 | WSACleanup(); |
171 | #else | ||
172 | close(sock); | ||
170 | #endif | 173 | #endif |
171 | return; | 174 | return; |
172 | } | 175 | } |
diff --git a/core/network.h b/core/network.h index 62169d88..3b999cec 100644 --- a/core/network.h +++ b/core/network.h | |||
@@ -52,6 +52,7 @@ | |||
52 | #include <sys/time.h> | 52 | #include <sys/time.h> |
53 | #include <sys/types.h> | 53 | #include <sys/types.h> |
54 | #include <netdb.h> | 54 | #include <netdb.h> |
55 | #include <unistd.h> | ||
55 | 56 | ||
56 | #endif | 57 | #endif |
57 | 58 | ||