xapian-core  2.0.0
Functions
TcpClient Namespace Reference

Functions

int open_socket (std::string_view hostname, int port, double timeout_connect, bool tcp_nodelay, const std::string &context)
 Attempt to open a TCP/IP socket connection to a server. More...
 

Function Documentation

◆ open_socket()

int TcpClient::open_socket ( std::string_view  hostname,
int  port,
double  timeout_connect,
bool  tcp_nodelay,
const std::string &  context 
)

Attempt to open a TCP/IP socket connection to a server.

Connect to the server running on port port of host hostname. Give up trying to connect after timeout_connect seconds.

Definition at line 51 of file tcpclient.cc.

References CLOSESOCKET, FLAG_NAME, FUNC_NAME, SOCK_CLOEXEC, socket_errno(), SOCKLEN_T, and RealTime::to_timeval().

Referenced by RemoteTcpClient::open_socket().