diff options
author | irungentoo <irungentoo@gmail.com> | 2013-07-26 19:03:34 -0700 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2013-07-26 19:03:34 -0700 |
commit | 45b5ef0b79239167d9bc8fe52b25b36b684d2687 (patch) | |
tree | 091562b95040882ae1858ccc1cd2ce3cd1df59f2 | |
parent | 792a02e9f62a6ba5ec40a6166f6bd58f197735d7 (diff) | |
parent | 3e1b96f333b7e51c8a714c2e701e7310239f1364 (diff) |
Merge pull request #115 from Astonex/master
Close the socket in shutdown_networking()
-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 549427bf..ec234593 100644 --- a/core/network.c +++ b/core/network.c | |||
@@ -159,7 +159,10 @@ int init_networking(IP ip, uint16_t port) | |||
159 | void shutdown_networking() | 159 | void shutdown_networking() |
160 | { | 160 | { |
161 | #ifdef WIN32 | 161 | #ifdef WIN32 |
162 | closesocket(sock); | ||
162 | WSACleanup(); | 163 | WSACleanup(); |
164 | #else | ||
165 | close(sock); | ||
163 | #endif | 166 | #endif |
164 | return; | 167 | return; |
165 | } | 168 | } |
diff --git a/core/network.h b/core/network.h index dcbd4160..eaf12003 100644 --- a/core/network.h +++ b/core/network.h | |||
@@ -48,6 +48,7 @@ | |||
48 | #include <sys/time.h> | 48 | #include <sys/time.h> |
49 | #include <sys/types.h> | 49 | #include <sys/types.h> |
50 | #include <netdb.h> | 50 | #include <netdb.h> |
51 | #include <unistd.h> | ||
51 | 52 | ||
52 | #endif | 53 | #endif |
53 | 54 | ||