Merge pull request #115 from Astonex/master

Close the socket in shutdown_networking()
This commit is contained in:
irungentoo 2013-07-26 19:03:34 -07:00
commit 45b5ef0b79
2 changed files with 4 additions and 0 deletions

View File

@ -159,7 +159,10 @@ int init_networking(IP ip, uint16_t port)
void shutdown_networking() void shutdown_networking()
{ {
#ifdef WIN32 #ifdef WIN32
closesocket(sock);
WSACleanup(); WSACleanup();
#else
close(sock);
#endif #endif
return; return;
} }

View File

@ -48,6 +48,7 @@
#include <sys/time.h> #include <sys/time.h>
#include <sys/types.h> #include <sys/types.h>
#include <netdb.h> #include <netdb.h>
#include <unistd.h>
#endif #endif