00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include <config.h>
00021
00022 #include <xapian/dbfactory.h>
00023
00024 #include "progclient.h"
00025 #include "tcpclient.h"
00026
00027 #include <string>
00028
00029 using namespace std;
00030
00031 namespace Xapian {
00032
00033 Database
00034 Remote::open(const string &host, unsigned int port, Xapian::timeout timeout,
00035 Xapian::timeout connect_timeout)
00036 {
00037 DEBUGAPICALL_STATIC(Database, "Remote::open",
00038 host << ", " << port << ", " << timeout << ", " << connect_timeout);
00039 return Database(new TcpClient(host, port, timeout, connect_timeout, false));
00040 }
00041
00042 WritableDatabase
00043 Remote::open_writable(const string &host, unsigned int port,
00044 Xapian::timeout timeout, Xapian::timeout connect_timeout)
00045 {
00046 DEBUGAPICALL_STATIC(WritableDatabase, "Remote::open_writable",
00047 host << ", " << port << ", " << timeout << ", " << connect_timeout);
00048 return WritableDatabase(new TcpClient(host, port, timeout, connect_timeout, true));
00049 }
00050
00051 Database
00052 Remote::open(const string &program, const string &args, Xapian::timeout timeout)
00053 {
00054 DEBUGAPICALL_STATIC(Database, "Remote::open",
00055 program << ", " << args << ", " << timeout);
00056 return Database(new ProgClient(program, args, timeout, false));
00057 }
00058
00059 WritableDatabase
00060 Remote::open_writable(const string &program, const string &args,
00061 Xapian::timeout timeout)
00062 {
00063 DEBUGAPICALL_STATIC(WritableDatabase, "Remote::open_writable",
00064 program << ", " << args << ", " << timeout);
00065 return WritableDatabase(new ProgClient(program, args, timeout, true));
00066 }
00067
00068 }