This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* ocamlfind c -w A -linkpkg -package lwt,lwt.unix,lwt.syntax -syntax camlp4o,lwt.syntax myecho.ml -o myecho *) | |
(* This code refers to https://github.com/avsm/ocaml-cohttpserver/blob/master/server/http_tcp_server.ml *) | |
open Lwt | |
let server_port = 12345 | |
let so_timeout = Some 20 | |
let backlog = 10 | |
let try_close chan = | |
catch (fun () -> Lwt_io.close chan) |