sig
module Send : Datum
module Recv : Datum
module Remote_name : Name
module My_name : Name
module Mode : Mode
type logfun =
[ `Recv of Recv.t | `Send of Send.t ] ->
Remote_name.t -> time_sent_received:Core.Std.Time.t -> unit
module Server :
sig
type t
val invariant : t Core.Std.Invariant.inv
val create :
?logfun:Versioned_typed_tcp.S.logfun ->
?now:(unit -> Core.Std.Time.t) ->
?enforce_unique_remote_name:bool ->
?is_client_ip_authorized:(string -> bool) ->
?warn_when_free_connections_lte_pct:float ->
?max_clients:int ->
listen_port:int ->
My_name.t -> Versioned_typed_tcp.S.Server.t Import.Deferred.t
val port : Versioned_typed_tcp.S.Server.t -> int
val close : Versioned_typed_tcp.S.Server.t -> Remote_name.t -> unit
val listen :
Versioned_typed_tcp.S.Server.t ->
(Remote_name.t, Recv.t) Versioned_typed_tcp.Server_msg.t
Import.Stream.t
val listen_ignore_errors :
?stop:unit Import.Deferred.t ->
Versioned_typed_tcp.S.Server.t -> Recv.t Import.Stream.t
val send :
Versioned_typed_tcp.S.Server.t ->
Remote_name.t ->
Send.t -> [ `Dropped | `Sent of Core.Std.Time.t ] Import.Deferred.t
val send_ignore_errors :
Versioned_typed_tcp.S.Server.t -> Remote_name.t -> Send.t -> unit
val send_to_all :
Versioned_typed_tcp.S.Server.t ->
Send.t -> [ `Dropped | `Partial_success | `Sent ] Import.Deferred.t
val send_to_all_ignore_errors :
Versioned_typed_tcp.S.Server.t -> Send.t -> unit
val send_to_some :
Versioned_typed_tcp.S.Server.t ->
Send.t ->
Remote_name.t list ->
[ `Dropped | `Partial_success | `Sent ] Import.Deferred.t
val send_to_some_ignore_errors :
Versioned_typed_tcp.S.Server.t ->
Send.t -> Remote_name.t list -> unit
val client_send_version :
Versioned_typed_tcp.S.Server.t ->
Remote_name.t -> Versioned_typed_tcp.Version.t option
val flushed :
Versioned_typed_tcp.S.Server.t ->
cutoff:unit Import.Deferred.t ->
([ `Flushed of Remote_name.t list ] *
[ `Not_flushed of Remote_name.t list ])
Import.Deferred.t
val shutdown : Versioned_typed_tcp.S.Server.t -> unit Import.Deferred.t
end
module Client :
sig
type t
val create :
?logfun:Versioned_typed_tcp.S.logfun ->
?now:(unit -> Core.Std.Time.t) ->
?check_remote_name:bool ->
ip:string ->
port:int ->
expected_remote_name:Remote_name.t ->
My_name.t -> Versioned_typed_tcp.S.Client.t Import.Deferred.t
val connect : Versioned_typed_tcp.S.Client.t -> unit Import.Deferred.t
val close_connection : Versioned_typed_tcp.S.Client.t -> unit
val listen :
Versioned_typed_tcp.S.Client.t ->
(Remote_name.t, Recv.t) Versioned_typed_tcp.Client_msg.t
Import.Stream.t
val listen_ignore_errors :
?stop:unit Import.Deferred.t ->
Versioned_typed_tcp.S.Client.t -> Recv.t Import.Stream.t
val send :
Versioned_typed_tcp.S.Client.t ->
Send.t -> [ `Dropped | `Sent of Core.Std.Time.t ] Import.Deferred.t
val send_ignore_errors :
Versioned_typed_tcp.S.Client.t -> Send.t -> unit
val state :
Versioned_typed_tcp.S.Client.t ->
[ `Connected | `Connecting | `Disconnected ]
val last_connect_error : Versioned_typed_tcp.S.Client.t -> exn option
val flushed :
Versioned_typed_tcp.S.Client.t ->
[ `Flushed | `Pending of Core.Std.Time.t Import.Deferred.t ]
end
end