RemoteTcpServer Class Reference

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

#include <remotetcpserver.h>

Collaboration diagram for RemoteTcpServer:

Collaboration graph
[legend]

List of all members.

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.
void handle_one_connection (int socket)
 Handle a single connection on an already connected socket.

Private Member Functions

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

Private Attributes

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


Detailed Description

TCP/IP socket based server for RemoteDatabase.

This class implements the server used by xapian-tcpsrv.

Definition at line 36 of file remotetcpserver.h.


Constructor & Destructor Documentation

RemoteTcpServer::RemoteTcpServer ( const RemoteTcpServer  )  [private]

Don't allow copying.

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.
host The hostname or address for the interface to listen on (or "" to listen on all interfaces).
port The TCP port number to listen on.
active_timeout Timeout between messages during a single operation (in seconds).
idle_timeout Timeout between operations (in seconds).
writable Should we open the DB for writing?
verbose Should we produce output when connections are made or lost?

Definition at line 36 of file remotetcpserver.cc.


Member Function Documentation

int RemoteTcpServer::accept_connection (  )  [private]

Accept a connection and return the filedescriptor for it.

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 47 of file remotetcpserver.cc.

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

void RemoteTcpServer::operator= ( const RemoteTcpServer  )  [private]

Don't allow assignment.


Member Data Documentation

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

Definition at line 53 of file remotetcpserver.h.

Referenced by handle_one_connection().

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 47 of file remotetcpserver.h.

Referenced by handle_one_connection().

Timeout between operations (in seconds).

Definition at line 56 of file remotetcpserver.h.

Referenced by handle_one_connection().

bool RemoteTcpServer::writable [private]

Is this a WritableDatabase?

Definition at line 50 of file remotetcpserver.h.

Referenced by handle_one_connection().


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

Documentation for Xapian (version 1.2.9).
Generated on 10 May 2012 by Doxygen 1.5.9.