xapian-core  2.0.0
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, see
18  * <https://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef XAPIAN_INCLUDED_REPLICATETCPCLIENT_H
22 #define XAPIAN_INCLUDED_REPLICATETCPCLIENT_H
23 
24 #include "remoteconnection.h"
25 #include "socket_utils.h"
26 
27 #include "xapian/visibility.h"
28 #include "api/replication.h"
29 
30 #ifdef __WIN32__
31 # define SOCKET_INITIALIZER_MIXIN : private WinsockInitializer
32 #else
33 # define SOCKET_INITIALIZER_MIXIN
34 #endif
35 
39  void operator=(const ReplicateTcpClient &);
40 
42  ReplicateTcpClient(const ReplicateTcpClient &);
43 
45  int socket;
46 
49 
61  static int open_socket(const std::string & hostname, int port,
62  double timeout_connect);
63 
64  public:
73  ReplicateTcpClient(const std::string & hostname, int port,
74  double timeout_connect, double socket_timeout);
75 
76  void update_from_master(const std::string & path,
77  const std::string & remotedb,
79  double reader_close_time,
80  bool force_copy);
81 
84 };
85 
86 #endif // XAPIAN_INCLUDED_REPLICATETCPCLIENT_H
RemoteConnection which owns its own fd(s).
TCP/IP replication client class.
void operator=(const ReplicateTcpClient &)
Don't allow assignment.
ReplicateTcpClient(const ReplicateTcpClient &)
Don't allow copying.
static int open_socket(const std::string &hostname, int port, double timeout_connect)
Attempt to open a TCP/IP socket connection to a replication server.
ReplicateTcpClient(const std::string &hostname, int port, double timeout_connect, double socket_timeout)
Constructor.
~ReplicateTcpClient()
Destructor.
void update_from_master(const std::string &path, const std::string &remotedb, Xapian::ReplicationInfo &info, double reader_close_time, bool force_copy)
OwnedRemoteConnection remconn
Write-only connection to the server.
RemoteConnection class used by the remote backend.
Replication support for Xapian databases.
Socket handling utilities.
Information about the steps involved in performing a replication.
Definition: replication.h:32
Define XAPIAN_VISIBILITY_* macros.
#define XAPIAN_VISIBILITY_DEFAULT
Definition: visibility.h:28
#define XAPIAN_VISIBILITY_INTERNAL
Definition: visibility.h:29