32 ReplicateTcpClient::ReplicateTcpClient(
const string & hostname,
int port,
33 double timeout_connect,
34 double socket_timeout)
35 : socket{
open_socket(hostname, port, timeout_connect)},
43 double timeout_connect)
49 ReplicateTcpClient::update_from_master(
const std::string & path,
50 const std::string & masterdb,
52 double reader_close_time,
56 remconn.send_message(
'R',
57 force_copy ?
string() : replica.get_revision_info(),
59 remconn.send_message(
'D', masterdb, 0.0);
60 replica.set_read_fd(socket);
65 more = replica.apply_next_changeset(&subinfo, reader_close_time);
73 ReplicateTcpClient::~ReplicateTcpClient()
Open a TCP connection to a server.
void set_socket_timeouts(int fd, double timeout)
Attempt to set socket-level timeouts.
int fullcopy_count
Number of times a full database copy was performed.
Access to a database replica, for applying replication to it.
TCP/IP replication client class.
Information about the steps involved in performing a replication.
int changeset_count
Number of changesets applied.
bool changed
True if and only if the replication corresponds to a change in the live version of the database...
Socket handling utilities.
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.