Function zebra_network::peer_set::initialize::dial

source ยท
async fn dial<C>(
    candidate: MetaAddr,
    outbound_connector: C,
    outbound_connection_tracker: ConnectionTracker,
    outbound_connections: usize,
    peerset_tx: Sender<(PeerSocketAddr, Client)>,
    address_book_updater: Sender<MetaAddrChange>,
    demand_tx: Sender<MorePeers>,
) -> Result<(), BoxError>
where C: Service<OutboundConnectorRequest, Response = (PeerSocketAddr, Client), Error = BoxError> + Clone + Send + 'static, C::Future: Send + 'static,
Expand description

Try to connect to candidate using outbound_connector. Uses outbound_connection_tracker to track the active connection count.

On success, sends peers to peerset_tx. On failure, marks the peer as failed in the address book, then re-adds demand to demand_tx.