summaryrefslogtreecommitdiffstats
path: root/src/OSSupport/Socket.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-01-19 19:31:43 +0100
committermadmaxoft <github@xoft.cz>2014-01-19 19:31:43 +0100
commit3c0e8c8da0e397f3fda6b1565e7b2e9eeb4a747b (patch)
tree5eaa7eb6bfd5434d008186decd3d43e302a9c2d8 /src/OSSupport/Socket.cpp
parentAdded graph of SocketThreads state transitions. (diff)
downloadcuberite-3c0e8c8da0e397f3fda6b1565e7b2e9eeb4a747b.tar
cuberite-3c0e8c8da0e397f3fda6b1565e7b2e9eeb4a747b.tar.gz
cuberite-3c0e8c8da0e397f3fda6b1565e7b2e9eeb4a747b.tar.bz2
cuberite-3c0e8c8da0e397f3fda6b1565e7b2e9eeb4a747b.tar.lz
cuberite-3c0e8c8da0e397f3fda6b1565e7b2e9eeb4a747b.tar.xz
cuberite-3c0e8c8da0e397f3fda6b1565e7b2e9eeb4a747b.tar.zst
cuberite-3c0e8c8da0e397f3fda6b1565e7b2e9eeb4a747b.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 ];