-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bc48f41
commit e04e07a
Showing
4 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
use discv5::libp2p_identity::PeerId; | ||
use discv5::multiaddr::Multiaddr; | ||
use libp2p::core::transport::PortUse; | ||
use libp2p::core::Endpoint; | ||
use libp2p::swarm::dummy::ConnectionHandler; | ||
use libp2p::swarm::{ | ||
ConnectionDenied, ConnectionId, FromSwarm, NetworkBehaviour, THandler, THandlerInEvent, | ||
THandlerOutEvent, ToSwarm, | ||
}; | ||
use std::task::{Context, Poll}; | ||
|
||
pub struct PeerManager {} | ||
|
||
impl PeerManager { | ||
pub fn new() -> Self { | ||
Self {} | ||
} | ||
} | ||
|
||
impl NetworkBehaviour for PeerManager { | ||
type ConnectionHandler = ConnectionHandler; | ||
type ToSwarm = (); | ||
|
||
fn handle_established_inbound_connection( | ||
&mut self, | ||
_connection_id: ConnectionId, | ||
peer: PeerId, | ||
local_addr: &Multiaddr, | ||
remote_addr: &Multiaddr, | ||
) -> Result<THandler<Self>, ConnectionDenied> { | ||
todo!() | ||
} | ||
|
||
fn handle_established_outbound_connection( | ||
&mut self, | ||
_connection_id: ConnectionId, | ||
peer: PeerId, | ||
addr: &Multiaddr, | ||
role_override: Endpoint, | ||
port_use: PortUse, | ||
) -> Result<THandler<Self>, ConnectionDenied> { | ||
todo!() | ||
} | ||
|
||
fn on_swarm_event(&mut self, event: FromSwarm) {} | ||
|
||
fn on_connection_handler_event( | ||
&mut self, | ||
_peer_id: PeerId, | ||
_connection_id: ConnectionId, | ||
_event: THandlerOutEvent<Self>, | ||
) { | ||
todo!() | ||
} | ||
|
||
fn poll( | ||
&mut self, | ||
cx: &mut Context<'_>, | ||
) -> Poll<ToSwarm<Self::ToSwarm, THandlerInEvent<Self>>> { | ||
todo!() | ||
} | ||
} |