mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-09 15:26:04 +00:00
Add new socket monitor event for when socket monitoring is stopped.
This commit is contained in:
parent
1cfee8d1e7
commit
d4d23caf32
@ -314,12 +314,14 @@ ZMQ_EXPORT int zmq_msg_set (zmq_msg_t *msg, int option, int optval);
|
|||||||
#define ZMQ_EVENT_CLOSED 128
|
#define ZMQ_EVENT_CLOSED 128
|
||||||
#define ZMQ_EVENT_CLOSE_FAILED 256
|
#define ZMQ_EVENT_CLOSE_FAILED 256
|
||||||
#define ZMQ_EVENT_DISCONNECTED 512
|
#define ZMQ_EVENT_DISCONNECTED 512
|
||||||
|
#define ZMQ_EVENT_MONITOR_STOPPED 1024
|
||||||
|
|
||||||
#define ZMQ_EVENT_ALL ( ZMQ_EVENT_CONNECTED | ZMQ_EVENT_CONNECT_DELAYED | \
|
#define ZMQ_EVENT_ALL ( ZMQ_EVENT_CONNECTED | ZMQ_EVENT_CONNECT_DELAYED | \
|
||||||
ZMQ_EVENT_CONNECT_RETRIED | ZMQ_EVENT_LISTENING | \
|
ZMQ_EVENT_CONNECT_RETRIED | ZMQ_EVENT_LISTENING | \
|
||||||
ZMQ_EVENT_BIND_FAILED | ZMQ_EVENT_ACCEPTED | \
|
ZMQ_EVENT_BIND_FAILED | ZMQ_EVENT_ACCEPTED | \
|
||||||
ZMQ_EVENT_ACCEPT_FAILED | ZMQ_EVENT_CLOSED | \
|
ZMQ_EVENT_ACCEPT_FAILED | ZMQ_EVENT_CLOSED | \
|
||||||
ZMQ_EVENT_CLOSE_FAILED | ZMQ_EVENT_DISCONNECTED )
|
ZMQ_EVENT_CLOSE_FAILED | ZMQ_EVENT_DISCONNECTED | \
|
||||||
|
ZMQ_EVENT_MONITOR_STOPPED)
|
||||||
|
|
||||||
/* Socket event data */
|
/* Socket event data */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -1221,6 +1221,12 @@ void zmq::socket_base_t::monitor_event (zmq_event_t event_, const std::string& a
|
|||||||
void zmq::socket_base_t::stop_monitor()
|
void zmq::socket_base_t::stop_monitor()
|
||||||
{
|
{
|
||||||
if (monitor_socket) {
|
if (monitor_socket) {
|
||||||
|
if (monitor_events & ZMQ_EVENT_MONITOR_STOPPED) {
|
||||||
|
zmq_event_t event;
|
||||||
|
event.event = ZMQ_EVENT_MONITOR_STOPPED;
|
||||||
|
event.value = 0;
|
||||||
|
monitor_event (event, "");
|
||||||
|
}
|
||||||
zmq_close (monitor_socket);
|
zmq_close (monitor_socket);
|
||||||
monitor_socket = NULL;
|
monitor_socket = NULL;
|
||||||
monitor_events = 0;
|
monitor_events = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user