mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-09 23:36:04 +00:00
Renamed ZMQ_DELAY_ATTACH_ON_CONNECT_COULD_THIS_BE_ANY_LONGER to ZMQ_IMMEDIATE
This commit is contained in:
parent
12c7db8c42
commit
8358d4e832
@ -360,7 +360,7 @@ Applicable socket types:: all, when using TCP transports.
|
|||||||
ZMQ_IPV4ONLY: Use IPv4-only on socket
|
ZMQ_IPV4ONLY: Use IPv4-only on socket
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Set the IPv4-only ootion for the socket. This option is deprecated.
|
Set the IPv4-only option for the socket. This option is deprecated.
|
||||||
Please use the ZMQ_IPV6 option.
|
Please use the ZMQ_IPV6 option.
|
||||||
|
|
||||||
[horizontal]
|
[horizontal]
|
||||||
@ -370,12 +370,15 @@ Default value:: 1 (true)
|
|||||||
Applicable socket types:: all, when using TCP transports.
|
Applicable socket types:: all, when using TCP transports.
|
||||||
|
|
||||||
|
|
||||||
ZMQ_DELAY_ATTACH_ON_CONNECT: Accept messages only when connections are made
|
ZMQ_IMMEDIATE: Queue messages only to completed connections
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
If set to `1`, will delay the attachment of a pipe on connect until the underlying
|
By default queues will fill on outgoing connections even if the connection has
|
||||||
connection has completed. This will cause the socket to block if there are no other
|
not completed. This can lead to "lost" messages on sockets with round-robin
|
||||||
connections, but will prevent queues from filling on pipes awaiting connection.
|
routing (REQ, PUSH, DEALER). If this option is set to `1`, messages shall be
|
||||||
|
queued only to completed connections. This will cause the socket to block if
|
||||||
|
there are no other connections, but will prevent queues from filling on pipes
|
||||||
|
awaiting connection.
|
||||||
|
|
||||||
[horizontal]
|
[horizontal]
|
||||||
Option value type:: int
|
Option value type:: int
|
||||||
|
@ -249,12 +249,11 @@ ZMQ_EXPORT int zmq_msg_set (zmq_msg_t *msg, int option, int optval);
|
|||||||
#define ZMQ_TCP_KEEPALIVE_IDLE 36
|
#define ZMQ_TCP_KEEPALIVE_IDLE 36
|
||||||
#define ZMQ_TCP_KEEPALIVE_INTVL 37
|
#define ZMQ_TCP_KEEPALIVE_INTVL 37
|
||||||
#define ZMQ_TCP_ACCEPT_FILTER 38
|
#define ZMQ_TCP_ACCEPT_FILTER 38
|
||||||
#define ZMQ_DELAY_ATTACH_ON_CONNECT 39
|
#define ZMQ_IMMEDIATE 39
|
||||||
#define ZMQ_XPUB_VERBOSE 40
|
#define ZMQ_XPUB_VERBOSE 40
|
||||||
#define ZMQ_ROUTER_RAW 41
|
#define ZMQ_ROUTER_RAW 41
|
||||||
#define ZMQ_IPV6 42
|
#define ZMQ_IPV6 42
|
||||||
|
|
||||||
|
|
||||||
/* Message options */
|
/* Message options */
|
||||||
#define ZMQ_MORE 1
|
#define ZMQ_MORE 1
|
||||||
|
|
||||||
@ -263,6 +262,7 @@ ZMQ_EXPORT int zmq_msg_set (zmq_msg_t *msg, int option, int optval);
|
|||||||
#define ZMQ_SNDMORE 2
|
#define ZMQ_SNDMORE 2
|
||||||
|
|
||||||
/* Deprecated aliases */
|
/* Deprecated aliases */
|
||||||
|
#define ZMQ_DELAY_ATTACH_ON_CONNECT ZMQ_IMMEDIATE
|
||||||
#define ZMQ_NOBLOCK ZMQ_DONTWAIT
|
#define ZMQ_NOBLOCK ZMQ_DONTWAIT
|
||||||
#define ZMQ_FAIL_UNROUTABLE ZMQ_ROUTER_MANDATORY
|
#define ZMQ_FAIL_UNROUTABLE ZMQ_ROUTER_MANDATORY
|
||||||
#define ZMQ_ROUTER_BEHAVIOR ZMQ_ROUTER_MANDATORY
|
#define ZMQ_ROUTER_BEHAVIOR ZMQ_ROUTER_MANDATORY
|
||||||
|
@ -41,7 +41,7 @@ zmq::options_t::options_t () :
|
|||||||
rcvtimeo (-1),
|
rcvtimeo (-1),
|
||||||
sndtimeo (-1),
|
sndtimeo (-1),
|
||||||
ipv6 (0),
|
ipv6 (0),
|
||||||
delay_attach_on_connect (0),
|
immediate (0),
|
||||||
delay_on_close (true),
|
delay_on_close (true),
|
||||||
delay_on_disconnect (true),
|
delay_on_disconnect (true),
|
||||||
filter (false),
|
filter (false),
|
||||||
@ -224,9 +224,9 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
|
|||||||
valid = false;
|
valid = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ZMQ_DELAY_ATTACH_ON_CONNECT:
|
case ZMQ_IMMEDIATE:
|
||||||
if (is_int && (value == 0 || value == 1))
|
if (is_int && (value == 0 || value == 1))
|
||||||
delay_attach_on_connect = value;
|
immediate = value;
|
||||||
else
|
else
|
||||||
valid = false;
|
valid = false;
|
||||||
break;
|
break;
|
||||||
@ -435,12 +435,12 @@ int zmq::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_)
|
|||||||
*optvallen_ = sizeof (int);
|
*optvallen_ = sizeof (int);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case ZMQ_DELAY_ATTACH_ON_CONNECT:
|
case ZMQ_IMMEDIATE:
|
||||||
if (*optvallen_ < sizeof (int)) {
|
if (*optvallen_ < sizeof (int)) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
*((int*) optval_) = delay_attach_on_connect;
|
*((int*) optval_) = immediate;
|
||||||
*optvallen_ = sizeof (int);
|
*optvallen_ = sizeof (int);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ namespace zmq
|
|||||||
|
|
||||||
// If 1, connecting pipes are not attached immediately, meaning a send()
|
// If 1, connecting pipes are not attached immediately, meaning a send()
|
||||||
// on a socket with only connecting pipes would block
|
// on a socket with only connecting pipes would block
|
||||||
int delay_attach_on_connect;
|
int immediate;
|
||||||
|
|
||||||
// If true, session reads all the pending messages from the pipe and
|
// If true, session reads all the pending messages from the pipe and
|
||||||
// sends them to the network when socket is closed.
|
// sends them to the network when socket is closed.
|
||||||
|
@ -409,7 +409,7 @@ void zmq::session_base_t::detached ()
|
|||||||
|
|
||||||
// For delayed connect situations, terminate the pipe
|
// For delayed connect situations, terminate the pipe
|
||||||
// and reestablish later on
|
// and reestablish later on
|
||||||
if (pipe && options.delay_attach_on_connect == 1
|
if (pipe && options.immediate == 1
|
||||||
&& addr->protocol != "pgm" && addr->protocol != "epgm") {
|
&& addr->protocol != "pgm" && addr->protocol != "epgm") {
|
||||||
pipe->hiccup ();
|
pipe->hiccup ();
|
||||||
pipe->terminate (false);
|
pipe->terminate (false);
|
||||||
|
@ -535,7 +535,7 @@ int zmq::socket_base_t::connect (const char *addr_)
|
|||||||
// sent to this pipe.
|
// sent to this pipe.
|
||||||
bool icanhasall = protocol == "pgm" || protocol == "epgm";
|
bool icanhasall = protocol == "pgm" || protocol == "epgm";
|
||||||
|
|
||||||
if (options.delay_attach_on_connect != 1 || icanhasall) {
|
if (options.immediate != 1 || icanhasall) {
|
||||||
// Create a bi-directional pipe.
|
// Create a bi-directional pipe.
|
||||||
object_t *parents [2] = {this, session};
|
object_t *parents [2] = {this, session};
|
||||||
pipe_t *new_pipes [2] = {NULL, NULL};
|
pipe_t *new_pipes [2] = {NULL, NULL};
|
||||||
@ -996,7 +996,7 @@ void zmq::socket_base_t::write_activated (pipe_t *pipe_)
|
|||||||
|
|
||||||
void zmq::socket_base_t::hiccuped (pipe_t *pipe_)
|
void zmq::socket_base_t::hiccuped (pipe_t *pipe_)
|
||||||
{
|
{
|
||||||
if (options.delay_attach_on_connect == 1)
|
if (options.immediate == 1)
|
||||||
pipe_->terminate (false);
|
pipe_->terminate (false);
|
||||||
else
|
else
|
||||||
// Notify derived sockets of the hiccup
|
// Notify derived sockets of the hiccup
|
||||||
|
Loading…
x
Reference in New Issue
Block a user