File: counter_fcgi.ml

package info (click to toggle)
ocamlnet 4.1.9-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 54,024 kB
  • sloc: ml: 151,939; ansic: 11,071; sh: 2,003; makefile: 1,310
file content (13 lines) | stat: -rw-r--r-- 495 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
(** CGI execution.  You could of course copy the code of counter.ml
    here but it is not done in order to reuse counter.ml with other
    connectors. *)

open Netcgi

let () =
  let port = 1200 in
  Printf.printf "%s (FCGI) listening on port %i.\n%!" Sys.argv.(0) port;
  let buffered _ ch = new Netchannels.buffered_trans_channel ch in
  Netcgi_fcgi.run ~output_type:(`Transactional buffered)
    ~sockaddr:(Unix.ADDR_INET(Unix.inet_addr_any, port))
    (fun cgi -> Counter.main(cgi :> cgi))