Back to Site
Loading...
Searching...
No Matches
peer.h File Reference

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>
Include dependency graph for peer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  librats::Peer
 

Namespaces

namespace  librats
 

Detailed Description

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.