Function lightning_net_tokio::setup_outbound [−][src]
pub fn setup_outbound<CMH, RMH, L: ?Sized>(
peer_manager: Arc<PeerManager<SocketDescriptor, Arc<CMH>, Arc<RMH>, Arc<L>>>,
their_node_id: PublicKey,
stream: StdTcpStream
) -> impl Future<Output = ()> where
CMH: ChannelMessageHandler + 'static + Send + Sync,
RMH: RoutingMessageHandler + 'static + Send + Sync,
L: Logger + 'static + Send + Sync,
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.