00001
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef XAPIAN_INCLUDED_REPLICATETCPCLIENT_H
00022 #define XAPIAN_INCLUDED_REPLICATETCPCLIENT_H
00023
00024 #include "remoteconnection.h"
00025
00026 #include "xapian/visibility.h"
00027 #include "replication.h"
00028
00029 #ifdef __WIN32__
00030 # define SOCKET_INITIALIZER_MIXIN : private WinsockInitializer
00031 #else
00032 # define SOCKET_INITIALIZER_MIXIN
00033 #endif
00034
00036 class XAPIAN_VISIBILITY_DEFAULT ReplicateTcpClient SOCKET_INITIALIZER_MIXIN {
00038 void operator=(const ReplicateTcpClient &);
00039
00041 ReplicateTcpClient(const ReplicateTcpClient &);
00042
00044 int socket;
00045
00047 RemoteConnection remconn;
00048
00059 static int open_socket(const std::string & hostname, int port,
00060 double timeout_connect);
00061
00062 public:
00070 ReplicateTcpClient(const std::string & hostname, int port,
00071 double timeout_connect);
00072
00073 void update_from_master(const std::string & path,
00074 const std::string & remotedb,
00075 Xapian::ReplicationInfo & info,
00076 double reader_close_time);
00077
00079 ~ReplicateTcpClient();
00080 };
00081
00082 #endif // XAPIAN_INCLUDED_REPLICATETCPCLIENT_H