A lightweight handle to a connected peer. More...
#include "librats/util/rats_export.h"#include "librats/core/bytes.h"#include "librats/peer/peer_id.h"#include "librats/peer/peer_info.h"#include "librats/peer/peer_table.h"#include <optional>#include <string_view>Go to the source code of this file.
Classes | |
| class | librats::Peer |
Namespaces | |
| namespace | librats |
A lightweight handle to a connected peer.
Peer is a value passed to callbacks. It carries the peer's id and its route (which reactor + connection). disconnect() uses the route, reaching that exact connection with no directory lookup. send() goes by id instead: it has to consult the directory anyway for the backpressure answer it returns, and by then the peer's current route is the better destination — a handle can outlive the link it names. info() consults the directory on demand too.
Definition in file peer.h.