Crate lightning_net_tokiosource ·
A socket handling library for those running in Tokio environments who wish to use
rust-lightning with native
Designed to be as simple as possible, the high-level usage is almost as simple as “hand over a
TcpStream and a reference to a
PeerManager and the rest is handled”.
PeerManager, due to the fire-and-forget nature of this logic, must be a reference,
Arc) and must use the
SocketDescriptor provided here as the
Three methods are exposed to register a new connection for handling in
see their individual docs for details.
- The SocketDescriptor used to refer to sockets by a PeerHandler. This is pub only as it is a type in the template of PeerHandler.
- 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).
- Process incoming messages and feed outgoing messages on the provided socket generated by accepting an incoming connection.
- 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).