Msgpack_debug.Man_in_the_middle_debuggermodule Peer : sig ... endval wrap_connection_to_peer :
Peer.t ->
my_name:string ->
f:([ `Sent | `Received ] -> Msgpack.t -> unit) ->
(Async.Reader.t
* Async.Writer.t
* [ `Stopped_reading of (unit, string) Result.t Async.Deferred.t ]
* [ `Stopped_writing of (unit, string) Result.t Async.Deferred.t ])
Async.Deferred.tGiven a Reader.t and Writer.t connected to a peer, return a new Reader.t and Writer.t that represents the connection to the peer but that will run f on any messages that are read or written.
val connect_peers_and_listen :
peer1:Peer.t ->
peer2:Peer.t ->
f:([ `Peer_1_to_2 | `Peer_2_to_1 ] -> Msgpack.t -> unit) ->
([ `Peer1 of (unit, string) Result.t ]
* [ `Peer2 of (unit, string) Result.t ])
Async.Deferred.tConnect two peers together and listen to the messages that pass between them. Both readers and writers will be closed when either side closes the connection.