mirror of
https://github.com/zeromq/libzmq.git
synced 2025-01-31 14:39:55 +01:00
Whitespace fixes
Minor layout fix Whitespace fix
This commit is contained in:
parent
384f8522aa
commit
9d9592f830
@ -10,7 +10,7 @@ control flow
|
|||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
*int zmq_proxy_steerable (const void '*frontend', const void '*backend',
|
*int zmq_proxy_steerable (const void '*frontend', const void '*backend',
|
||||||
const void '*capture', const void '*control');*
|
const void '*capture', const void '*control');*
|
||||||
|
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
@ -54,14 +54,17 @@ void *backend = zmq_socket (context, ZMQ_DEALER);
|
|||||||
assert (frontend);
|
assert (frontend);
|
||||||
void *control = zmq_socket (context, ZMQ_SUB);
|
void *control = zmq_socket (context, ZMQ_SUB);
|
||||||
assert (control);
|
assert (control);
|
||||||
|
|
||||||
// Bind sockets to TCP ports
|
// Bind sockets to TCP ports
|
||||||
assert (zmq_bind (frontend, "tcp://*:5555") == 0);
|
assert (zmq_bind (frontend, "tcp://*:5555") == 0);
|
||||||
assert (zmq_bind (backend, "tcp://*:5556") == 0);
|
assert (zmq_bind (backend, "tcp://*:5556") == 0);
|
||||||
assert (zmq_connect (control, "tcp://*:5557") == 0);
|
assert (zmq_connect (control, "tcp://*:5557") == 0);
|
||||||
|
|
||||||
// Subscribe to the control socket since we have chosen SUB here
|
// Subscribe to the control socket since we have chosen SUB here
|
||||||
assert (zmq_setsockopt (control, ZMQ_SUBSCRIBE, "", 0));
|
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);
|
zmq_proxy_steerable (frontend, backend, NULL, control);
|
||||||
----
|
----
|
||||||
.Set up a controller in another node, process or whatever
|
.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);
|
void *control = zmq_socket (context, ZMQ_PUB);
|
||||||
assert (control);
|
assert (control);
|
||||||
assert (zmq_bind (control, "tcp://*:5557") == 0);
|
assert (zmq_bind (control, "tcp://*:5557") == 0);
|
||||||
|
|
||||||
// pause the proxy
|
// pause the proxy
|
||||||
assert (zmq_send (control, "PAUSE", 5, 0) == 0);
|
assert (zmq_send (control, "PAUSE", 5, 0) == 0);
|
||||||
|
|
||||||
// resume the proxy
|
// resume the proxy
|
||||||
assert (zmq_send (control, "RESUME", 6, 0) == 0);
|
assert (zmq_send (control, "RESUME", 6, 0) == 0);
|
||||||
|
|
||||||
// terminate the proxy
|
// terminate the proxy
|
||||||
assert (zmq_send (control, "TERMINATE", 9, 0) == 0);
|
assert (zmq_send (control, "TERMINATE", 9, 0) == 0);
|
||||||
---
|
---
|
||||||
|
@ -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
|
and the second peer will receive any subsequent messages routed to that
|
||||||
identity.
|
identity.
|
||||||
|
|
||||||
|
[horizontal]
|
||||||
Option value type:: int
|
Option value type:: int
|
||||||
Option value unit:: 0, 1
|
Option value unit:: 0, 1
|
||||||
Default value:: 0
|
Default value:: 0
|
||||||
|
@ -112,6 +112,7 @@ int zmq::router_t::xsetsockopt (int option_, const void *optval_,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ZMQ_ROUTER_HANDOVER:
|
case ZMQ_ROUTER_HANDOVER:
|
||||||
if (is_int && value >= 0) {
|
if (is_int && value >= 0) {
|
||||||
handover = (value != 0);
|
handover = (value != 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user