From 4435f80e8e03b8920cd9e0a99a8e99b0f9afac62 Mon Sep 17 00:00:00 2001 From: Stefano Zacchiroli Date: Mon, 24 May 2004 12:46:40 +0000 Subject: [PATCH] rewritten "start" comment, now is almost decent --- helm/DEVEL/ocaml-http/http_daemon.mli | 36 ++++++++++++++++----------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/helm/DEVEL/ocaml-http/http_daemon.mli b/helm/DEVEL/ocaml-http/http_daemon.mli index 6d31097d5..ba20a0b42 100644 --- a/helm/DEVEL/ocaml-http/http_daemon.mli +++ b/helm/DEVEL/ocaml-http/http_daemon.mli @@ -108,20 +108,28 @@ val respond_file: (** respond using a prebuilt Http_types.response object *) val respond_with: Http_types.response -> out_channel -> unit - (** create an HTTP daemon listening on 'addr':'port' (defaults are - addr:"0.0.0.0" and port:80), callback is the user supplied function which - receive as a first parameter the path required by the the HTTP client as a - string, and a list of pair representing parameters passed - via GET. The last argument of the callback is an output_channel connected to - the HTTP client to which the user can write directly. 'timeout' parameter sets - a timeout for each request processed by the daemon, if it's set to None, - daemon waits forever for completed requests (use with care!), default is 5 - minute. 'mode' parameter has 3 possible values: `Single means that all request - are handled by the same process, `Fork means that each request is handled by a - separate process, `Thread means that each request is handled by a separate - thread, default is `Fork; 'root' (mnemonic "document root") is the directory - where the daemon chdir before starting up, default is current working - directory *) + (** starts an HTTP daemon listening + * @param addr adress on which daemon will be listening, can be both a numeric + * address (e.g. "127.0.0.1") and an hostname (e.g. "localhost"). Default is + * the wildcard address "0.0.0.0" + * @param port TCP port on which the daemon will be listening. Default is the + * HTTP port 80 + * @param timeout timeout in seconds after which an incoming HTTP request will + * be terminated closing the corresponding TCP connection. Passing None will + * disable the timeout. Default is 5 minutes (300 seconds) + * @param mode requests handling mode, it can have three different values. + * `Single -> all requests will be handled by the same process, + * `Fork -> each request will be handled by a separate process + * `Thread -> each request will be handled by a separate thread + * Default is `Fork + * @param root document root (i.e. directory to which ocaml http will chdir + * before starting handling requests). Default is current working directory + * @param callback function which will be called each time a correct HTTP + * request will be received. 1st callback argument is the path requested by + * the HTTP client; 2nd argument is a list of pairs + * representing decoded query string; 3rd argument is an output channel + * connected with the client + *) val start: ?addr: string -> ?port: int -> ?timeout: int option -> ?mode: Http_types.daemon_mode -> ?root: string -> -- 2.39.2