Nanoev_picos.Net_server
type client_handler = Unix.sockaddr -> IO_in.t -> IO_out.t -> unit
val join : t -> unit
Wait for server to shutdown
val shutdown : t -> unit
Ask the server to stop
val running : t -> bool
val max_connections : t -> int
val n_active_connections : t -> int
val establish :
?backlog:int ->
?max_connections:int ->
?exn_handler:(exn -> Stdlib.Printexc.raw_backtrace -> unit) ->
spawn:((unit -> unit) -> unit Picos.Computation.t) ->
client_handler:client_handler ->
Unix.sockaddr ->
t
Create and start a new server on the given socket address.
val with_ :
?backlog:int ->
?max_connections:int ->
?exn_handler:(exn -> Stdlib.Printexc.raw_backtrace -> unit) ->
spawn:((unit -> unit) -> unit Picos.Computation.t) ->
client_handler:client_handler ->
Unix.sockaddr ->
(t -> 'a) ->
'a