Tidy network poll and implement Identify

This commit is contained in:
Age Manning
2019-03-21 13:15:14 +11:00
parent 35815ce786
commit 13ac5b1d25
2 changed files with 46 additions and 37 deletions

View File

@@ -167,9 +167,12 @@ fn build_transport(
/// Events that can be obtained from polling the Libp2p Service.
pub enum Libp2pEvent {
// We have received an RPC event on the swarm
/// An RPC response request has been received on the swarm.
RPC(PeerId, RPCEvent),
/// Initiated the connection to a new peer.
PeerDialed(PeerId),
/// Received information about a peer on the network.
Identified(PeerId, IdentifyInfo),
// TODO: Pub-sub testing only.
Message(String),
}