async fn accept_inbound_connections<S>(
config: Config,
listener: TcpListener,
min_inbound_peer_connection_interval: Duration,
handshaker: S,
peerset_tx: Sender<(PeerSocketAddr, Client)>,
) -> Result<(), BoxError>where
S: Service<HandshakeRequest<TcpStream>, Response = Client, Error = BoxError> + Clone,
S::Future: Send + 'static,
Expand description
Listens for peer connections on addr
, then sets up each connection as a
Zcash peer.
Uses handshaker
to perform a Zcash network protocol handshake, and sends
the peer::Client
result over peerset_tx
.
Limits the number of active inbound connections based on config
,
and waits min_inbound_peer_connection_interval
between connections.