Struct ckb_network::network::NetworkController
source · [−]pub struct NetworkController { /* private fields */ }Expand description
Network controller
Implementations
set ckb2021 start
get ckb2021 flag
Node listen address list
Disconnect session with peer id
pub fn get_banned_addrs(&self) -> Vec<BannedAddr>ⓘ
pub fn get_banned_addrs(&self) -> Vec<BannedAddr>ⓘ
Get banned peer list
Clear banned list
Return all connected peers’ information
Ban an peer through peer index
Broadcast a message to all connected peers
pub fn quick_broadcast(
&self,
proto_id: ProtocolId,
data: Bytes
) -> Result<(), SendErrorKind>
pub fn quick_broadcast(
&self,
proto_id: ProtocolId,
data: Bytes
) -> Result<(), SendErrorKind>
Broadcast a message to all connected peers through quick queue
pub fn send_message_to(
&self,
session_id: SessionId,
proto_id: ProtocolId,
data: Bytes
) -> Result<(), SendErrorKind>
pub fn send_message_to(
&self,
session_id: SessionId,
proto_id: ProtocolId,
data: Bytes
) -> Result<(), SendErrorKind>
Send message to one connected peer
network message processing controller, always true, if false, discard any received messages
Change active status, if set false discard any received messages
Return all connected peers’ protocols info
Try ping all connected peers
Since a non-owning reference does not count towards ownership, it will not prevent the value stored in the allocation from being dropped
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for NetworkController
impl Send for NetworkController
impl Sync for NetworkController
impl Unpin for NetworkController
impl !UnwindSafe for NetworkController
Blanket Implementations
Mutably borrows from an owned value. Read more