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

Function CloseSocket

src/netbase.cpp:686–700  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

684#endif
685
686bool CloseSocket(SOCKET& hSocket)
687{
688 if (hSocket == INVALID_SOCKET)
689 return false;
690#ifdef WIN32
691 int ret = closesocket(hSocket);
692#else
693 int ret = close(hSocket);
694#endif
695 if (ret) {
696 LogPrintf("Socket close failed: %d. Error: %s\n", hSocket, NetworkErrorString(WSAGetLastError()));
697 }
698 hSocket = INVALID_SOCKET;
699 return ret != SOCKET_ERROR;
700}
701
702bool SetSocketNonBlocking(const SOCKET& hSocket, bool fNonBlocking)
703{

Callers 7

CreateSocketFunction · 0.85
ConnectNodeMethod · 0.85
CloseSocketDisconnectMethod · 0.85
AcceptConnectionMethod · 0.85
BindListenPortMethod · 0.85
StopMethod · 0.85
~CNodeMethod · 0.85

Calls 1

NetworkErrorStringFunction · 0.85

Tested by

no test coverage detected