2 * Copyright (c) 1998-2000, Index Data.
3 * See the file LICENSE for details.
5 * $Log: yaz-proxy-main.cpp,v $
6 * Revision 1.11 2000-09-08 10:23:42 adam
7 * Added skeleton of yaz-z-server.
9 * Revision 1.10 2000/09/04 08:59:16 adam
10 * Changed call to logging functions (yaz_ added).
12 * Revision 1.9 2000/08/07 14:19:59 adam
13 * Fixed serious bug regarding timeouts. Improved logging for proxy.
15 * Revision 1.8 2000/07/04 13:48:49 adam
16 * Implemented upper-limit on proxy-to-target sessions.
18 * Revision 1.7 1999/12/06 13:52:45 adam
19 * Modified for new location of YAZ header files. Experimental threaded
22 * Revision 1.6 1999/11/10 10:02:34 adam
25 * Revision 1.5 1999/04/21 12:09:01 adam
26 * Many improvements. Modified to proxy server to work with "sessions"
29 * Revision 1.4 1999/04/09 11:46:57 adam
30 * Added object Yaz_Z_Assoc. Much more functional client.
32 * Revision 1.3 1999/02/02 14:01:21 adam
33 * First WIN32 port of YAZ++.
35 * Revision 1.2 1999/01/28 13:08:45 adam
36 * Yaz_PDU_Assoc better encapsulated. Memory leak fix in
37 * yaz-socket-manager.cc.
39 * Revision 1.1.1.1 1999/01/28 09:41:07 adam
40 * First implementation of YAZ++.
45 #include <yaz/options.h>
47 #include <yaz-socket-manager.h>
48 #include <yaz-pdu-assoc.h>
49 #include <yaz-proxy.h>
51 void usage(char *prog)
53 fprintf (stderr, "%s: [-a log] [-c num] [-v level] [-t target] @:port\n", prog);
58 int args(Yaz_Proxy *proxy, int argc, char **argv)
65 while ((ret = options("a:t:v:c:", argv, argc, &arg)) != -2)
78 proxy->set_APDU_log(arg);
81 proxy->set_proxyTarget(arg);
84 yaz_log_init_level (yaz_log_mask_str(arg));
87 proxy->set_max_clients(atoi(arg));
106 int main(int argc, char **argv)
108 Yaz_SocketManager mySocketManager;
109 Yaz_Proxy proxy(new Yaz_PDU_Assoc(&mySocketManager));
111 args(&proxy, argc, argv);
112 while (mySocketManager.processEvent() > 0)