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
9d9592f8
Commit
9d9592f8
authored
Dec 23, 2013
by
Pieter Hintjens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Whitespace fixes
Minor layout fix Whitespace fix
parent
384f8522
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
3 deletions
+11
-3
zmq_proxy_steerable.txt
doc/zmq_proxy_steerable.txt
+9
-3
zmq_setsockopt.txt
doc/zmq_setsockopt.txt
+1
-0
router.cpp
src/router.cpp
+1
-0
No files found.
doc/zmq_proxy_steerable.txt
View file @
9d9592f8
...
...
@@ -10,7 +10,7 @@ control flow
SYNOPSIS
--------
*int zmq_proxy_steerable (const void '*frontend', const void '*backend',
const void '*capture', const void '*control');*
const void '*capture', const void '*control');*
DESCRIPTION
...
...
@@ -54,14 +54,17 @@ void *backend = zmq_socket (context, ZMQ_DEALER);
assert (frontend);
void *control = zmq_socket (context, ZMQ_SUB);
assert (control);
// Bind sockets to TCP ports
assert (zmq_bind (frontend, "tcp://*:5555") == 0);
assert (zmq_bind (backend, "tcp://*:5556") == 0);
assert (zmq_connect (control, "tcp://*:5557") == 0);
// Subscribe to the control socket since we have chosen SUB here
assert (zmq_setsockopt (control, ZMQ_SUBSCRIBE, "", 0));
// Start the queue proxy, which runs until ETERM or "TERMINATE" received on
the control socket
// Start the queue proxy, which runs until ETERM or "TERMINATE"
// received on the control socket
zmq_proxy_steerable (frontend, backend, NULL, control);
----
.Set up a controller in another node, process or whatever
...
...
@@ -69,10 +72,13 @@ zmq_proxy_steerable (frontend, backend, NULL, control);
void *control = zmq_socket (context, ZMQ_PUB);
assert (control);
assert (zmq_bind (control, "tcp://*:5557") == 0);
// pause the proxy
assert (zmq_send (control, "PAUSE", 5, 0) == 0);
// resume the proxy
assert (zmq_send (control, "RESUME", 6, 0) == 0);
// terminate the proxy
assert (zmq_send (control, "TERMINATE", 9, 0) == 0);
---
...
...
doc/zmq_setsockopt.txt
View file @
9d9592f8
...
...
@@ -419,6 +419,7 @@ Specifically, the first peer to connect with that identity will be terminated
and the second peer will receive any subsequent messages routed to that
identity.
[horizontal]
Option value type:: int
Option value unit:: 0, 1
Default value:: 0
...
...
src/router.cpp
View file @
9d9592f8
...
...
@@ -112,6 +112,7 @@ int zmq::router_t::xsetsockopt (int option_, const void *optval_,
return
0
;
}
break
;
case
ZMQ_ROUTER_HANDOVER
:
if
(
is_int
&&
value
>=
0
)
{
handover
=
(
value
!=
0
);
...
...
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