xapian-core  2.0.0
remotetcpclient.h
Go to the documentation of this file.
1 
4 /* Copyright (C) 2007,2008,2010,2011,2014,2024 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_REMOTETCPCLIENT_H
22 #define XAPIAN_INCLUDED_REMOTETCPCLIENT_H
23 
25 #include "socket_utils.h"
26 
27 #include <string>
28 #include <string_view>
29 
30 #ifdef __WIN32__
31 # define SOCKET_INITIALIZER_MIXIN private WinsockInitializer,
32 #else
33 # define SOCKET_INITIALIZER_MIXIN
34 #endif
35 
42  void operator=(const RemoteTcpClient &);
43 
46 
61  static std::pair<int, std::string> open_socket(std::string_view hostname,
62  int port,
63  double timeout_connect);
64 
65  public:
77  RemoteTcpClient(std::string_view hostname, int port,
78  double timeout_, double timeout_connect, bool writable,
79  int flags)
80  : RemoteDatabase(open_socket(hostname, port, timeout_connect),
81  timeout_, writable, flags) { }
82 
85 };
86 
87 #endif // XAPIAN_INCLUDED_REMOTETCPCLIENT_H
RemoteDatabase is the baseclass for remote database implementations.
TCP/IP socket based RemoteDatabase implementation.
static std::pair< int, std::string > open_socket(std::string_view hostname, int port, double timeout_connect)
Attempt to open a TCP/IP socket connection to xapian-tcpsrv.
RemoteTcpClient(const RemoteTcpClient &)
Don't allow copying.
~RemoteTcpClient()
Destructor.
RemoteTcpClient(std::string_view hostname, int port, double timeout_, double timeout_connect, bool writable, int flags)
Constructor.
void operator=(const RemoteTcpClient &)
Don't allow assignment.
TCP/IP replication client class.
RemoteDatabase is the baseclass for remote database implementations.
Socket handling utilities.