Moonpool_lwt.TCP_server
type t = Lwt_io.server
val establish_lwt :
?backlog:int ->
?no_close:bool ->
runner:Moonpool.Runner.t ->
Unix.sockaddr ->
(Unix.sockaddr -> Lwt_io.input_channel -> Lwt_io.output_channel -> unit) ->
t
establish ~runner addr handler
runs a TCP server in the Lwt thread. When a client connects, a moonpool fiber is started on runner
to handle it.
val establish :
?backlog:int ->
?no_close:bool ->
runner:Moonpool.Runner.t ->
Unix.sockaddr ->
(Unix.sockaddr -> IO_in.t -> IO_out.t -> unit) ->
t
Like establish_lwt
but uses IO
to directly handle reads and writes on client sockets.
val shutdown : t -> unit
Shutdown the server