pub async fn handshake(
reader: &mut FramedReader<PeerNetMsgCodec>,
writer: &mut FramedWriter<PeerNetMsgCodec>,
p: &HandshakeParams<'_>,
) -> Result<(PeerID, Vec<ProtocolID>)>Expand description
Run the handshake on split reader/writer. Returns the remote peer ID and the set of protocols both sides support.
Both sides send a VerMsg, check the remote one with the same rules, then send a VerAck. So both sides end up with the same protocol set.