From cd55c624990d6009348ab3c388c641a53df54d29 Mon Sep 17 00:00:00 2001 From: sigiesec Date: Thu, 7 Sep 2017 11:21:13 +0200 Subject: [PATCH] Problem: use of unqualified "id" in code example Solution: use "routing_id" instead --- doc/zmq_socket.txt | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/doc/zmq_socket.txt b/doc/zmq_socket.txt index f083ff56..1185d7a2 100644 --- a/doc/zmq_socket.txt +++ b/doc/zmq_socket.txt @@ -559,16 +559,16 @@ void *socket = zmq_socket (ctx, ZMQ_STREAM); assert (socket); int rc = zmq_bind (socket, "tcp://*:8080"); assert (rc == 0); -/* Data structure to hold the ZMQ_STREAM ID */ -uint8_t id [256]; -size_t id_size = 256; +/* Data structure to hold the ZMQ_STREAM routing id */ +uint8_t routing_id [256]; +size_t routing_id_size = 256; /* Data structure to hold the ZMQ_STREAM received data */ uint8_t raw [256]; size_t raw_size = 256; while (1) { - /* Get HTTP request; ID frame and then request */ - id_size = zmq_recv (socket, id, 256, 0); - assert (id_size > 0); + /* Get HTTP request; routing id frame and then request */ + routing_id_size = zmq_recv (socket, routing_id, 256, 0); + assert (routing_id_size > 0); do { raw_size = zmq_recv (socket, raw, 256, 0); assert (raw_size >= 0); @@ -579,11 +579,11 @@ while (1) { "Content-Type: text/plain\r\n" "\r\n" "Hello, World!"; - /* Sends the ID frame followed by the response */ - zmq_send (socket, id, id_size, ZMQ_SNDMORE); + /* Sends the routing id frame followed by the response */ + zmq_send (socket, routing_id, routing_id_size, ZMQ_SNDMORE); zmq_send (socket, http_response, strlen (http_response), 0); - /* Closes the connection by sending the ID frame followed by a zero response */ - zmq_send (socket, id, id_size, ZMQ_SNDMORE); + /* Closes the connection by sending the routing id frame followed by a zero response */ + zmq_send (socket, routing_id, routing_id_size, ZMQ_SNDMORE); zmq_send (socket, 0, 0, 0); } zmq_close (socket);