pub(super) fn add_incoming(&mut self, peer_addr: SocketAddr, since: Instant) -> bool {
        match self {
            ConnectionSymmetry::IncomingOnly {
                ref mut peer_addrs, ..
            } => {
                // Already incoming connection, just add it to the pile.
                peer_addrs.insert(peer_addr);
                debug!(
                    total_incoming_count = peer_addrs.len(),
                    "added additional incoming connection on non-symmetric"
                );
                false
            }
            ConnectionSymmetry::OutgoingOnly { .. } => {
                // Outgoing graduates to Symmetric when we receive an incoming connection.
                let mut peer_addrs = BTreeSet::new();
                peer_addrs.insert(peer_addr);
                *self = ConnectionSymmetry::Symmetric { peer_addrs };
                debug!("added incoming connection, now symmetric");
                true
            }
            ConnectionSymmetry::Symmetric { peer_addrs } => {
                // Just record an additional incoming connection.
                peer_addrs.insert(peer_addr);
                debug!(
                    total_incoming_count = peer_addrs.len(),
                    "added additional incoming connection on symmetric"
                );
                false
            }
            ConnectionSymmetry::Gone => {
                let mut peer_addrs = BTreeSet::new();
                peer_addrs.insert(peer_addr);
                *self = ConnectionSymmetry::IncomingOnly { peer_addrs, since };
                debug!("added incoming connection, now incoming only");
                false
            }
        }
    }
/// A new incoming connection has been registered.
///
/// Returns true, if the connection achieved symmetry with this change.
A new incoming connection has been registered.
Returns true, if the connection achieved symmetry with this change.
A new incoming connection has been registered . Returns true if the connection achieved symmetry with this change .
pub(super) fn add_incoming(&mut self, peer_addr: SocketAddr, since: Instant) -> bool {
        match self {
            ConnectionSymmetry::IncomingOnly {
                ref mut peer_addrs, ..
            } => {
                // Already incoming connection, just add it to the pile.
                peer_addrs.insert(peer_addr);
                debug!(
                    total_incoming_count = peer_addrs.len(),
                    "added additional incoming connection on non-symmetric"
                );
                false
            }
            ConnectionSymmetry::OutgoingOnly { .. } => {
                // Outgoing graduates to Symmetric when we receive an incoming connection.
                let mut peer_addrs = BTreeSet::new();
                peer_addrs.insert(peer_addr);
                *self = ConnectionSymmetry::Symmetric { peer_addrs };
                debug!("added incoming connection, now symmetric");
                true
            }
            ConnectionSymmetry::Symmetric { peer_addrs } => {
                // Just record an additional incoming connection.
                peer_addrs.insert(peer_addr);
                debug!(
                    total_incoming_count = peer_addrs.len(),
                    "added additional incoming connection on symmetric"
                );
                false
            }
            ConnectionSymmetry::Gone => {
                let mut peer_addrs = BTreeSet::new();
                peer_addrs.insert(peer_addr);
                *self = ConnectionSymmetry::IncomingOnly { peer_addrs, since };
                debug!("added incoming connection, now incoming only");
                false
            }
        }
    }
pub ( super ) fn add_incoming ( & mut self , peer_addr : SocketAddr , since : Instant ) -> bool { match self { ConnectionSymmetry :: IncomingOnly { ref mut peer_addrs , .. } => { // Already incoming connection, just add it to the pile. peer_addrs . insert ( peer_addr ) ; debug ! ( total_incoming_count peer_addrs len ( ) " " ) ; false } ConnectionSymmetry :: OutgoingOnly { .. } => { // Outgoing graduates to Symmetric when we receive an incoming connection. let mut peer_addrs = BTreeSet :: new ( ) ; peer_addrs . insert ( peer_addr ) ; * self = ConnectionSymmetry :: Symmetric { peer_addrs } ; debug ! ( " " ) ; true } ConnectionSymmetry :: Symmetric { peer_addrs } => { // Just record an additional incoming connection. peer_addrs . insert ( peer_addr ) ; debug ! ( total_incoming_count peer_addrs len ( ) " " ) ; false } ConnectionSymmetry :: Gone => { let mut peer_addrs = BTreeSet :: new ( ) ; peer_addrs . insert ( peer_addr ) ; * self = ConnectionSymmetry :: IncomingOnly { peer_addrs , since } ; debug ! ( " " ) ; false } } }
A new incoming connection has been registered.
A new incoming connection has been registered .
&mut self
peer_addr
SocketAddr
since
Instant
&mut self
peer_addr
SocketAddr
since
Instant