Function lightning_net_tokio::setup_outbound
source · pub fn setup_outbound<PM: Deref + 'static + Send + Sync + Clone>(
peer_manager: PM,
their_node_id: PublicKey,
stream: TcpStream
) -> impl Future<Output = ()>
Expand description
Process incoming messages and feed outgoing messages on the provided socket generated by making an outbound connection which is expected to be accepted by a peer with the given public key. The relevant processing is set to run free (via tokio::spawn).
The returned future will complete when the peer is disconnected and associated handling futures are freed, though, because all processing futures are spawned with tokio::spawn, you do not need to poll the provided future in order to make progress.