X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=doc%2Ffrontend.xml;h=03ee19aed22363c793fe55620ce9f42d857cdf51;hp=bc6f9786b5e3424b9db2851bd8286d96eb1f0436;hb=3227202c561b3189378cba8318c7610aeae1421a;hpb=3d18b35078096b9fd1feb8e2d6fd7e9e48755ad5 diff --git a/doc/frontend.xml b/doc/frontend.xml index bc6f978..03ee19a 100644 --- a/doc/frontend.xml +++ b/doc/frontend.xml @@ -1,6 +1,5 @@ - + Making an IR Server for Your Database - Introduction @@ -45,7 +44,7 @@ - + The Database Frontend @@ -86,7 +85,7 @@ Extended Services (optional). - + Result-Set Delete (optional). @@ -94,7 +93,7 @@ Result-Set Sort (optional). - + @@ -128,9 +127,9 @@ - int statserv_main(int argc, char **argv, - bend_initresult *(*bend_init)(bend_initrequest *r), - void (*bend_close)(void *handle)); +int statserv_main(int argc, char **argv, + bend_initresult *(*bend_init)(bend_initrequest *r), + void (*bend_close)(void *handle)); @@ -146,95 +145,115 @@ according to the parameters given. When connection requests are received, the event handler will typically fork() and create a sub-process to handle a new connection. - Alternatively the server may be setup to create threads for each connection. + Alternatively the server may be setup to create threads for each + connection. If you do use global variables and forking, you should be aware, then, that these cannot be shared between associations, unless you explicitly disable forking by command line parameters. - + The server provides a mechanism for controlling some of its behavior without using command-line options. The function - statserv_options_block *statserv_getcontrol(void); +statserv_options_block *statserv_getcontrol(void); - Will return a pointer to a struct statserv_options_block + will return a pointer to a struct statserv_options_block describing the current default settings of the server. The structure contains these elements: - + - int dynamic + + int dynamic A boolean value, which determines whether the server will fork on each incoming request (TRUE), or not (FALSE). Default is TRUE. This flag is only read by UNIX-based servers (WIN32 based servers doesn't fork). - - int threads + + + int threads A boolean value, which determines whether the server will create a thread on each incoming request (TRUE), or not (FALSE). - Default is FALSE. This flag is only read by UNIX-based servers that offer - POSIX Threads support. WIN32-based servers always operate in threaded mode. + Default is FALSE. This flag is only read by UNIX-based servers + that offer POSIX Threads support. + WIN32-based servers always operate in threaded mode. - - int inetd + + + int inetd A boolean value, which determines whether the server will operates under a UNIX INET daemon (inetd). Default is FALSE. - - int loglevel + + + int loglevel Set this by ORing the constants defined in include/yaz/yaz-log.h. - - char logfile[ODR_MAXNAME+1] + + + char logfile[ODR_MAXNAME+1] File for diagnostic output ("": stderr). - char apdufile[ODR_MAXNAME+1] + + + char apdufile[ODR_MAXNAME+1] - Name of file for logging incoming and outgoing APDUs ("": don't - log APDUs, "-": stderr). + Name of file for logging incoming and outgoing APDUs + ("": don't log APDUs, "-": + stderr). - char default_listen[1024] + + char default_listen[1024] Same form as the command-line specification of listener address. "": no default listener address. Default is to listen at "tcp:@:9999". You can only specify one default listener address in this fashion. - enum oid_proto default_proto; + + enum oid_proto default_proto; Either PROTO_SR or - PROTO_Z3950. Default is PROTO_Z39_50. + PROTO_Z3950. + Default is PROTO_Z39_50. - int idle_timeout; + + + int idle_timeout; Maximum session idletime, in minutes. Zero indicates no (infinite) timeout. Default is 120 minutes. - - int maxrecordsize; + + + int maxrecordsize; Maximum permissible record (message) size. Default - is 1Mb. This amount of memory will only be allocated if a client requests a - very large amount of records in one operation (or a big record). Set it - to a lower number - if you are worried about resource consumption on your host system. + is 1Mb. This amount of memory will only be allocated if a + client requests a very large amount of records in one operation + (or a big record). + Set it to a lower number if you are worried about resource + consumption on your host system. - char configname[ODR_MAXNAME+1] + + char configname[ODR_MAXNAME+1] Passed to the backend when a new connection is received. - char setuid[ODR_MAXNAME+1] + + char setuid[ODR_MAXNAME+1] Set user id to the user specified, after binding the listener addresses. - - - void (*bend_start)(struct statserv_options_block *p) + + + void (*bend_start)(struct statserv_options_block *p) + Pointer to function which is called after the command line options have been parsed - but before the server starts listening. @@ -246,9 +265,10 @@ When the server operates as an NT service this handler is called whenever the service is started. - - - void (*bend_stop)(struct statserv_options_block *p) + + + void (*bend_stop)(struct statserv_options_block *p) + Pointer to function which is called whenver the server has stopped listening for incoming connections. This function pointer has a default value of NULL in which case it isn't called. @@ -256,7 +276,8 @@ whenever the service is stopped. - void *handle + + void *handle User defined pointer (default value NULL). This is a per-server handle that can be used to specify "user-data". Do not confuse this with the session-handle as returned by bend_init. @@ -270,9 +291,9 @@ a static area. You are allowed to change the contents of the structure, but the changes will not take effect before you call - + - void statserv_setcontrol(statserv_options_block *block); +void statserv_setcontrol(statserv_options_block *block); @@ -294,7 +315,7 @@ Init - bend_initresult (*bend_init)(bend_initrequest *r); +bend_initresult (*bend_init)(bend_initrequest *r); @@ -431,8 +452,8 @@ typedef struct { corresponding to the resultSetIndicator field in the protocol. num_bases/basenames is a length of/array of character pointers to the database names provided by the client. - The query is the full query structure as defined in the - protocol ASN.1 specification. + The query is the full query structure as defined in + the protocol ASN.1 specification. It can be either of the possible query types, and it's up to you to determine if you can handle the provided query type. Rather than reproduce the C interface here, we'll refer you to the @@ -496,8 +517,8 @@ typedef struct bend_fetch_rr { allocating space for structured data records. The stream will be reset when all records have been assembled, and the response package has been transmitted. - For unstructured data, the backend is responsible for maintaining a static - or dynamic buffer for the record between calls. + For unstructured data, the backend is responsible for maintaining a + static or dynamic buffer for the record between calls. @@ -552,7 +573,7 @@ typedef struct { oid_value format; /* One of the CLASS_RECSYN members */ Z_ReferenceId *referenceId;/* reference ID */ Z_RecordComposition *comp; /* Formatting instructions */ - ODR stream; /* encoding stream - memory source if required */ + ODR stream; /* encoding stream */ ODR print; /* printing stream */ bend_request request; bend_association association; @@ -604,8 +625,8 @@ typedef struct bend_delete_rr { - The delete set function definition is rather primitive, mostly because we - have had no practical need for it as of yet. If someone wants + The delete set function definition is rather primitive, mostly because + we have had no practical need for it as of yet. If someone wants to provide a full delete service, we'd be happy to add the extra parameters that are required. Are there clients out there that will actually delete sets they no longer need?