Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
8358d4e8
Commit
8358d4e8
authored
Mar 12, 2013
by
Pieter Hintjens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed ZMQ_DELAY_ATTACH_ON_CONNECT_COULD_THIS_BE_ANY_LONGER to ZMQ_IMMEDIATE
parent
12c7db8c
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
20 deletions
+23
-20
zmq_setsockopt.txt
doc/zmq_setsockopt.txt
+9
-6
zmq.h
include/zmq.h
+5
-5
options.cpp
src/options.cpp
+5
-5
options.hpp
src/options.hpp
+1
-1
session_base.cpp
src/session_base.cpp
+1
-1
socket_base.cpp
src/socket_base.cpp
+2
-2
No files found.
doc/zmq_setsockopt.txt
View file @
8358d4e8
...
...
@@ -360,7 +360,7 @@ Applicable socket types:: all, when using TCP transports.
ZMQ_IPV4ONLY: Use IPv4-only on socket
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Set the IPv4-only o
o
tion for the socket. This option is deprecated.
Set the IPv4-only o
p
tion for the socket. This option is deprecated.
Please use the ZMQ_IPV6 option.
[horizontal]
...
...
@@ -370,12 +370,15 @@ Default value:: 1 (true)
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
connection has completed. This will cause the socket to block if there are no other
connections, but will prevent queues from filling on pipes awaiting connection.
By default queues will fill on outgoing connections even if the connection has
not completed. This can lead to "lost" messages on sockets with round-robin
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]
Option value type:: int
...
...
include/zmq.h
View file @
8358d4e8
...
...
@@ -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_INTVL 37
#define ZMQ_TCP_ACCEPT_FILTER 38
#define ZMQ_
DELAY_ATTACH_ON_CONNECT
39
#define ZMQ_
IMMEDIATE
39
#define ZMQ_XPUB_VERBOSE 40
#define ZMQ_ROUTER_RAW 41
#define ZMQ_IPV6 42
/* Message options */
#define ZMQ_MORE 1
...
...
@@ -263,9 +262,10 @@ ZMQ_EXPORT int zmq_msg_set (zmq_msg_t *msg, int option, int optval);
#define ZMQ_SNDMORE 2
/* Deprecated aliases */
#define ZMQ_NOBLOCK ZMQ_DONTWAIT
#define ZMQ_FAIL_UNROUTABLE ZMQ_ROUTER_MANDATORY
#define ZMQ_ROUTER_BEHAVIOR ZMQ_ROUTER_MANDATORY
#define ZMQ_DELAY_ATTACH_ON_CONNECT ZMQ_IMMEDIATE
#define ZMQ_NOBLOCK ZMQ_DONTWAIT
#define ZMQ_FAIL_UNROUTABLE ZMQ_ROUTER_MANDATORY
#define ZMQ_ROUTER_BEHAVIOR ZMQ_ROUTER_MANDATORY
/******************************************************************************/
/* 0MQ socket events and monitoring */
...
...
src/options.cpp
View file @
8358d4e8
...
...
@@ -41,7 +41,7 @@ zmq::options_t::options_t () :
rcvtimeo
(
-
1
),
sndtimeo
(
-
1
),
ipv6
(
0
),
delay_attach_on_connect
(
0
),
immediate
(
0
),
delay_on_close
(
true
),
delay_on_disconnect
(
true
),
filter
(
false
),
...
...
@@ -224,9 +224,9 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
valid
=
false
;
break
;
case
ZMQ_
DELAY_ATTACH_ON_CONNECT
:
case
ZMQ_
IMMEDIATE
:
if
(
is_int
&&
(
value
==
0
||
value
==
1
))
delay_attach_on_connect
=
value
;
immediate
=
value
;
else
valid
=
false
;
break
;
...
...
@@ -435,12 +435,12 @@ int zmq::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_)
*
optvallen_
=
sizeof
(
int
);
return
0
;
case
ZMQ_
DELAY_ATTACH_ON_CONNECT
:
case
ZMQ_
IMMEDIATE
:
if
(
*
optvallen_
<
sizeof
(
int
))
{
errno
=
EINVAL
;
return
-
1
;
}
*
((
int
*
)
optval_
)
=
delay_attach_on_connect
;
*
((
int
*
)
optval_
)
=
immediate
;
*
optvallen_
=
sizeof
(
int
);
return
0
;
...
...
src/options.hpp
View file @
8358d4e8
...
...
@@ -93,7 +93,7 @@ namespace zmq
// If 1, connecting pipes are not attached immediately, meaning a send()
// 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
// sends them to the network when socket is closed.
...
...
src/session_base.cpp
View file @
8358d4e8
...
...
@@ -409,7 +409,7 @@ void zmq::session_base_t::detached ()
// For delayed connect situations, terminate the pipe
// and reestablish later on
if
(
pipe
&&
options
.
delay_attach_on_connect
==
1
if
(
pipe
&&
options
.
immediate
==
1
&&
addr
->
protocol
!=
"pgm"
&&
addr
->
protocol
!=
"epgm"
)
{
pipe
->
hiccup
();
pipe
->
terminate
(
false
);
...
...
src/socket_base.cpp
View file @
8358d4e8
...
...
@@ -535,7 +535,7 @@ int zmq::socket_base_t::connect (const char *addr_)
// sent to this pipe.
bool
icanhasall
=
protocol
==
"pgm"
||
protocol
==
"epgm"
;
if
(
options
.
delay_attach_on_connect
!=
1
||
icanhasall
)
{
if
(
options
.
immediate
!=
1
||
icanhasall
)
{
// Create a bi-directional pipe.
object_t
*
parents
[
2
]
=
{
this
,
session
};
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_
)
{
if
(
options
.
delay_attach_on_connect
==
1
)
if
(
options
.
immediate
==
1
)
pipe_
->
terminate
(
false
);
else
// Notify derived sockets of the hiccup
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment