summaryrefslogtreecommitdiffstats
path: root/source/cSocket.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/cSocket.cpp')
-rw-r--r--source/cSocket.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/cSocket.cpp b/source/cSocket.cpp
index d2489d48e..edc57c1ce 100644
--- a/source/cSocket.cpp
+++ b/source/cSocket.cpp
@@ -1,5 +1,10 @@
#include "cSocket.h"
+#ifndef _WIN32
+#include <netdb.h>
+#include <unistd.h>
+#endif
+
cSocket::cSocket( xSocket a_Socket )
: m_Socket( a_Socket )
{
@@ -28,3 +33,12 @@ bool cSocket::IsValid()
#endif
}
+void cSocket::CloseSocket()
+{
+#ifdef _WIN32
+ closesocket(m_Socket);
+#else
+ shutdown(m_Socket, SHUT_RDWR);//SD_BOTH);
+ close(m_Socket);
+#endif
+} \ No newline at end of file