MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / Close

Method Close

src/util/sock.cpp:405–419  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

403}
404
405void Sock::Close()
406{
407 if (m_socket == INVALID_SOCKET) {
408 return;
409 }
410#ifdef WIN32
411 int ret = closesocket(m_socket);
412#else
413 int ret = close(m_socket);
414#endif
415 if (ret) {
416 LogWarning("Error closing socket %d: %s", m_socket, NetworkErrorString(WSAGetLastError()));
417 }
418 m_socket = INVALID_SOCKET;
419}
420
421bool Sock::operator==(SOCKET s) const
422{

Callers 2

fork_daemonFunction · 0.45
AppInitFunction · 0.45

Calls 1

NetworkErrorStringFunction · 0.85

Tested by

no test coverage detected