X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=doc%2Ffrontend.xml;h=99f49094e835fccd4651498f8720acbe030b7283;hb=519fe26fff30687caa26c4a26038d02dcc0429c8;hp=19729e102d18fe8426b6ed10b889068c80fcdaad;hpb=bd7e251dac1b07c54884d26295f66b90cfb23131;p=yaz-moved-to-github.git diff --git a/doc/frontend.xml b/doc/frontend.xml index 19729e1..99f4909 100644 --- a/doc/frontend.xml +++ b/doc/frontend.xml @@ -1,7 +1,7 @@ - + Generic server Introduction - + If you aren't into documentation, a good way to learn how the back end interface works is to look at the backend.h @@ -52,7 +52,8 @@ The backend API consists of a small number of function handlers and structure definitions. You are required to provide the main() routine for the server (which can be - quite simple), as well as a set of handlers to match each of the prototypes. + quite simple), as well as a set of handlers to match each of the + prototypes. The interface functions that you write can use any mechanism you like to communicate with your database system: You might link the whole thing together with your database application and access it by @@ -217,14 +218,14 @@ statserv_options_block *statserv_getcontrol(void); enum oid_proto default_proto; - Either PROTO_SR or - PROTO_Z3950. + Either PROTO_Z3950 or + PROTO_SR. Default is PROTO_Z39_50. int idle_timeout; - Maximum session idletime, in minutes. Zero indicates + Maximum session idle-time, in minutes. Zero indicates no (infinite) timeout. Default is 120 minutes. @@ -342,6 +343,7 @@ typedef struct bend_initrequest Z_ReferenceId *referenceId;/* reference ID */ char *peer_name; /* dns host of peer (client) */ + char *implementation_id; char *implementation_name; char *implementation_version; int (*bend_sort) (void *handle, bend_sort_rr *rr); @@ -394,8 +396,10 @@ typedef struct bend_initresult The members peer_name, + implementation_id, implementation_name and - implementation_version holds DNS of client, name + implementation_version holds + DNS of client, ID of implementor, name of client (Z39.50) implementation - and version. @@ -649,7 +653,7 @@ typedef enum { } bend_scan_status; typedef struct bend_scan_rr { - int num_bases; /* number of elements in databaselist */ + int num_bases; /* number of elements in database list */ char **basenames; /* databases to search */ oid_value attributeset; Z_ReferenceId *referenceId; /* reference ID */ @@ -676,111 +680,39 @@ typedef struct bend_scan_rr { The finished application has the following invocation syntax (by way of statserv_main()): - - - appname [-szSiTu -a apdufile -l logfile -v loglevel -c config] - [listener ...] - - + + + appname + + + + + + + + + + + + listener-spec + + - The options are - - - - -a file - - Specify a file for dumping PDUs (for diagnostic purposes). - The special name "-" sends output to - stderr. - - - -S - - Don't fork or make threads on connection requests. This is good for - debugging, but not recommended for real operation: Although the - server is asynchronous and non-blocking, it can be nice to keep - a software malfunction (okay then, a crash) from affecting all - current users. - - - -T - - Operate the server in threaded mode. The server creates a thread - for each connection rather than a fork a process. Only available - on UNIX systems that offers POSIX threads. - - - -s - - Use the SR protocol (obsolete). - - - -z - - Use the Z39.50 protocol (default). These two options complement - each other. You can use both multiple times on the same command - line, between listener-specifications (see below). This way, you - can set up the server to listen for connections in both protocols - concurrently, on different local ports. - - - -l file - The logfile. - - - -c config - A user option that serves as a specifier for some - sort of configuration, e.g. a filename. - The argument to this option is transferred to member - confignameof the - statserv_options_block. - - - -v level - - The log level. Use a comma-separated list of members of the set - {fatal,debug,warn,log,all,none}. - - - -u userid - - Set user ID. Sets the real UID of the server process to that of the - given user. It's useful if you aren't comfortable with having the - server run as root, but you need to start it as such to bind a - privileged port. - + The options are: - -w dir - - Working directory. - + &ztest-options; - -i - - Use this when running from the inetd server. - - - -t minutes - - Idle session timeout, in minutes. - - - -k size - - Maximum record size/message size, in kilobytes. - - - - + A listener specification consists of a transport mode followed by a colon (:) followed by a listener address. The transport mode is - either osi or tcp. + either tcp, unix: or + ssl. - + - For TCP, an address has the form + For TCP and SSL, an address has the form @@ -792,51 +724,29 @@ typedef struct bend_scan_rr { - For osi, the address form is + For UNIX, the address is the filename of socket. - - [t-selector /] hostname | IP-number [: portnumber] - - - The transport selector is given as a string of hex digits (with an even - number of digits). The default port number is 102 (RFC1006 port). + For TCP/IP and SSL, the special hostname "@" is mapped to + the address INADDR_ANY, which causes the + server to listen on any local interface. - + - Examples - - + Examples: - tcp:dranet.dra.com + tcp:@:210 - osi:0402/dbserver.osiworld.com:3000 - - - - In both cases, the special hostname "@" is mapped to - the address INADDR_ANY, which causes the server to listen on any local - interface. To start the server listening on the registered ports for - Z39.50 and SR over OSI/RFC1006, and to drop root privileges once the - ports are bound, execute the server like this (from a root shell): - + ssl:@:3000 - - my-server -u daemon tcp:@ -s osi:@ + unix:/tmp/yaz - - - You can replace daemon with another user, eg. your - own account, or a dedicated IR server account. - my-server should be the name of your - server application. You can test the procedure with the - yaz-ztest application. - +