functor (Arg : Arg) ->
sig
module Client_message :
sig
type t = Arg.Client_message.t
val t_of_sexp : Sexplib.Sexp.t -> t
val sexp_of_t : t -> Sexplib.Sexp.t
end
module Server_message :
sig
type t = Arg.Server_message.t
val t_of_sexp : Sexplib.Sexp.t -> t
val sexp_of_t : t -> Sexplib.Sexp.t
end
module Client_id : Core.Std.Unique_id
module Server_read_result :
sig
type t =
Connect of Client_id.t
| Disconnect of Client_id.t * Core.Std.Sexp.t
| Denied_access of string
| Data of Client_id.t * Client_message.t
val t_of_sexp : Sexplib.Sexp.t -> t
val sexp_of_t : t -> Sexplib.Sexp.t
end
type t
val create :
?max_pending_connections:int ->
?verbose:bool ->
?log_disconnects:bool ->
?buffer_age_limit:[ `At_most of Core.Std.Time.Span.t | `Unlimited ] ->
port:int ->
auth:(Import.Unix.Inet_addr.t ->
int -> [ `Allow | `Deny of string option ] Import.Deferred.t) ->
unit -> t Import.Deferred.t
val listen : t -> Server_read_result.t Import.Pipe.Reader.t
val listen_ignore_errors :
t -> (Client_id.t * Client_message.t) Import.Pipe.Reader.t
val close : t -> Client_id.t -> unit
val flushed_time :
t ->
Client_id.t ->
[ `Client_not_found | `Flushed of Core.Std.Time.t Import.Deferred.t ]
val has_client_id : t -> Client_id.t -> bool
val send :
t ->
Client_id.t ->
Server_message.t ->
[ `Drop of exn | `Sent of Core.Std.Time.t ] Import.Deferred.t
val send_ignore_errors : t -> Client_id.t -> Server_message.t -> unit
val send_to_all : t -> Server_message.t -> unit
val client_addr_port :
t -> Client_id.t -> (Import.Unix.Inet_addr.t * int) option
end