P2p_pool.Connectionval fold :
('msg, 'peer, 'conn) t ->
init:'a ->
f:
(Mavryk_base.TzPervasives.P2p_peer.Id.t ->
('msg, 'peer, 'conn) P2p_conn.t ->
'a ->
'a) ->
'afold pool ~init ~f computes (f iN cN ... (f i1 c1 init)...) where id1 ... idN are the ids of every connected peers and c1 ... cN the associated peers info.
val iter :
(Mavryk_base.TzPervasives.P2p_peer.Id.t ->
('msg, 'peer, 'conn) P2p_conn.t ->
unit) ->
('msg, 'peer, 'conn) t ->
unititer f pool applies f to all connected peers of pool.
val list :
('msg, 'peer, 'conn) t ->
(Mavryk_base.TzPervasives.P2p_peer.Id.t * ('msg, 'peer, 'conn) P2p_conn.t)
listval find_by_point :
('msg, 'peer, 'conn) t ->
Mavryk_base.TzPervasives.P2p_point.Id.t ->
('msg, 'peer, 'conn) P2p_conn.t optionval find_by_peer_id :
('msg, 'peer, 'conn) t ->
Mavryk_base.TzPervasives.P2p_peer.Id.t ->
('msg, 'peer, 'conn) P2p_conn.t optionval random_addr :
?different_than:('msg, 'peer, 'conn) P2p_conn.t ->
no_private:bool ->
('msg, 'peer, 'conn) t ->
(Mavryk_base.TzPervasives.P2p_point.Id.t
* Mavryk_base.TzPervasives.P2p_peer.Id.t)
optionrandom_addr ?conn no_private t returns a random (point_id, peer_id) from the pool of connections. It ignores:
no_private is set to trueconnval propose_swap_request :
('msg, 'peer, 'conn) t ->
(Mavryk_base.TzPervasives.P2p_point.Id.t
* Mavryk_base.TzPervasives.P2p_peer.Id.t
* ('msg, 'peer, 'conn) P2p_conn.t)
optionpropose_swap_request t returns a triple (point_id, peer_id, conn) where conn is a random connection to a non-private peer, and (point_id, peer_id) is a random, different, connected peer_id at point_id.