xapian-core  2.0.0
remotetcpserver.h
Go to the documentation of this file.
1 
4 /* Copyright (C) 2007,2008,2010,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_REMOTETCPSERVER_H
22 #define XAPIAN_INCLUDED_REMOTETCPSERVER_H
23 
24 #include "net/tcpserver.h"
25 
26 #include <xapian/database.h>
27 #include <xapian/registry.h>
28 
29 #include <string>
30 #include <vector>
31 
36 class RemoteTcpServer : public TcpServer {
38  void operator=(const RemoteTcpServer &);
39 
42 
47  const std::vector<std::string> dbpaths;
48 
50  bool writable;
51 
54 
56  double idle_timeout;
57 
60 
63 
64  public:
79  RemoteTcpServer(const std::vector<std::string> &dbpaths_,
80  const std::string &host, int port,
81  double active_timeout, double idle_timeout,
82  bool writable, bool verbose);
83 
85  void set_registry(const Xapian::Registry & reg_) { reg = reg_; }
86 
91  void handle_one_connection(int socket);
92 };
93 
94 #endif // XAPIAN_INCLUDED_REMOTETCPSERVER_H
TCP/IP socket based server for RemoteDatabase.
double active_timeout
Timeout between messages during a single operation (in seconds).
void set_registry(const Xapian::Registry &reg_)
Set the registry used for (un)serialisation.
const std::vector< std::string > dbpaths
Paths to the databases we will open.
RemoteTcpServer(const RemoteTcpServer &)
Don't allow copying.
void operator=(const RemoteTcpServer &)
Don't allow assignment.
void handle_one_connection(int socket)
Handle a single connection on an already connected socket.
double idle_timeout
Timeout between operations (in seconds).
int accept_connection()
Accept a connection and return the file descriptor for it.
Xapian::Registry reg
Registry used for (un)serialisation.
bool writable
Is this a WritableDatabase?
Registry for user subclasses.
Definition: registry.h:47
An indexed database of documents.
Class for looking up user subclasses during unserialisation.
Generic TCP/IP socket based server base class.
static int verbose
Definition: xapian-delve.cc:46