From f805e4dd03d012e644b4153866c70e99490b0349 Mon Sep 17 00:00:00 2001 From: shripchenko Date: Fri, 24 May 2013 07:09:53 -0700 Subject: [PATCH] changed option name. +documentation changes --- doc/zmq_setsockopt.txt | 10 ++++++---- include/zmq.h | 2 +- src/dealer.cpp | 2 +- src/router.cpp | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/doc/zmq_setsockopt.txt b/doc/zmq_setsockopt.txt index 7f8fdc93..6fa0cc75 100644 --- a/doc/zmq_setsockopt.txt +++ b/doc/zmq_setsockopt.txt @@ -421,19 +421,21 @@ Default value:: 0 Applicable socket types:: ZMQ_ROUTER -ZMQ_PROBE_NEW_PEERS: automatically send empty packet to every established connection +ZMQ_PROBE: automatically send empty packet to every established connection ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Sets the 'ROUTER' & 'DEALER' sockets behavior to automatically send an empty packet +Sets the compatible sockets behavior to automatically send an empty packet to any new connection made (or accepted) by socket. It could help sockets to -auto discovery themself. It especially important in 'ROUTER' <-> 'ROUTER' connections +auto discovery them-self. It especially important in 'ROUTER' <-> 'ROUTER' connections where it solves 'who will write first' problems. +NOTE: Don't set this options for sockets working with ZMQ_REP, ZMQ_REQ sockets. +It will interfere with their strict synchronous logic and framing. [horizontal] Option value type:: int Option value unit:: 0, 1 Default value:: 0 -Applicable socket types:: ZMQ_ROUTER, ZMQ_DEALER +Applicable socket types:: ZMQ_ROUTER, ZMQ_DEALER, ZMQ_REP, ZMQ_REQ ZMQ_XPUB_VERBOSE: provide all subscription messages on XPUB sockets diff --git a/include/zmq.h b/include/zmq.h index dcd81de6..6f499c2c 100644 --- a/include/zmq.h +++ b/include/zmq.h @@ -274,7 +274,7 @@ ZMQ_EXPORT int zmq_msg_set (zmq_msg_t *msg, int option, int optval); #define ZMQ_CURVE_SERVER 47 #define ZMQ_CURVE_PUBLICKEY 48 #define ZMQ_CURVE_SERVERKEY 49 -#define ZMQ_PROBE_NEW_PEERS 50 +#define ZMQ_PROBE 50 /* Message options */ #define ZMQ_MORE 1 diff --git a/src/dealer.cpp b/src/dealer.cpp index 8d86cc54..33b0eb68 100644 --- a/src/dealer.cpp +++ b/src/dealer.cpp @@ -65,7 +65,7 @@ int zmq::dealer_t::xsetsockopt (int option_, const void *optval_, int value = is_int? *((int *) optval_): 0; switch (option_) { - case ZMQ_PROBE_NEW_PEERS: + case ZMQ_PROBE: if (is_int && value >= 0) { probe_new_peers = value; return 0; diff --git a/src/router.cpp b/src/router.cpp index 654e4516..f49e6b4b 100644 --- a/src/router.cpp +++ b/src/router.cpp @@ -95,7 +95,7 @@ int zmq::router_t::xsetsockopt (int option_, const void *optval_, printf ("E: invalid option value (int=%d value=%d)\n", is_int, value); break; - case ZMQ_PROBE_NEW_PEERS: + case ZMQ_PROBE: if (is_int && value >= 0) { probe_new_peers = value; return 0;