Martin,

Please find attached a patch for these changes. It's mostly the
zmq_socket(3) man page that changed.

-Pieter
From 42c672aa781c3230ce2240f205eb924074c25a1c Mon Sep 17 00:00:00 2001
From: Pieter Hintjens <[email protected]>
Date: Sun, 13 Mar 2011 06:54:57 +0100
Subject: [PATCH] Defined ZMQ_DEALER and ZMQ_ROUTER


Signed-off-by: Pieter Hintjens <[email protected]>
---
 include/zmq.h      |    6 ++++--
 doc/zmq_socket.txt |   38 ++++++++++++++++++++++----------------
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/include/zmq.h b/include/zmq.h
index bf3db07..f3e0947 100644
--- a/include/zmq.h
+++ b/include/zmq.h
@@ -175,12 +175,14 @@ ZMQ_EXPORT int zmq_term (void *context);
 #define ZMQ_SUB 2
 #define ZMQ_REQ 3
 #define ZMQ_REP 4
-#define ZMQ_XREQ 5
-#define ZMQ_XREP 6
+#define ZMQ_DEALER 5
+#define ZMQ_ROUTER 6
 #define ZMQ_PULL 7
 #define ZMQ_PUSH 8
 #define ZMQ_XPUB 9
 #define ZMQ_XSUB 10
+#define ZMQ_XREQ ZMQ_DEALER        /*  Old alias, remove in 3.x               */
+#define ZMQ_XREP ZMQ_ROUTER        /*  Old alias, remove in 3.x               */
 #define ZMQ_UPSTREAM ZMQ_PULL      /*  Old alias, remove in 3.x               */
 #define ZMQ_DOWNSTREAM ZMQ_PUSH    /*  Old alias, remove in 3.x               */
 
diff --git a/doc/zmq_socket.txt b/doc/zmq_socket.txt
index 99fe7ad..4bbd299 100644
--- a/doc/zmq_socket.txt
+++ b/doc/zmq_socket.txt
@@ -109,25 +109,28 @@ Outgoing routing strategy:: Last peer
 ZMQ_HWM option action:: Drop


-ZMQ_XREQ
-^^^^^^^^
-A socket of type 'ZMQ_XREQ' is an advanced pattern used for extending
+ZMQ_DEALER
+^^^^^^^^^^
+A socket of type 'ZMQ_DEALER' is an advanced pattern used for extending
 request/reply sockets. Each message sent is load-balanced among all connected
 peers, and each message received is fair-queued from all connected peers.

-When a 'ZMQ_XREQ' socket enters an exceptional state due to having reached the
+Previously this socket was called 'ZMQ_XREQ' and that name remains available
+for backwards compatibility.
+
+When a 'ZMQ_DEALER' socket enters an exceptional state due to having reached the
 high water mark for all peers, or if there are no peers at all, then any
 linkzmq:zmq_send[3] operations on the socket shall block until the exceptional
 state ends or at least one peer becomes available for sending; messages are not
 discarded.

-When a 'ZMQ_XREQ' socket is connected to a 'ZMQ_REP' socket each message sent
+When a 'ZMQ_DEALER' socket is connected to a 'ZMQ_REP' socket each message sent
 must consist of an empty message part, the _delimiter_, followed by one or more
 _body parts_.

 [horizontal]
-.Summary of ZMQ_XREQ characteristics
-Compatible peer sockets:: 'ZMQ_XREP', 'ZMQ_REP'
+.Summary of ZMQ_DEALER characteristics
+Compatible peer sockets:: 'ZMQ_ROUTER', 'ZMQ_REP'
 Direction:: Bidirectional
 Send/receive pattern:: Unrestricted
 Outgoing routing strategy:: Load-balanced
@@ -135,23 +138,26 @@ Incoming routing strategy:: Fair-queued
 ZMQ_HWM option action:: Block


-ZMQ_XREP
-^^^^^^^^
-A socket of type 'ZMQ_XREP' is an advanced pattern used for extending
-request/reply sockets. When receiving messages a 'ZMQ_XREP' socket shall
+ZMQ_ROUTER
+^^^^^^^^^^
+A socket of type 'ZMQ_ROUTER' is an advanced pattern used for extending
+request/reply sockets. When receiving messages a 'ZMQ_ROUTER' socket shall
 prepend a message part containing the _identity_ of the originating peer to the
 message before passing it to the application. Messages received are fair-queued
-from among all connected peers. When sending messages a 'ZMQ_XREP' socket shall
+from among all connected peers. When sending messages a 'ZMQ_ROUTER' socket shall
 remove the first part of the message and use it to determine the _identity_ of
 the peer the message shall be routed to.

-When a 'ZMQ_XREP' socket enters an exceptional state due to having reached the
+Previously this socket was called 'ZMQ_XREP' and that name remains available
+for backwards compatibility.
+
+When a 'ZMQ_ROUTER' socket enters an exceptional state due to having reached the
 high water mark for all peers, or if there are no peers at all, then any
 messages sent to the socket shall be dropped until the exceptional state ends.
 Likewise, any messages routed to a non-existent peer or a peer for which the
 individual high water mark has been reached shall also be dropped.

-When a 'ZMQ_REQ' socket is connected to a 'ZMQ_XREP' socket, in addition to the
+When a 'ZMQ_REQ' socket is connected to a 'ZMQ_ROUTER' socket, in addition to the
 _identity_ of the originating peer each message received shall contain an empty
 _delimiter_ message part. Hence, the entire structure of each received message
 as seen by the application becomes: one or more _identity_ parts, _delimiter_
@@ -159,8 +165,8 @@ part, one or more _body parts_. When sending replies to a 'ZMQ_REQ' socket the
 application must include the _delimiter_ part.

 [horizontal]
-.Summary of ZMQ_XREP characteristics
-Compatible peer sockets:: 'ZMQ_XREQ', 'ZMQ_REQ'
+.Summary of ZMQ_ROUTER characteristics
+Compatible peer sockets:: 'ZMQ_DEALER', 'ZMQ_REQ'
 Direction:: Bidirectional
 Send/receive pattern:: Unrestricted
 Outgoing routing strategy:: See text
--
1.7.1
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to