xapian-core  1.4.21
Public Member Functions | Private Member Functions | Private Attributes | List of all members
RemoteTcpServer Class Reference

TCP/IP socket based server for RemoteDatabase. More...

#include <remotetcpserver.h>

+ Inheritance diagram for RemoteTcpServer:
+ Collaboration diagram for RemoteTcpServer:

Public Member Functions

 RemoteTcpServer (const std::vector< std::string > &dbpaths_, const std::string &host, int port, double active_timeout, double idle_timeout, bool writable, bool verbose)
 Construct a RemoteTcpServer for a Database and start listening for connections. More...
 
void set_registry (const Xapian::Registry &reg_)
 Set the registry used for (un)serialisation. More...
 
void handle_one_connection (int socket)
 Handle a single connection on an already connected socket. More...
 

Private Member Functions

void operator= (const RemoteTcpServer &)
 Don't allow assignment. More...
 
 RemoteTcpServer (const RemoteTcpServer &)
 Don't allow copying. More...
 
int accept_connection ()
 Accept a connection and return the file descriptor for it. More...
 

Private Attributes

const std::vector< std::string > dbpaths
 Paths to the databases we will open. More...
 
bool writable
 Is this a WritableDatabase? More...
 
double active_timeout
 Timeout between messages during a single operation (in seconds). More...
 
double idle_timeout
 Timeout between operations (in seconds). More...
 
Xapian::Registry reg
 Registry used for (un)serialisation. More...
 

Detailed Description

TCP/IP socket based server for RemoteDatabase.

This class implements the server used by xapian-tcpsrv.

Definition at line 37 of file remotetcpserver.h.

Constructor & Destructor Documentation

◆ RemoteTcpServer() [1/2]

RemoteTcpServer::RemoteTcpServer ( const RemoteTcpServer )
private

Don't allow copying.

◆ RemoteTcpServer() [2/2]

RemoteTcpServer::RemoteTcpServer ( const std::vector< std::string > &  dbpaths_,
const std::string &  host,
int  port,
double  active_timeout,
double  idle_timeout,
bool  writable,
bool  verbose 
)

Construct a RemoteTcpServer for a Database and start listening for connections.

The RemoteTcpServer constructor, taking a database and a listening port.

Parameters
dbpaths_The path(s) to the database(s) we should open.
hostThe hostname or address for the interface to listen on (or "" to listen on all interfaces).
portThe TCP port number to listen on.
active_timeoutTimeout between messages during a single operation (in seconds).
idle_timeoutTimeout between operations (in seconds).
writableShould we open the DB for writing?
verboseShould we produce output when connections are made or lost?

Definition at line 37 of file remotetcpserver.cc.

Member Function Documentation

◆ accept_connection()

int RemoteTcpServer::accept_connection ( )
private

Accept a connection and return the file descriptor for it.

◆ handle_one_connection()

void RemoteTcpServer::handle_one_connection ( int  socket)

Handle a single connection on an already connected socket.

This method may be called by multiple threads.

Definition at line 48 of file remotetcpserver.cc.

References active_timeout, dbpaths, Xapian::Error::get_description(), idle_timeout, reg, RemoteServer::run(), RemoteServer::set_registry(), verbose, and writable.

◆ operator=()

void RemoteTcpServer::operator= ( const RemoteTcpServer )
private

Don't allow assignment.

◆ set_registry()

void RemoteTcpServer::set_registry ( const Xapian::Registry reg_)
inline

Set the registry used for (un)serialisation.

Definition at line 86 of file remotetcpserver.h.

Referenced by register_user_weighting_schemes().

Member Data Documentation

◆ active_timeout

double RemoteTcpServer::active_timeout
private

Timeout between messages during a single operation (in seconds).

Definition at line 54 of file remotetcpserver.h.

Referenced by handle_one_connection().

◆ dbpaths

const std::vector<std::string> RemoteTcpServer::dbpaths
private

Paths to the databases we will open.

Contains exactly one entry if writable, and at least one if not.

Definition at line 48 of file remotetcpserver.h.

Referenced by handle_one_connection().

◆ idle_timeout

double RemoteTcpServer::idle_timeout
private

Timeout between operations (in seconds).

Definition at line 57 of file remotetcpserver.h.

Referenced by handle_one_connection().

◆ reg

Xapian::Registry RemoteTcpServer::reg
private

Registry used for (un)serialisation.

Definition at line 60 of file remotetcpserver.h.

Referenced by handle_one_connection().

◆ writable

bool RemoteTcpServer::writable
private

Is this a WritableDatabase?

Definition at line 51 of file remotetcpserver.h.

Referenced by handle_one_connection().


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