2 * Copyright (c) 1998-2001, Index Data.
3 * See the file LICENSE for details.
5 * $Log: yaz-proxy-main.cpp,v $
6 * Revision 1.13 2001-04-10 10:48:08 adam
7 * Fixed problem where proxy could cash bad result sets.
9 * Revision 1.12 2000/10/11 11:58:16 adam
10 * Moved header files to include/yaz++. Switched to libtool and automake.
11 * Configure script creates yaz++-config script.
13 * Revision 1.11 2000/09/08 10:23:42 adam
14 * Added skeleton of yaz-z-server.
16 * Revision 1.10 2000/09/04 08:59:16 adam
17 * Changed call to logging functions (yaz_ added).
19 * Revision 1.9 2000/08/07 14:19:59 adam
20 * Fixed serious bug regarding timeouts. Improved logging for proxy.
22 * Revision 1.8 2000/07/04 13:48:49 adam
23 * Implemented upper-limit on proxy-to-target sessions.
25 * Revision 1.7 1999/12/06 13:52:45 adam
26 * Modified for new location of YAZ header files. Experimental threaded
29 * Revision 1.6 1999/11/10 10:02:34 adam
32 * Revision 1.5 1999/04/21 12:09:01 adam
33 * Many improvements. Modified to proxy server to work with "sessions"
36 * Revision 1.4 1999/04/09 11:46:57 adam
37 * Added object Yaz_Z_Assoc. Much more functional client.
39 * Revision 1.3 1999/02/02 14:01:21 adam
40 * First WIN32 port of YAZ++.
42 * Revision 1.2 1999/01/28 13:08:45 adam
43 * Yaz_PDU_Assoc better encapsulated. Memory leak fix in
44 * yaz-socket-manager.cc.
46 * Revision 1.1.1.1 1999/01/28 09:41:07 adam
47 * First implementation of YAZ++.
52 #include <yaz/options.h>
54 #include <yaz++/yaz-socket-manager.h>
55 #include <yaz++/yaz-pdu-assoc.h>
56 #include <yaz++/yaz-proxy.h>
58 void usage(char *prog)
60 fprintf (stderr, "%s: [-a log] [-c num] [-v level] [-t target] @:port\n", prog);
65 int args(Yaz_Proxy *proxy, int argc, char **argv)
72 while ((ret = options("a:t:v:c:", argv, argc, &arg)) != -2)
85 proxy->set_APDU_log(arg);
88 proxy->set_proxyTarget(arg);
91 yaz_log_init_level (yaz_log_mask_str(arg));
94 proxy->set_max_clients(atoi(arg));
113 int main(int argc, char **argv)
115 Yaz_SocketManager mySocketManager;
116 Yaz_Proxy proxy(new Yaz_PDU_Assoc(&mySocketManager));
118 args(&proxy, argc, argv);
119 while (mySocketManager.processEvent() > 0)