85 std::optional<std::chrono::steady_clock::time_point>
changed_at;
128 void start(zmq::socket_t &socket,
int events = ZMQ_EVENT_ALL);
143 void attach(zmq::socket_t &socket,
int events = ZMQ_EVENT_ALL);
225 std::unique_ptr<Impl> _impl;
One monitor per monitored socket. start() must be called before the socket's connect()/bind(): libzmq...
void attach(zmq::socket_t &socket, int events=ZMQ_EVENT_ALL)
Attaches to socket without starting any thread, leaving the caller to drive the monitor: include poll...
void stop()
Stops the monitoring thread (if start() created one) and detaches from the socket (zmq_socket_monitor...
void process_pending()
Consumes the events pollable() has signalled, updating last_event()/state() and waking the wait_*() c...
std::string last_event_address() const
void start(zmq::socket_t &socket, int events=ZMQ_EVENT_ALL)
Starts monitoring socket on a private inproc:// endpoint and a dedicated thread. A second call before...
SocketMonitor & operator=(const SocketMonitor &)=delete
SocketMonitor(const SocketMonitor &)=delete
LinkState state() const
A consistent snapshot of the link's current status, the event that produced it, and how often it has ...
bool wait_connected(std::chrono::milliseconds timeout)
Blocks until a Connected or HandshakeSucceeded event is observed, or timeout elapses....
zmq::socket_ref pollable() const
The monitor's own PAIR socket, for inclusion in the caller's zmq::poll(). Its handle() is null until ...
LinkEvent last_event() const
The most recent event observed (None if none yet).
bool wait_handshake_succeeded(std::chrono::milliseconds timeout)
Blocks until a ZMTP handshake completes one way or the other, or timeout elapses. Unlike wait_connect...
@ HandshakeFailedNoDetail
@ HandshakeFailedProtocol
@ Down
the peer went away, or the handshake was refused
@ Up
the ZMTP handshake completed and has not been undone since
std::optional< std::chrono::steady_clock::time_point > changed_at
std::string last_event_address
The peer address libzmq reported with that event ("" if none yet).
LinkEvent last_event
The most recent event, whatever it was.