Close the socket in shutdown_networking()

This commit is contained in:
Astonex 2013-07-27 02:45:58 +01:00
parent 92398844a0
commit 37a300f902
2 changed files with 4 additions and 0 deletions

View File

@ -166,7 +166,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

@ -52,6 +52,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