MCPcopy Create free account
hub / github.com/cuberite/cuberite / CloseSocket

Method CloseSocket

src/OSSupport/Socket.cpp:68–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66
67
68void cSocket::CloseSocket()
69{
70 #ifdef _WIN32
71
72 closesocket(m_Socket);
73
74 #else // _WIN32
75
76 if (close(m_Socket) != 0)
77 {
78 LOGWARN("Error closing socket %d (%s): %s", m_Socket, m_IPString.c_str(), GetLastErrorString().c_str());
79 }
80
81 #endif // else _WIN32
82
83 // Invalidate the socket so that this object can be re-used for another connection
84 m_Socket = INVALID_SOCKET;
85}
86
87
88

Callers 12

DataReceivedMethod · 0.45
AuthFromAddressMethod · 0.45
OnConnectionAcceptedMethod · 0.45
~cSocketThreadMethod · 0.45
RemoveClientMethod · 0.45
StartMethod · 0.45
ExecuteMethod · 0.45
ReadFromSocketsMethod · 0.45
WriteToSocketsMethod · 0.45
SendDataThroughSocketMethod · 0.45
CleanUpShutSocketsMethod · 0.45
StopMethod · 0.45

Calls 2

LOGWARNFunction · 0.85
c_strMethod · 0.80

Tested by

no test coverage detected