Bitcoin Core  21.99.0
P2P Digital Currency
Classes | Functions | Variables
sock.h File Reference
#include <compat.h>
#include <threadinterrupt.h>
#include <util/time.h>
#include <chrono>
#include <string>
Include dependency graph for sock.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Sock
 RAII helper class that manages a socket. More...
 

Functions

std::string NetworkErrorString (int err)
 Return readable error string for a network error code. More...
 
bool CloseSocket (SOCKET &hSocket)
 Close socket and set hSocket to INVALID_SOCKET. More...
 

Variables

static constexpr auto MAX_WAIT_FOR_IO = 1s
 Maximum time to wait for I/O readiness. More...
 

Function Documentation

◆ CloseSocket()

bool CloseSocket ( SOCKET hSocket)

Close socket and set hSocket to INVALID_SOCKET.

Definition at line 313 of file sock.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ NetworkErrorString()

std::string NetworkErrorString ( int  err)

Return readable error string for a network error code.

Definition at line 295 of file sock.cpp.

Here is the caller graph for this function:

Variable Documentation

◆ MAX_WAIT_FOR_IO

constexpr auto MAX_WAIT_FOR_IO = 1s
staticconstexpr

Maximum time to wait for I/O readiness.

It will take up until this time to break off in case of an interruption.

Definition at line 19 of file sock.h.