[][src]Struct lightning_net_tokio::Connection

pub struct Connection { /* fields omitted */ }

A connection to a remote peer. Can be constructed either as a remote connection using Connection::setup_outbound o

Methods

impl Connection[src]

pub fn setup_inbound(
    peer_manager: Arc<PeerManager<SocketDescriptor>>,
    event_notify: Sender<()>,
    stream: TcpStream
)
[src]

Process incoming messages and feed outgoing messages on the provided socket generated by accepting an incoming connection (by scheduling futures with tokio::spawn).

You should poll the Receive end of event_notify and call get_and_clear_pending_events() on ChannelManager and ChannelMonitor objects.

pub fn setup_outbound(
    peer_manager: Arc<PeerManager<SocketDescriptor>>,
    event_notify: Sender<()>,
    their_node_id: PublicKey,
    stream: TcpStream
)
[src]

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 (by scheduling futures with tokio::spawn).

You should poll the Receive end of event_notify and call get_and_clear_pending_events() on ChannelManager and ChannelMonitor objects.

pub fn connect_outbound(
    peer_manager: Arc<PeerManager<SocketDescriptor>>,
    event_notify: Sender<()>,
    their_node_id: PublicKey,
    addr: SocketAddr
)
[src]

Process incoming messages and feed outgoing messages on a new connection made to the given socket address which is expected to be accepted by a peer with the given public key (by scheduling futures with tokio::spawn).

You should poll the Receive end of event_notify and call get_and_clear_pending_events() on ChannelManager and ChannelMonitor objects.

Auto Trait Implementations

impl Send for Connection

impl Sync for Connection

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T