ZIO
Python and C++ interface to ZeroMQ and Zyre
|
Peer at the network to discover peers and advertise self. More...
#include <peer.hpp>
Public Types | |
typedef int | timeout_t |
A timeout in milliseconds. More... | |
Public Member Functions | |
~Peer () | |
Peer (const nickname_t &nickname, const headerset_t &headers={}, bool verbose=false) | |
Advertise own nickname and headers. More... | |
void | set_verbose (bool verbose=true) |
Turn on verbose debugging of the underlying Zyre actor. More... | |
const nickname_t | nickname () |
Get our nickname. More... | |
bool | poll (timeout_t timeout=0) |
Poll the network for updates, timeout in msec. More... | |
void | drain () |
Continually poll until all queued zyre messages are processed. More... | |
std::vector< uuid_t > | waitfor (const nickname_t &nickname, timeout_t timeout=-1) |
Wait for a peer of a given nickname to be discovered. More... | |
void | waituntil (const uuid_t &uuid, timeout_t timeout=-1) |
Wait until a specific peer has left the network. More... | |
const peerset_t & | peers () |
Return known peers as map from UUID to nickname. More... | |
peer_info_t | peer_info (const uuid_t &uuid) |
Return info about peer. If unknown, return default structure. More... | |
bool | isknown (const uuid_t &uuid) |
Return true if peer has been seen ENTER the network and not yet seen to EXIT. More... | |
std::vector< uuid_t > | nickmatch (const nickname_t &nick) |
Return all UUIDs with matching nickname. More... | |
Peer at the network to discover peers and advertise self.
This is a C++ interface to ZeroMQ's Zyre which adds some memory of peers seen and ways to iterate on their Zyre headers.
typedef int zio::Peer::timeout_t |
zio::Peer::Peer | ( | const nickname_t & | nickname, |
const headerset_t & | headers = {} , |
||
bool | verbose = false |
||
) |
void zio::Peer::drain | ( | ) |
bool zio::Peer::isknown | ( | const uuid_t & | uuid | ) |
std::vector< zio::uuid_t > zio::Peer::nickmatch | ( | const nickname_t & | nick | ) |
|
inline |
zio::peer_info_t zio::Peer::peer_info | ( | const uuid_t & | uuid | ) |
const zio::peerset_t & zio::Peer::peers | ( | ) |
bool zio::Peer::poll | ( | timeout_t | timeout = 0 | ) |
void zio::Peer::set_verbose | ( | bool | verbose = true | ) |
std::vector< zio::uuid_t > zio::Peer::waitfor | ( | const nickname_t & | nickname, |
timeout_t | timeout = -1 |
||
) |
Wait until a specific peer has left the network.
If it is already gone, return immediately or in any case no longer than the timeout.