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 "debuglog.h"
00025 #include "progclient.h"
00026 #include "remotetcpclient.h"
00027
00028 #include <string>
00029
00030 using namespace std;
00031
00032 namespace Xapian {
00033
00034 Database
00035 Remote::open(const string &host, unsigned int port, Xapian::timeout timeout_,
00036 Xapian::timeout connect_timeout)
00037 {
00038 LOGCALL_STATIC(API, Database, "Remote::open", host | port | timeout_ | connect_timeout);
00039 return Database(new RemoteTcpClient(host, port, timeout_ * 1e-3,
00040 connect_timeout * 1e-3, false));
00041 }
00042
00043 WritableDatabase
00044 Remote::open_writable(const string &host, unsigned int port,
00045 Xapian::timeout timeout_, Xapian::timeout connect_timeout)
00046 {
00047 LOGCALL_STATIC(API, WritableDatabase, "Remote::open_writable", host | port | timeout_ | connect_timeout);
00048 return WritableDatabase(new RemoteTcpClient(host, port, timeout_ * 1e-3,
00049 connect_timeout * 1e-3, true));
00050 }
00051
00052 Database
00053 Remote::open(const string &program, const string &args,
00054 Xapian::timeout timeout_)
00055 {
00056 LOGCALL_STATIC(API, Database, "Remote::open", program | args | timeout_);
00057 return Database(new ProgClient(program, args, timeout_ * 1e-3, false));
00058 }
00059
00060 WritableDatabase
00061 Remote::open_writable(const string &program, const string &args,
00062 Xapian::timeout timeout_)
00063 {
00064 LOGCALL_STATIC(API, WritableDatabase, "Remote::open_writable", program | args | timeout_);
00065 return WritableDatabase(new ProgClient(program, args,
00066 timeout_ * 1e-3, true));
00067 }
00068
00069 }