Commit 518b939f authored by KIU Shueng Chuan's avatar KIU Shueng Chuan

make ZMQ_STREAM_NOTIFY also control disconnect notificatons

parent ec5592db
...@@ -716,11 +716,11 @@ Default value:: -1 (infinite) ...@@ -716,11 +716,11 @@ Default value:: -1 (infinite)
Applicable socket types:: all Applicable socket types:: all
ZMQ_STREAM_NOTIFY: send connect notifications ZMQ_STREAM_NOTIFY: send connect and disconnect notifications
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enables connect notifications on a STREAM socket, when set to 1. By default a Enables connect and disconnect notifications on a STREAM socket, when set
STREAM socket does not notify new connections. When notifications are enabled, to 1. When notifications are enabled, the socket delivers a zero-length
it delivers a zero-length message to signal new client connections. message when a peer connects or disconnects.
[horizontal] [horizontal]
Option value type:: int Option value type:: int
......
...@@ -965,7 +965,7 @@ int zmq::stream_engine_t::write_subscription_msg (msg_t *msg_) ...@@ -965,7 +965,7 @@ int zmq::stream_engine_t::write_subscription_msg (msg_t *msg_)
void zmq::stream_engine_t::error (error_reason_t reason) void zmq::stream_engine_t::error (error_reason_t reason)
{ {
if (options.raw_socket) { if (options.raw_socket && options.raw_notify) {
// For raw sockets, send a final 0-length message to the application // For raw sockets, send a final 0-length message to the application
// so that it knows the peer has been disconnected. // so that it knows the peer has been disconnected.
msg_t terminator; msg_t terminator;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment