Add event called after we have connected up our paired socket, we are guaranteed to get monitor events after this point.

This is useful if you are spawning the monitor to a different thread and need to wait until monitor has started before opening the socket.
This commit is contained in:
Richard Newton 2013-06-28 18:31:00 +01:00
parent 938e4ab07b
commit 37d5ecd7e2

View File

@ -448,6 +448,9 @@ namespace zmq
rc = zmq_connect (s, addr_);
assert (rc == 0);
on_monitor_started();
while (true) {
zmq_msg_t eventMsg;
zmq_msg_init (&eventMsg);
@ -511,6 +514,7 @@ namespace zmq
zmq_close (s);
}
virtual void on_monitor_started() {}
virtual void on_event_connected(const zmq_event_t &event_, const char* addr_) {}
virtual void on_event_connect_delayed(const zmq_event_t &event_, const char* addr_) {}
virtual void on_event_connect_retried(const zmq_event_t &event_, const char* addr_) {}