xapian-core  1.4.21
replicatetcpclient.h
Go to the documentation of this file.
1 
4 /* Copyright (C) 2008,2010,2011,2015 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_REPLICATETCPCLIENT_H
22 #define XAPIAN_INCLUDED_REPLICATETCPCLIENT_H
23 
24 #include "remoteconnection.h"
25 
26 #include "xapian/visibility.h"
27 #include "api/replication.h"
28 
29 #ifdef __WIN32__
30 # define SOCKET_INITIALIZER_MIXIN : private WinsockInitializer
31 #else
32 # define SOCKET_INITIALIZER_MIXIN
33 #endif
34 
38  void operator=(const ReplicateTcpClient &);
39 
41  ReplicateTcpClient(const ReplicateTcpClient &);
42 
44  int socket;
45 
48 
59  static int open_socket(const std::string & hostname, int port,
60  double timeout_connect);
61 
62  public:
71  ReplicateTcpClient(const std::string & hostname, int port,
72  double timeout_connect, double socket_timeout);
73 
74  void update_from_master(const std::string & path,
75  const std::string & remotedb,
77  double reader_close_time,
78  bool force_copy);
79 
81  ~ReplicateTcpClient();
82 };
83 
84 #endif // XAPIAN_INCLUDED_REPLICATETCPCLIENT_H
RemoteConnection class used by the remote backend.
OwnedRemoteConnection remconn
Write-only connection to the server.
#define XAPIAN_VISIBILITY_DEFAULT
Definition: visibility.h:28
Define XAPIAN_VISIBILITY_* macros.
Information about the steps involved in performing a replication.
Definition: replication.h:33
RemoteConnection which owns its own fd(s).
Replication support for Xapian databases.
int open_socket(const std::string &hostname, int port, double timeout_connect, bool tcp_nodelay)
Attempt to open a TCP/IP socket connection to a server.
Definition: tcpclient.cc:56
int socket
The socket fd.
TCP/IP replication client class.