#include <ZeroMQMonitor.hpp>
Public Member Functions | |
ZeroMQMonitor ()=default | |
Constructor. | |
ZeroMQMonitor (const ZeroMQMonitor &)=delete | |
Copy constructor. | |
ZeroMQMonitor (ZeroMQMonitor &&)=delete | |
Move constructor. | |
ZeroMQMonitor & | operator= (ZeroMQMonitor)=delete |
Copy assignment operator. | |
ZeroMQMonitor & | operator= (ZeroMQMonitor &&)=delete |
Move assignment operator. | |
void | startMonitoring (zmq::socket_t *socket, const std::string &monitorAddress) |
void | stopMonitoring () |
~ZeroMQMonitor () override | |
Private Member Functions | |
void | threadFunc () |
void | on_monitor_started () override |
void | on_event_connected (const zmq_event_t &, const char *addr_) override |
void | on_event_connect_delayed (const zmq_event_t &, const char *addr_) override |
void | on_event_connect_retried (const zmq_event_t &, const char *addr_) override |
void | on_event_listening (const zmq_event_t &, const char *addr_) override |
void | on_event_bind_failed (const zmq_event_t &, const char *addr_) override |
void | on_event_accepted (const zmq_event_t &, const char *addr_) override |
void | on_event_accept_failed (const zmq_event_t &, const char *addr_) override |
void | on_event_closed (const zmq_event_t &, const char *addr_) override |
void | on_event_close_failed (const zmq_event_t &, const char *addr_) override |
void | on_event_disconnected (const zmq_event_t &, const char *addr_) override |
void | on_event_handshake_failed_no_detail (const zmq_event_t &, const char *addr_) override |
void | on_event_handshake_failed_protocol (const zmq_event_t &, const char *addr_) override |
void | on_event_handshake_failed_auth (const zmq_event_t &, const char *addr_) override |
void | on_event_handshake_succeeded (const zmq_event_t &, const char *addr_) override |
void | on_event_unknown (const zmq_event_t &, const char *addr_) override |
Static Private Member Functions | |
static void | on_event (const std::string &messageStr, int level, const char *addr=nullptr) |
Private Attributes | |
std::unique_ptr< std::thread > | _monitorThread |
std::atomic_flag | _shouldStop {false} |
Class for monitoring ZeroMQ events on a socket.
The ZeroMQMonitor class provides functionality to monitor ZeroMQ events on a socket. It starts a separate thread to listen for events and invokes corresponding event handlers. The class supports various event types such as connection, binding, acceptance, closure, etc.
Definition at line 17 of file ZeroMQMonitor.hpp.
|
default |
Constructor.
|
delete |
Copy constructor.
|
delete |
Move constructor.
|
inlineoverride |
Destructor.
Definition at line 101 of file ZeroMQMonitor.hpp.
|
staticprivate |
Definition at line 15 of file ZeroMQMonitor.cpp.
|
overrideprivate |
Definition at line 75 of file ZeroMQMonitor.cpp.
|
overrideprivate |
|
overrideprivate |
|
overrideprivate |
|
overrideprivate |
|
overrideprivate |
|
overrideprivate |
|
overrideprivate |
|
overrideprivate |
|
overrideprivate |
|
overrideprivate |
|
overrideprivate |
|
overrideprivate |
|
overrideprivate |
|
overrideprivate |
|
overrideprivate |
|
delete |
Move assignment operator.
|
delete |
Copy assignment operator.
void ZeroMQMonitor::startMonitoring | ( | zmq::socket_t * | socket, |
const std::string & | monitorAddress ) |
Start monitoring events on the given socket.
This method starts a separate thread to listen for events on the given socket. The method also sets up the event handlers for various event types.
[in] | socket | Zeromq socket |
[in] | monitorAddress | Monitoring address |
Definition at line 134 of file ZeroMQMonitor.cpp.
void ZeroMQMonitor::stopMonitoring | ( | ) |
Stop monitoring events on the socket.
Definition at line 145 of file ZeroMQMonitor.cpp.
|
private |
Definition at line 7 of file ZeroMQMonitor.cpp.
|
private |
Thread for monitoring events.
Definition at line 19 of file ZeroMQMonitor.hpp.
|
private |