sig
module Client_message : sig type t end
module Server_message : sig type 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 * Typed_tcp_intf.S.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 -> Typed_tcp_intf.S.t Import.Deferred.t
val listen :
Typed_tcp_intf.S.t ->
Typed_tcp_intf.S.Server_read_result.t Import.Pipe.Reader.t
val listen_ignore_errors :
Typed_tcp_intf.S.t ->
(Client_id.t * Typed_tcp_intf.S.Client_message.t) Import.Pipe.Reader.t
val close : Typed_tcp_intf.S.t -> Client_id.t -> unit
val flushed_time :
Typed_tcp_intf.S.t ->
Client_id.t ->
[ `Client_not_found | `Flushed of Core.Std.Time.t Import.Deferred.t ]
val has_client_id : Typed_tcp_intf.S.t -> Client_id.t -> bool
val send :
Typed_tcp_intf.S.t ->
Client_id.t ->
Typed_tcp_intf.S.Server_message.t ->
[ `Drop of exn | `Sent of Core.Std.Time.t ] Import.Deferred.t
val send_ignore_errors :
Typed_tcp_intf.S.t ->
Client_id.t -> Typed_tcp_intf.S.Server_message.t -> unit
val send_to_all :
Typed_tcp_intf.S.t -> Typed_tcp_intf.S.Server_message.t -> unit
val client_addr_port :
Typed_tcp_intf.S.t ->
Client_id.t -> (Import.Unix.Inet_addr.t * int) option
end