summaryrefslogtreecommitdiffstats
path: root/src/OSSupport/Socket.cpp
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-01-20 18:21:47 +0100
committerTycho <work.tycho+git@gmail.com>2014-01-20 18:21:47 +0100
commit16375f6aad355333d1d3aff6140cdb4439a9b62f (patch)
treeeb4192092b928e90aebaf914288d12c9cafaf5a5 /src/OSSupport/Socket.cpp
parentAdded Inifile and OSSupport Linking (diff)
parentAPIDump: Added notes about objects across cWorld's task execution. (diff)
downloadcuberite-16375f6aad355333d1d3aff6140cdb4439a9b62f.tar
cuberite-16375f6aad355333d1d3aff6140cdb4439a9b62f.tar.gz
cuberite-16375f6aad355333d1d3aff6140cdb4439a9b62f.tar.bz2
cuberite-16375f6aad355333d1d3aff6140cdb4439a9b62f.tar.lz
cuberite-16375f6aad355333d1d3aff6140cdb4439a9b62f.tar.xz
cuberite-16375f6aad355333d1d3aff6140cdb4439a9b62f.tar.zst
cuberite-16375f6aad355333d1d3aff6140cdb4439a9b62f.zip
Diffstat (limited to 'src/OSSupport/Socket.cpp')
-rw-r--r--src/OSSupport/Socket.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/OSSupport/Socket.cpp b/src/OSSupport/Socket.cpp
index 8ea5d8320..d80c9bb3d 100644
--- a/src/OSSupport/Socket.cpp
+++ b/src/OSSupport/Socket.cpp
@@ -87,6 +87,25 @@ void cSocket::CloseSocket()
+void cSocket::ShutdownReadWrite(void)
+{
+ #ifdef _WIN32
+ int res = shutdown(m_Socket, SD_BOTH);
+ #else
+ int res = shutdown(m_Socket, SHUT_RDWR);
+ #endif
+ if (res != 0)
+ {
+ LOGWARN("%s: Error shutting down socket %d (%s): %d (%s)",
+ __FUNCTION__, m_Socket, m_IPString.c_str(), this->GetLastError(), GetLastErrorString().c_str()
+ );
+ }
+}
+
+
+
+
+
AString cSocket::GetErrorString( int a_ErrNo )
{
char buffer[ 1024 ];