xapian-core  1.4.26
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, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #ifndef XAPIAN_INCLUDED_REMOTETCPSERVER_H
22 #define XAPIAN_INCLUDED_REMOTETCPSERVER_H
23 
24 #include "tcpserver.h"
25 
26 #include <xapian/database.h>
27 #include <xapian/registry.h>
28 #include <xapian/visibility.h>
29 
30 #include <string>
31 #include <vector>
32 
37 class XAPIAN_VISIBILITY_DEFAULT RemoteTcpServer : public TcpServer {
39  void operator=(const RemoteTcpServer &);
40 
43 
48  const std::vector<std::string> dbpaths;
49 
51  bool writable;
52 
55 
57  double idle_timeout;
58 
61 
63  int accept_connection();
64 
65  public:
80  RemoteTcpServer(const std::vector<std::string> &dbpaths_,
81  const std::string &host, int port,
82  double active_timeout, double idle_timeout,
83  bool writable, bool verbose);
84 
86  void set_registry(const Xapian::Registry & reg_) { reg = reg_; }
87 
92  void handle_one_connection(int socket);
93 };
94 
95 #endif // XAPIAN_INCLUDED_REMOTETCPSERVER_H
bool writable
Is this a WritableDatabase?
Xapian::Registry reg
Registry used for (un)serialisation.
#define XAPIAN_VISIBILITY_DEFAULT
Definition: visibility.h:28
TCP/IP socket based server for RemoteDatabase.
double active_timeout
Timeout between messages during a single operation (in seconds).
double idle_timeout
Timeout between operations (in seconds).
static int verbose
Definition: xapian-delve.cc:47
void set_registry(const Xapian::Registry &reg_)
Set the registry used for (un)serialisation.
Define XAPIAN_VISIBILITY_* macros.
Registry for user subclasses.
Definition: registry.h:47
API for working with Xapian databases.
const std::vector< std::string > dbpaths
Paths to the databases we will open.
Generic TCP/IP socket based server base class.
Class for looking up user subclasses during unserialisation.