xapian-core  2.0.0
Public Member Functions | Private Member Functions | Static Private Member Functions | List of all members
RemoteTcpClient Class Reference

TCP/IP socket based RemoteDatabase implementation. More...

#include <remotetcpclient.h>

+ Inheritance diagram for RemoteTcpClient:
+ Collaboration diagram for RemoteTcpClient:

Public Member Functions

 RemoteTcpClient (std::string_view hostname, int port, double timeout_, double timeout_connect, bool writable, int flags)
 Constructor. More...
 
 ~RemoteTcpClient ()
 Destructor. More...
 

Private Member Functions

void operator= (const RemoteTcpClient &)
 Don't allow assignment. More...
 
 RemoteTcpClient (const RemoteTcpClient &)
 Don't allow copying. More...
 

Static Private Member Functions

static std::pair< int, std::string > open_socket (std::string_view hostname, int port, double timeout_connect)
 Attempt to open a TCP/IP socket connection to xapian-tcpsrv. More...
 

Detailed Description

TCP/IP socket based RemoteDatabase implementation.

Connects via TCP/IP to an instance of xapian-tcpsrv.

Definition at line 40 of file remotetcpclient.h.

Constructor & Destructor Documentation

◆ RemoteTcpClient() [1/2]

RemoteTcpClient::RemoteTcpClient ( const RemoteTcpClient )
private

Don't allow copying.

◆ RemoteTcpClient() [2/2]

RemoteTcpClient::RemoteTcpClient ( std::string_view  hostname,
int  port,
double  timeout_,
double  timeout_connect,
bool  writable,
int  flags 
)
inline

Constructor.

Attempts to open a TCP/IP connection to xapian-tcpsrv running on port port of host hostname.

Parameters
timeout_connectTimeout for trying to connect (in seconds).
timeoutTimeout during communication after successfully connecting (in seconds).
writableIs this a WritableDatabase?
flagsXapian::DB_RETRY_LOCK or 0.

Definition at line 77 of file remotetcpclient.h.

◆ ~RemoteTcpClient()

RemoteTcpClient::~RemoteTcpClient ( )

Destructor.

Definition at line 47 of file remotetcpclient.cc.

Member Function Documentation

◆ open_socket()

pair< int, string > RemoteTcpClient::open_socket ( std::string_view  hostname,
int  port,
double  timeout_connect 
)
staticprivate

Attempt to open a TCP/IP socket connection to xapian-tcpsrv.

Connect to xapian-tcpsrv running on port port of host hostname. Give up trying to connect after timeout_connect seconds.

Returns
A std::pair containing the file descriptor for the connection to the child process and a context string to return with any error messages.

Note: this method is called early on during class construction before any member variables or even the base class have been initialised. To help avoid accidentally trying to use member variables or call other methods which do, this method has been deliberately made "static".

Definition at line 33 of file remotetcpclient.cc.

References TcpClient::open_socket(), and Xapian::Internal::str().

◆ operator=()

void RemoteTcpClient::operator= ( const RemoteTcpClient )
private

Don't allow assignment.


The documentation for this class was generated from the following files: