0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-26 23:01:04 +08:00

Whitespace fixes

Minor layout fix

Whitespace fix
This commit is contained in:
Pieter Hintjens 2013-12-23 13:14:32 +01:00
parent 384f8522aa
commit 9d9592f830
3 changed files with 11 additions and 3 deletions

View File

@ -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);
---

View File

@ -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

View File

@ -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);