let main () : unit Deferred.t =
(* In order to launch the server, we first choose the server's port. *)
let port = 8080 in
printf "listening on port %d\n" port;
(* Then, we Tcp.on_port to create a description of the socket the TCP server
* should listen on. *)
let where_to_listen = Tcp.on_port port in
(* Finally, we create the server with Tcp.Server.create. create returns an
* object of type Tcp.Server.t, but we won't use the server, so we ignore it.
*)
ignore (Tcp.Server.create where_to_listen printer);
(* We want our TCP server to run forever, so we return a deferred that never
* becomes determined! *)
never ()