summaryrefslogtreecommitdiffstats
path: root/source/cSocket.cpp
diff options
context:
space:
mode:
authorfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-10-21 23:25:29 +0200
committerfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-10-21 23:25:29 +0200
commitc7b4b9f819e0c1335ece87695599474fc14fcdcf (patch)
treed640af246fec0ea63c408a57a28c61ee4f5961dd /source/cSocket.cpp
parentSetting files (diff)
downloadcuberite-c7b4b9f819e0c1335ece87695599474fc14fcdcf.tar
cuberite-c7b4b9f819e0c1335ece87695599474fc14fcdcf.tar.gz
cuberite-c7b4b9f819e0c1335ece87695599474fc14fcdcf.tar.bz2
cuberite-c7b4b9f819e0c1335ece87695599474fc14fcdcf.tar.lz
cuberite-c7b4b9f819e0c1335ece87695599474fc14fcdcf.tar.xz
cuberite-c7b4b9f819e0c1335ece87695599474fc14fcdcf.tar.zst
cuberite-c7b4b9f819e0c1335ece87695599474fc14fcdcf.zip
Diffstat (limited to '')
-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