xapian-core
1.4.27
|
TCP/IP socket based RemoteDatabase implementation. More...
#include <remotetcpclient.h>
Public Member Functions | |
RemoteTcpClient (const std::string &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 int | open_socket (const std::string &hostname, int port, double timeout_connect) |
Attempt to open a TCP/IP socket connection to xapian-tcpsrv. More... | |
static std::string | get_tcpcontext (const std::string &hostname, int port) |
Get a context string for use when constructing Xapian::NetworkError. More... | |
TCP/IP socket based RemoteDatabase implementation.
Connects via TCP/IP to an instance of xapian-tcpsrv.
Definition at line 36 of file remotetcpclient.h.
|
private |
Don't allow copying.
|
inline |
Constructor.
Attempts to open a TCP/IP connection to xapian-tcpsrv running on port port of host hostname.
timeout_connect | Timeout for trying to connect (in seconds). |
timeout | Timeout during communication after successfully connecting (in seconds). |
writable | Is this a WritableDatabase? |
flags | Xapian::DB_RETRY_LOCK or 0. |
Definition at line 76 of file remotetcpclient.h.
References ~RemoteTcpClient().
RemoteTcpClient::~RemoteTcpClient | ( | ) |
|
staticprivate |
Get a context string for use when constructing Xapian::NetworkError.
Note: this method is used from constructors so has been made static to avoid problems with trying to use uninitialised member variables. In particular, it can't be made a virtual method of the base class.
Definition at line 49 of file remotetcpclient.cc.
References Xapian::Internal::str().
|
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.
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 Xapian::Error::get_error_string(), Xapian::Error::get_msg(), and TcpClient::open_socket().
|
private |
Don't allow assignment.