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
97324398
Commit
97324398
authored
May 23, 2013
by
shripchenko
Committed by
Pieter Hintjens
Jun 05, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactored ZMQ_ROUTER_ANNOUNCE_SELF code. renamed it to ZMQ_PROBE_NEW_PEERS.
implement it for DEALER tocket. +documentation
parent
d5f60369
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
11 deletions
+12
-11
zmq_setsockopt.txt
doc/zmq_setsockopt.txt
+4
-6
dealer.cpp
src/dealer.cpp
+3
-3
router.cpp
src/router.cpp
+5
-2
No files found.
doc/zmq_setsockopt.txt
View file @
97324398
...
...
@@ -421,21 +421,19 @@ Default value:: 0
Applicable socket types:: ZMQ_ROUTER
ZMQ_PROBE: automatically send empty packet to every established connection
ZMQ_PROBE
_NEW_PEERS
: automatically send empty packet to every established connection
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sets the
compatible
sockets behavior to automatically send an empty packet
Sets the
'ROUTER' & 'DEALER'
sockets behavior to automatically send an empty packet
to any new connection made (or accepted) by socket. It could help sockets to
auto discovery them
-
self. It especially important in 'ROUTER' <-> 'ROUTER' connections
auto discovery themself. 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
, ZMQ_REP, ZMQ_REQ
Applicable socket types:: ZMQ_ROUTER, ZMQ_DEALER
ZMQ_XPUB_VERBOSE: provide all subscription messages on XPUB sockets
...
...
src/dealer.cpp
View file @
97324398
...
...
@@ -40,14 +40,14 @@ void zmq::dealer_t::xattach_pipe (pipe_t *pipe_, bool icanhasall_)
zmq_assert
(
pipe_
);
if
(
probe_new_peers
)
{
int
rc
;
int
rc
,
ok
;
msg_t
probe_msg_
;
rc
=
probe_msg_
.
init
();
errno_assert
(
rc
==
0
);
rc
=
pipe_
->
write
(
&
probe_msg_
);
zmq_assert
(
rc
);
ok
=
pipe_
->
write
(
&
probe_msg_
);
zmq_assert
(
ok
);
pipe_
->
flush
();
rc
=
probe_msg_
.
close
();
...
...
src/router.cpp
View file @
97324398
...
...
@@ -398,12 +398,15 @@ bool zmq::router_t::identify_peer (pipe_t *pipe_)
rc
=
probe_msg_
.
init
();
errno_assert
(
rc
==
0
);
rc
=
pipe_
->
write
(
&
probe_msg_
);
zmq_assert
(
rc
);
ok
=
pipe_
->
write
(
&
probe_msg_
);
pipe_
->
flush
();
rc
=
probe_msg_
.
close
();
errno_assert
(
rc
==
0
);
// Ignore not probed peers
if
(
!
ok
)
return
false
;
}
return
true
;
...
...
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