pub fn dropped(&mut self, peer_id: PeerId) {
		trace!("Dropping {}\nin_slots={:?}\nout_slots={:?}", peer_id, self.data.in_slots, self.data.out_slots);
		// Automatically connect back if reserved.
		if self.data.in_slots.is_connected_and_reserved(&peer_id) || self.data.out_slots.is_connected_and_reserved(&peer_id) {
			self.message_queue.push_back(Message::Connect(peer_id));
			return;
		}

		// Otherwise, free the slot.
		self.data.in_slots.clear_slot(&peer_id);
		self.data.out_slots.clear_slot(&peer_id);

		// Note: in this dummy implementation we consider that peers never expire. As soon as we
		// are disconnected from a peer, we try again.
		self.data.discovered.add_peer(peer_id, SlotType::Common);
		self.alloc_slots();
	}
/// Indicate that we dropped an active connection with a peer, or that we failed to connect.
///
/// Must only be called after the PSM has either generated a `Connect` message with this
/// `PeerId`, or accepted an incoming connection with this `PeerId`.
Indicate that we dropped an active connection with a peer, or that we failed to connect.
Indicate that we dropped an active connection with a peer or that we failed to connect .
pub fn dropped(&mut self, peer_id: PeerId) {
		trace!("Dropping {}\nin_slots={:?}\nout_slots={:?}", peer_id, self.data.in_slots, self.data.out_slots);
		// Automatically connect back if reserved.
		if self.data.in_slots.is_connected_and_reserved(&peer_id) || self.data.out_slots.is_connected_and_reserved(&peer_id) {
			self.message_queue.push_back(Message::Connect(peer_id));
			return;
		}
		// Otherwise, free the slot.
		self.data.in_slots.clear_slot(&peer_id);
		self.data.out_slots.clear_slot(&peer_id);
		// Note: in this dummy implementation we consider that peers never expire. As soon as we
		// are disconnected from a peer, we try again.
		self.data.discovered.add_peer(peer_id, SlotType::Common);
		self.alloc_slots();
	}
pub fn dropped ( & mut self , peer_id : PeerId ) { trace ! ( " \n \n " peer_id self data in_slots self data out_slots ) ; // Automatically connect back if reserved. if self . data . in_slots . is_connected_and_reserved ( & peer_id ) || self . data . out_slots . is_connected_and_reserved ( & peer_id ) { self . message_queue . push_back ( Message :: Connect ( peer_id ) ) ; return ; } // Otherwise, free the slot. self . data . in_slots . clear_slot ( & peer_id ) ; self . data . out_slots . clear_slot ( & peer_id ) ; // Note: in this dummy implementation we consider that peers never expire. As soon as we // are disconnected from a peer, we try again. self . data . discovered . add_peer ( peer_id , SlotType :: Common ) ; self . alloc_slots ( ) ; }
Indicate that we dropped an active connection with a peer, or that we failed to connect.
Indicate that we dropped an active connection with a peer or that we failed to connect .
&mut self
peer_id
PeerId
&mut self
peer_id
PeerId