#include <circuit_service.h>
Public Member Functions | |
| virtual | ~CircuitService ()=default |
| virtual std::optional< PeerRoute > | adopt_circuit (const PeerId &carrier, std::unique_ptr< Link > link, ConnRole role, bool connected)=0 |
Adopt link as a connection carried by the peer carrier, on the reactor that owns the carrier's own connection. | |
| virtual void | wake_circuit (PeerRoute route, uint32_t events)=0 |
| Deliver poll-equivalent events (PollIn / PollOut / PollErr, see core/io_poller.h) to a circuit connection — the events a socket-backed link would have got from the poller. | |
| virtual void | close_circuit (PeerRoute route, CloseReason reason)=0 |
| Tear a circuit connection down. | |
Definition at line 52 of file circuit_service.h.
|
virtualdefault |
|
pure virtual |
Adopt link as a connection carried by the peer carrier, on the reactor that owns the carrier's own connection.
| role | Outbound for a circuit we opened, Inbound for one opened to us. It is what the secure handshake and the peer table's duplicate resolution read, so it must say who asked. |
| connected | whether the far end is already there. An inbound circuit is (the opener would not have sent it otherwise); an outbound one is not until its acceptance arrives, and until then the connection waits in Connecting for a PollOut. |
link is released. Implemented in librats::Node.
|
pure virtual |
Tear a circuit connection down.
Thread-safe; a no-op for a route that is already gone.
Implemented in librats::Node.
|
pure virtual |
Deliver poll-equivalent events (PollIn / PollOut / PollErr, see core/io_poller.h) to a circuit connection — the events a socket-backed link would have got from the poller.
Thread-safe, and a no-op for a route that is already gone.
Implemented in librats::Node.