xapian-core  1.4.21
remotetcpclient.h
Go to the documentation of this file.
1 
4 /* Copyright (C) 2007,2008,2010,2011,2014 Olly Betts
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; either version 2 of the
9  * License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #ifndef XAPIAN_INCLUDED_REMOTETCPCLIENT_H
22 #define XAPIAN_INCLUDED_REMOTETCPCLIENT_H
23 
25 
26 #ifdef __WIN32__
27 # define SOCKET_INITIALIZER_MIXIN private WinsockInitializer,
28 #else
29 # define SOCKET_INITIALIZER_MIXIN
30 #endif
31 
38  void operator=(const RemoteTcpClient &);
39 
42 
53  static int open_socket(const std::string & hostname, int port,
54  double timeout_connect);
55 
62  static std::string get_tcpcontext(const std::string & hostname, int port);
63 
64  public:
76  RemoteTcpClient(const std::string & hostname, int port,
77  double timeout_, double timeout_connect, bool writable,
78  int flags)
79  : RemoteDatabase(open_socket(hostname, port, timeout_connect),
80  timeout_, get_tcpcontext(hostname, port),
81  writable, flags) { }
82 
85 };
86 
87 #endif // XAPIAN_INCLUDED_REMOTETCPCLIENT_H
RemoteTcpClient(const RemoteTcpClient &)
Don't allow copying.
RemoteDatabase is the baseclass for remote database implementations.
TCP/IP socket based RemoteDatabase implementation.
~RemoteTcpClient()
Destructor.
RemoteDatabase is the baseclass for remote database implementations.
void operator=(const RemoteTcpClient &)
Don't allow assignment.
static int open_socket(const std::string &hostname, int port, double timeout_connect)
Attempt to open a TCP/IP socket connection to xapian-tcpsrv.
RemoteTcpClient(const std::string &hostname, int port, double timeout_, double timeout_connect, bool writable, int flags)
Constructor.
static std::string get_tcpcontext(const std::string &hostname, int port)
Get a context string for use when constructing Xapian::NetworkError.
TCP/IP replication client class.