sig
type t
val create :
?implementations:'s Implementations.t ->
connection_state:'s ->
?max_message_size:int ->
Import.Reader.t ->
Import.Writer.t ->
(t, Core.Std.Exn.t) Core.Std.Result.t Import.Deferred.t
val close : t -> unit Import.Deferred.t
val close_finished : t -> unit Import.Deferred.t
val is_closed : t -> bool
val bytes_to_write : t -> int
val with_close :
?implementations:'s Implementations.t ->
connection_state:'s ->
Import.Reader.t ->
Import.Writer.t ->
dispatch_queries:(t -> 'a Import.Deferred.t) ->
on_handshake_error:[ `Call of Core.Std.Exn.t -> 'a Import.Deferred.t
| `Raise ] ->
'a Import.Deferred.t
val server_with_close :
Import.Reader.t ->
Import.Writer.t ->
implementations:'s Implementations.t ->
connection_state:'s ->
on_handshake_error:[ `Call of Core.Std.Exn.t -> unit Import.Deferred.t
| `Ignore
| `Raise ] ->
unit Import.Deferred.t
val serve :
implementations:'s Implementations.t ->
initial_connection_state:(([< Import.Socket.Address.t ] as 'a) -> 's) ->
where_to_listen:('a, 'listening_on) Tcp.Where_to_listen.t ->
?auth:('a -> bool) ->
?on_handshake_error:[ `Call of Core.Std.Exn.t -> unit | `Ignore | `Raise ] ->
unit -> ('a, 'listening_on) Tcp.Server.t Import.Deferred.t
val client :
host:string ->
port:int -> (t, Core.Std.Exn.t) Core.Std.Result.t Import.Deferred.t
val with_client :
host:string ->
port:int ->
(t -> 'a Import.Deferred.t) ->
('a, Core.Std.Exn.t) Core.Std.Result.t Import.Deferred.t
end