2 * Copyright (c) 1998-1999, Index Data.
3 * See the file LICENSE for details.
4 * Sebastian Hammer, Adam Dickmeiss
6 * $Log: yaz-proxy-main.cpp,v $
7 * Revision 1.10 2000-09-04 08:59:16 adam
8 * Changed call to logging functions (yaz_ added).
10 * Revision 1.9 2000/08/07 14:19:59 adam
11 * Fixed serious bug regarding timeouts. Improved logging for proxy.
13 * Revision 1.8 2000/07/04 13:48:49 adam
14 * Implemented upper-limit on proxy-to-target sessions.
16 * Revision 1.7 1999/12/06 13:52:45 adam
17 * Modified for new location of YAZ header files. Experimental threaded
20 * Revision 1.6 1999/11/10 10:02:34 adam
23 * Revision 1.5 1999/04/21 12:09:01 adam
24 * Many improvements. Modified to proxy server to work with "sessions"
27 * Revision 1.4 1999/04/09 11:46:57 adam
28 * Added object Yaz_Z_Assoc. Much more functional client.
30 * Revision 1.3 1999/02/02 14:01:21 adam
31 * First WIN32 port of YAZ++.
33 * Revision 1.2 1999/01/28 13:08:45 adam
34 * Yaz_PDU_Assoc better encapsulated. Memory leak fix in
35 * yaz-socket-manager.cc.
37 * Revision 1.1.1.1 1999/01/28 09:41:07 adam
38 * First implementation of YAZ++.
43 #include <yaz/options.h>
45 #include <yaz-socket-manager.h>
46 #include <yaz-pdu-assoc.h>
47 #include <yaz-proxy.h>
49 void usage(char *prog)
51 fprintf (stderr, "%s: [-a log] [-c num] [-v level] [-t target] @:port\n", prog);
56 int args(Yaz_Proxy *proxy, int argc, char **argv)
63 while ((ret = options("a:t:v:c:", argv, argc, &arg)) != -2)
76 proxy->set_APDU_log(arg);
79 proxy->set_proxyTarget(arg);
82 yaz_log_init_level (yaz_log_mask_str(arg));
85 proxy->set_max_clients(atoi(arg));
104 int main(int argc, char **argv)
106 Yaz_SocketManager mySocketManager;
107 Yaz_Proxy proxy(new Yaz_PDU_Assoc(&mySocketManager));
109 args(&proxy, argc, argv);
110 while (mySocketManager.processEvent() > 0)