Open jurajselep opened 5 years ago
The P2p protocol is simple and can be deduced mostly from the message type.
To make the network topology more dynamic, it implements a simple peer swapping mechanism which works as follows.
Peer A sends a message : [Swap_request (point, peer)] to B. If B is already connected to the peer, the message is ignored.
Otherwise B picks a peer [peer'] at point [point'] and connect to [peer]. If successful, it sends a response [Swap_ack (point', peer')] to A. Upon reception of [Swap_ack]. B tries to connected to [peer']. If successful, it disconnect from [peer].