Skip to content
This repository
Browse code

Replace old XREP and XREQ examples with ROUTER and DEALER

  • Loading branch information...
commit 803902e5e0414c5f8700c737b2272e03321dafb2 1 parent 6aabcf1
Igor Wiedler authored December 29, 2011

Showing 130 changed files with 300 additions and 300 deletions. Show diff stats Hide diff stats

  1. 4  articles/src/multithreading/zmsg.c
  2. 4  examples/Ada/zmq-examples-multi_thread_server.adb
  3. 12  examples/C#/asyncsrv.cs
  4. 6  examples/C#/identity.cs
  5. 4  examples/C#/lruqueue.cs
  6. 4  examples/C#/lruqueue2.cs
  7. 4  examples/C#/msgqueue.cs
  8. 4  examples/C#/mtserver.cs
  9. 4  examples/C#/rrbroker.cs
  10. 8  examples/C#/rtdealer.cs
  11. 4  examples/C#/rtmama.cs
  12. 6  examples/C#/rtpapa.cs
  13. 6  examples/C++/identity.cpp
  14. 4  examples/C++/lruqueue.cpp
  15. 2  examples/C++/mdbroker.cpp
  16. 2  examples/C++/mdcliapi2.hpp
  17. 2  examples/C++/mdwrkapi.hpp
  18. 4  examples/C++/msgqueue.cpp
  19. 4  examples/C++/mtserver.cpp
  20. 4  examples/C++/ppqueue.cpp
  21. 2  examples/C++/ppworker.cpp
  22. 4  examples/C++/rrbroker.cpp
  23. 8  examples/C++/rtdealer.cpp
  24. 4  examples/C++/rtmama.cpp
  25. 6  examples/C++/rtpapa.cpp
  26. 4  examples/C++/spqueue.cpp
  27. 8  examples/C++/tripping.cpp
  28. 4  examples/C++/zmsg.hpp
  29. 2  examples/C/rtdealer.c
  30. 4  examples/C/zhelpers.h
  31. 6  examples/CL/identity.lisp
  32. 4  examples/CL/lruqueue.lisp
  33. 4  examples/CL/msgqueue.lisp
  34. 4  examples/CL/mtserver.lisp
  35. 4  examples/CL/rrbroker.lisp
  36. 4  examples/CL/rtdealer.asd
  37. 8  examples/CL/rtdealer.lisp
  38. 4  examples/CL/rtmama.asd
  39. 4  examples/CL/rtmama.lisp
  40. 4  examples/CL/rtpapa.asd
  41. 6  examples/CL/rtpapa.lisp
  42. 4  examples/CL/rtrouter.asd
  43. 6  examples/CL/rtrouter.lisp
  44. 4  examples/CL/zmsg.lisp
  45. 2  examples/Clojure/identity.clj
  46. 4  examples/Clojure/rrbroker.clj
  47. 4  examples/Clojure/rtdealer.clj
  48. 8  examples/Clojure/zhelpers.clj
  49. 2  examples/Erlang/rtdealer.es
  50. 2  examples/F#/rtdealer.fsx
  51. 4  examples/Haskell/msgqueue.hs
  52. 4  examples/Haskell/mtserver.hs
  53. 4  examples/Haskell/rrbroker.hs
  54. 2  examples/Haxe/rtdealer.hx
  55. 4  examples/Java/lruqueue.java
  56. 4  examples/Java/msgqueue.java
  57. 4  examples/Java/ppqueue.java
  58. 2  examples/Java/ppworker.java
  59. 4  examples/Java/rrbroker.java
  60. 10  examples/Java/rtdealer.java
  61. 4  examples/Java/spqueue.java
  62. 12  examples/Lua/asyncsrv.lua
  63. 4  examples/Lua/flserver3.lua
  64. 6  examples/Lua/identity.lua
  65. 4  examples/Lua/lruqueue.lua
  66. 4  examples/Lua/lruqueue2.lua
  67. 2  examples/Lua/mdbroker.lua
  68. 2  examples/Lua/mdcliapi2.lua
  69. 2  examples/Lua/mdwrkapi.lua
  70. 4  examples/Lua/msgqueue.lua
  71. 4  examples/Lua/mtserver.lua
  72. 8  examples/Lua/peering2.lua
  73. 8  examples/Lua/peering3.lua
  74. 4  examples/Lua/ppqueue.lua
  75. 2  examples/Lua/ppworker.lua
  76. 4  examples/Lua/rrbroker.lua
  77. 8  examples/Lua/rtdealer.lua
  78. 4  examples/Lua/rtmama.lua
  79. 6  examples/Lua/rtpapa.lua
  80. 6  examples/Lua/rtrouter.lua
  81. 4  examples/Lua/spqueue.lua
  82. 8  examples/Lua/tripping.lua
  83. 4  examples/Lua/zmsg_test.lua
  84. 4  examples/Objective-C/hwclient.m
  85. 12  examples/PHP/asyncsrv.php
  86. 6  examples/PHP/identity.php
  87. 4  examples/PHP/lruqueue.php
  88. 4  examples/PHP/lruqueue2.php
  89. 2  examples/PHP/mdbroker.php
  90. 2  examples/PHP/mdcliapi2.php
  91. 2  examples/PHP/mdwrkapi.php
  92. 4  examples/PHP/msgqueue.php
  93. 4  examples/PHP/mtserver.php
  94. 8  examples/PHP/peering2.php
  95. 8  examples/PHP/peering3.php
  96. 4  examples/PHP/ppqueue.php
  97. 2  examples/PHP/ppworker.php
  98. 4  examples/PHP/rrbroker.php
  99. 8  examples/PHP/rtdealer.php
  100. 4  examples/PHP/rtmama.php
  101. 6  examples/PHP/rtpapa.php
  102. 6  examples/PHP/rtrouter.php
  103. 4  examples/PHP/spqueue.php
  104. 8  examples/PHP/tripping.php
  105. 4  examples/PHP/zmsg.php
  106. 4  examples/Perl/msgqueue.pl
  107. 4  examples/Perl/mtserver.pl
  108. 4  examples/Perl/rrbroker.pl
  109. 8  examples/Python/asyncsrv.py
  110. 2  examples/Python/flclient2.py
  111. 8  examples/Python/identity.py
  112. 4  examples/Python/lruqueue.py
  113. 4  examples/Python/lruqueue2.py
  114. 4  examples/Python/lruqueue3.py
  115. 4  examples/Python/msgqueue.py
  116. 4  examples/Python/mtserver.py
  117. 4  examples/Python/ppqueue.py
  118. 2  examples/Python/ppworker.py
  119. 4  examples/Python/rrbroker.py
  120. 8  examples/Python/rtdealer.py
  121. 4  examples/Python/rtmama.py
  122. 6  examples/Python/rtpapa.py
  123. 6  examples/Python/rtrouter.py
  124. 4  examples/Python/spqueue.py
  125. 4  examples/Python/zhelpers.py
  126. 4  examples/Ruby/identity.rb
  127. 4  examples/Ruby/msgqueue.rb
  128. 4  examples/Ruby/rrbroker.rb
  129. 2  examples/Ruby/rtdealer.rb
  130. 2  examples/Scala/rtdealer.scala
4  articles/src/multithreading/zmsg.c
@@ -481,9 +481,9 @@ zmsg_test (int verbose)
481 481
 
482 482
     //  Prepare our context and sockets
483 483
     void *context = zmq_init (1);
484  
-    void *output = zmq_socket (context, ZMQ_XREQ);
  484
+    void *output = zmq_socket (context, ZMQ_DEALER);
485 485
     assert (zmq_bind (output, "ipc://zmsg_selftest.ipc") == 0);
486  
-    void *input = zmq_socket (context, ZMQ_XREP);
  486
+    void *input = zmq_socket (context, ZMQ_ROUTER);
487 487
     assert (zmq_connect (input, "ipc://zmsg_selftest.ipc") == 0);
488 488
 
489 489
     //  Test send and receive of single-part message
4  examples/Ada/zmq-examples-multi_thread_server.adb
@@ -37,11 +37,11 @@ begin
37 37
    ctx.Initialize (servers'Length + 1);
38 38
 
39 39
    --   Create a ZMQ_REP socket to receive requests and send replies
40  
-   workers.Initialize (ctx, Sockets.XREQ);
  40
+   workers.Initialize (ctx, Sockets.DEALER);
41 41
    workers.Bind ("inproc://workers");
42 42
 
43 43
    --   Bind to the TCP transport and port 5555 on the 'lo' interface
44  
-   clients.Initialize (ctx, Sockets.XREP);
  44
+   clients.Initialize (ctx, Sockets.ROUTER);
45 45
    clients.Bind ("tcp://lo:5555");
46 46
 
47 47
    for i in servers'Range loop
12  examples/C#/asyncsrv.cs
... ...
@@ -1,5 +1,5 @@
1 1
 //
2  
-//  Asynchronous client-to-server (XREQ to XREP)
  2
+//  Asynchronous client-to-server (DEALER to ROUTER)
3 3
 //
4 4
 //  While this example runs in a single process, that is just to make
5 5
 //  it easier to start and stop the example. Each task has its own
@@ -24,7 +24,7 @@ class Program {
24 24
         //  run several client tasks in parallel, each with a different random ID.
25 25
         static void ClientTask() {
26 26
             using (Context ctx = new Context(1)) {
27  
-                using (Socket client = ctx.Socket(SocketType.XREQ)) {
  27
+                using (Socket client = ctx.Socket(SocketType.DEALER)) {
28 28
                     //  Generate printable identity for the client
29 29
                     ZHelpers.SetID(client, Encoding.Unicode);
30 30
                     string identity = client.IdentityToString(Encoding.Unicode);
@@ -58,8 +58,8 @@ class Program {
58 58
         static void ServerTask() {
59 59
             List<Thread> workers = new List<Thread>(5);
60 60
             using (Context ctx = new Context(1)) {
61  
-                using (Socket frontend = ctx.Socket(SocketType.XREP),
62  
-                    backend = ctx.Socket(SocketType.XREQ)) {
  61
+                using (Socket frontend = ctx.Socket(SocketType.ROUTER),
  62
+                    backend = ctx.Socket(SocketType.DEALER)) {
63 63
                     //  Frontend socket talks to clients over TCP
64 64
                     frontend.Bind("tcp://*:5570");
65 65
                     //  Backend socket talks to workers over inproc
@@ -101,10 +101,10 @@ class Program {
101 101
         //
102 102
         static void ServerWorker(object ctx) {
103 103
             Random rand = new Random(DateTime.Now.Millisecond);
104  
-            using (Socket worker = ((Context)ctx).Socket(SocketType.XREQ)) {
  104
+            using (Socket worker = ((Context)ctx).Socket(SocketType.DEALER)) {
105 105
                 worker.Connect("inproc://backend");
106 106
                 while (true) {
107  
-                    //  The XREQ socket gives us the address envelope and message
  107
+                    //  The DEALER socket gives us the address envelope and message
108 108
                     ZMessage zmsg = new ZMessage(worker);
109 109
                     //  Send 0..4 replies back
110 110
                     int replies = rand.Next(5);
6  examples/C#/identity.cs
@@ -13,7 +13,7 @@ namespace identity {
13 13
     class Program {
14 14
         static void Main(string[] args) {
15 15
             using (Context ctx = new Context()) {
16  
-                using (Socket sink = ctx.Socket(SocketType.XREP),
  16
+                using (Socket sink = ctx.Socket(SocketType.ROUTER),
17 17
                     anonymous = ctx.Socket(SocketType.REQ),
18 18
                     identified = ctx.Socket(SocketType.REQ)) {
19 19
 
@@ -21,13 +21,13 @@ class Program {
21 21
 
22 22
                     //  First allow 0MQ to set the identity
23 23
                     anonymous.Connect("inproc://example");
24  
-                    anonymous.Send("XREP uses a generated UUID", Encoding.Unicode);
  24
+                    anonymous.Send("ROUTER uses a generated UUID", Encoding.Unicode);
25 25
                     ZHelpers.Dump(sink, Encoding.Unicode);
26 26
 
27 27
                     //  Then set the identity ourself
28 28
                     identified.StringToIdentity("Hello", Encoding.Unicode);
29 29
                     identified.Connect("inproc://example");
30  
-                    identified.Send("XREP socket uses REQ's socket identity", Encoding.Unicode);
  30
+                    identified.Send("ROUTER socket uses REQ's socket identity", Encoding.Unicode);
31 31
                     ZHelpers.Dump(sink, Encoding.Unicode);
32 32
                 }
33 33
             }
4  examples/C#/lruqueue.cs
@@ -69,8 +69,8 @@ class Program {
69 69
             List<Thread> clients = new List<Thread>();
70 70
             //  Prepare our context and sockets
71 71
             using (Context ctx = new Context(1)) {
72  
-                using (Socket frontend = ctx.Socket(SocketType.XREP),
73  
-                    backend = ctx.Socket(SocketType.XREP)) {
  72
+                using (Socket frontend = ctx.Socket(SocketType.ROUTER),
  73
+                    backend = ctx.Socket(SocketType.ROUTER)) {
74 74
 
75 75
                     frontend.Bind("tcp://*:5555");
76 76
                     backend.Bind("tcp://*:5556");
4  examples/C#/lruqueue2.cs
@@ -66,8 +66,8 @@ class Program {
66 66
 
67 67
             //  Prepare our context and sockets
68 68
             using (Context ctx = new Context(1)) {
69  
-                using (Socket frontend = ctx.Socket(SocketType.XREP),
70  
-                    backend = ctx.Socket(SocketType.XREP)) {
  69
+                using (Socket frontend = ctx.Socket(SocketType.ROUTER),
  70
+                    backend = ctx.Socket(SocketType.ROUTER)) {
71 71
 
72 72
                     frontend.Bind("tcp://*:5555");
73 73
                     backend.Bind("tcp://*:5556");
4  examples/C#/msgqueue.cs
@@ -14,8 +14,8 @@ namespace ZMQGuide {
14 14
     class Program {
15 15
         static void Main(string[] args) {
16 16
             using (Context context = new Context(1)) {
17  
-                using (Socket frontend = context.Socket(SocketType.XREP),
18  
-                backend = context.Socket(SocketType.XREQ)) {
  17
+                using (Socket frontend = context.Socket(SocketType.ROUTER),
  18
+                backend = context.Socket(SocketType.DEALER)) {
19 19
                     //  Socket facing clients
20 20
                     frontend.Bind("tcp://*:5559");
21 21
                     //  Socket facing services
4  examples/C#/mtserver.cs
@@ -28,8 +28,8 @@ class Program {
28 28
 
29 29
         static void Main(string[] args) {
30 30
             using (Context context = new Context(1)) {
31  
-                using (Socket clients = context.Socket(SocketType.XREP),
32  
-                workers = context.Socket(SocketType.XREQ)) {
  31
+                using (Socket clients = context.Socket(SocketType.ROUTER),
  32
+                workers = context.Socket(SocketType.DEALER)) {
33 33
                     //  Socket to talk to clients
34 34
                     clients.Bind("tcp://*:5555");
35 35
                     //  Socket to talk to workers
4  examples/C#/rrbroker.cs
@@ -18,8 +18,8 @@ public class RRBroker {
18 18
         public RRBroker() {
19 19
             //  Prepare our context and sockets
20 20
             context = new Context(1);
21  
-            frontend = context.Socket(SocketType.XREP);
22  
-            backend = context.Socket(SocketType.XREQ);
  21
+            frontend = context.Socket(SocketType.ROUTER);
  22
+            backend = context.Socket(SocketType.DEALER);
23 23
             frontend.Bind("tcp://*:5559");
24 24
             backend.Bind("tcp://*:5560");
25 25
         }
8  examples/C#/rtdealer.cs
... ...
@@ -1,5 +1,5 @@
1 1
 //
2  
-//  Custom routing Router to Dealer (XREP to XREQ)
  2
+//  Custom routing Router to Dealer
3 3
 //
4 4
 //  While this example runs in a single process, that is just to make
5 5
 //  it easier to start and stop the example. Each thread has its own
@@ -22,7 +22,7 @@ class Program {
22 22
         //
23 23
         static void WorkerTaskA() {
24 24
             using (Context ctx = new Context(1)) {
25  
-                using (Socket worker = ctx.Socket(SocketType.XREQ)) {
  25
+                using (Socket worker = ctx.Socket(SocketType.DEALER)) {
26 26
                     worker.StringToIdentity("A", Encoding.Unicode);
27 27
                     worker.Connect("tcp://localhost:5555");
28 28
                     int total = 0;
@@ -40,7 +40,7 @@ class Program {
40 40
 
41 41
         static void WorkerTaskB() {
42 42
             using (Context ctx = new Context(1)) {
43  
-                using (Socket worker = ctx.Socket(SocketType.XREQ)) {
  43
+                using (Socket worker = ctx.Socket(SocketType.DEALER)) {
44 44
                     worker.StringToIdentity("B", Encoding.Unicode);
45 45
                     worker.Connect("tcp://localhost:5555");
46 46
                     int total = 0;
@@ -61,7 +61,7 @@ class Program {
61 61
             List<Thread> workers = new List<Thread>(new Thread[] { 
62 62
                 new Thread(WorkerTaskA), new Thread(WorkerTaskB) });
63 63
             using (Context ctx = new Context(1)) {
64  
-                using (Socket client = ctx.Socket(SocketType.XREP)) {
  64
+                using (Socket client = ctx.Socket(SocketType.ROUTER)) {
65 65
                     client.Bind("tcp://*:5555");
66 66
                     foreach (Thread thread in workers) {
67 67
                         thread.Start();
4  examples/C#/rtmama.cs
... ...
@@ -1,5 +1,5 @@
1 1
 //
2  
-//  Custom routing Router to Mama (XREP to REQ)
  2
+//  Custom routing Router to Mama (ROUTER to REQ)
3 3
 //
4 4
 //  While this example runs in a single process, that is just to make
5 5
 //  it easier to start and stop the example. Each thread has its own
@@ -50,7 +50,7 @@ class Program {
50 50
             ZHelpers.VersionAssert(2, 1);
51 51
             List<Thread> workers = new List<Thread>(NBR_WORKERS);
52 52
             using (Context ctx = new Context(1)) {
53  
-                using (Socket client = ctx.Socket(SocketType.XREP)) {
  53
+                using (Socket client = ctx.Socket(SocketType.ROUTER)) {
54 54
                     client.Bind("tcp://*:5555");
55 55
                     for (int workerNbr = 0; workerNbr < NBR_WORKERS; workerNbr++) {
56 56
                         workers.Add(new Thread(WorkerTask));
6  examples/C#/rtpapa.cs
... ...
@@ -1,5 +1,5 @@
1 1
 //
2  
-//  Custom routing Router to Papa (XREP to REP)
  2
+//  Custom routing Router to Papa (ROUTER to REP)
3 3
 //
4 4
 
5 5
 //  Author:     Michael Compton
@@ -17,7 +17,7 @@ class Program {
17 17
         //  of events...
18 18
         static void Main(string[] args) {
19 19
             using (Context ctx = new Context(1)) {
20  
-                using (Socket client = ctx.Socket(SocketType.XREP),
  20
+                using (Socket client = ctx.Socket(SocketType.ROUTER),
21 21
                     worker = ctx.Socket(SocketType.REP)) {
22 22
 
23 23
                     client.Bind("inproc://routing");
@@ -42,7 +42,7 @@ class Program {
42 42
                     //  We don't play with envelopes in the worker
43 43
                     worker.Send("This is the reply", Encoding.Unicode);
44 44
 
45  
-                    //  Now dump what we got off the XREP socket...
  45
+                    //  Now dump what we got off the ROUTER socket...
46 46
                     ZHelpers.Dump(client, Encoding.Unicode);
47 47
                 }
48 48
             }
6  examples/C++/identity.cpp
@@ -10,14 +10,14 @@
10 10
 int main () {
11 11
     zmq::context_t context(1);
12 12
 
13  
-    zmq::socket_t sink(context, ZMQ_XREP);
  13
+    zmq::socket_t sink(context, ZMQ_ROUTER);
14 14
     sink.bind( "inproc://example");
15 15
 
16 16
     //  First allow 0MQ to set the identity
17 17
     zmq::socket_t anonymous(context, ZMQ_REQ);
18 18
     anonymous.connect( "inproc://example");
19 19
 
20  
-    s_send (anonymous, "XREP uses a generated UUID");
  20
+    s_send (anonymous, "ROUTER uses a generated UUID");
21 21
     s_dump (sink);
22 22
 
23 23
     //  Then set the identity ourself
@@ -25,7 +25,7 @@ int main () {
25 25
     identified.setsockopt( ZMQ_IDENTITY, "Hello", 5);
26 26
     identified.connect( "inproc://example");
27 27
 
28  
-    s_send (identified, "XREP socket uses REQ's socket identity");
  28
+    s_send (identified, "ROUTER socket uses REQ's socket identity");
29 29
     s_dump (sink);
30 30
 
31 31
     return 0;
4  examples/C++/lruqueue.cpp
@@ -61,8 +61,8 @@ int main (int argc, char *argv[])
61 61
 
62 62
     //  Prepare our context and sockets
63 63
     zmq::context_t context(1);
64  
-    zmq::socket_t frontend (context, ZMQ_XREP);
65  
-    zmq::socket_t backend (context, ZMQ_XREP);
  64
+    zmq::socket_t frontend (context, ZMQ_ROUTER);
  65
+    zmq::socket_t backend (context, ZMQ_ROUTER);
66 66
     frontend.bind("ipc://frontend.ipc");
67 67
     backend.bind("ipc://backend.ipc");
68 68
 
2  examples/C++/mdbroker.cpp
@@ -100,7 +100,7 @@ class broker {
100 100
    {
101 101
        //  Initialize broker state
102 102
        m_context = new zmq::context_t(1);
103  
-       m_socket = new zmq::socket_t(*m_context, ZMQ_XREP);
  103
+       m_socket = new zmq::socket_t(*m_context, ZMQ_ROUTER);
104 104
        m_verbose = verbose;
105 105
        m_heartbeat_at = s_clock () + HEARTBEAT_INTERVAL;
106 106
    }
2  examples/C++/mdcliapi2.hpp
@@ -77,7 +77,7 @@ class mdcli {
77 77
        if (m_client) {
78 78
            delete m_client;
79 79
        }
80  
-       m_client = new zmq::socket_t (*m_context, ZMQ_XREQ);
  80
+       m_client = new zmq::socket_t (*m_context, ZMQ_DEALER);
81 81
        int linger = 0;
82 82
        m_client->setsockopt (ZMQ_LINGER, &linger, sizeof (linger));
83 83
        m_client->connect (m_broker.c_str());
2  examples/C++/mdwrkapi.hpp
@@ -104,7 +104,7 @@ class mdwrk {
104 104
         if (m_worker) {
105 105
             delete m_worker;
106 106
         }
107  
-        m_worker = new zmq::socket_t (*m_context, ZMQ_XREQ);
  107
+        m_worker = new zmq::socket_t (*m_context, ZMQ_DEALER);
108 108
         int linger = 0;
109 109
         m_worker->setsockopt (ZMQ_LINGER, &linger, sizeof (linger));
110 110
         m_worker->connect (m_broker.c_str());
4  examples/C++/msgqueue.cpp
@@ -12,11 +12,11 @@ int main (int argc, char *argv[])
12 12
     zmq::context_t context(1);
13 13
 
14 14
     //  Socket facing clients
15  
-    zmq::socket_t frontend (context, ZMQ_XREP);
  15
+    zmq::socket_t frontend (context, ZMQ_ROUTER);
16 16
     frontend.bind("tcp://*:5559");
17 17
 
18 18
     //  Socket facing services
19  
-    zmq::socket_t backend (context, ZMQ_XREQ);
  19
+    zmq::socket_t backend (context, ZMQ_DEALER);
20 20
     zmq_bind (backend, "tcp://*:5560");
21 21
 
22 22
     //  Start built-in device
4  examples/C++/mtserver.cpp
@@ -38,9 +38,9 @@ int main ()
38 38
 {
39 39
     //  Prepare our context and sockets
40 40
     zmq::context_t context (1);
41  
-    zmq::socket_t clients (context, ZMQ_XREP);
  41
+    zmq::socket_t clients (context, ZMQ_ROUTER);
42 42
     clients.bind ("tcp://*:5555");
43  
-    zmq::socket_t workers (context, ZMQ_XREQ);
  43
+    zmq::socket_t workers (context, ZMQ_DEALER);
44 44
     workers.bind ("inproc://workers");
45 45
 
46 46
     //  Launch pool of worker threads
4  examples/C++/ppqueue.cpp
@@ -97,8 +97,8 @@ int main (void)
97 97
 
98 98
     //  Prepare our context and sockets
99 99
     zmq::context_t context(1);
100  
-    zmq::socket_t frontend(context, ZMQ_XREP);
101  
-    zmq::socket_t backend (context, ZMQ_XREP);
  100
+    zmq::socket_t frontend(context, ZMQ_ROUTER);
  101
+    zmq::socket_t backend (context, ZMQ_ROUTER);
102 102
     frontend.bind("tcp://*:5555");    //  For clients
103 103
     backend.bind ("tcp://*:5556");    //  For workers
104 104
 
2  examples/C++/ppworker.cpp
@@ -20,7 +20,7 @@ std::string identity;
20 20
 
21 21
 static zmq::socket_t *
22 22
 s_worker_socket (zmq::context_t &context) {
23  
-    zmq::socket_t * worker = new zmq::socket_t(context, ZMQ_XREQ);
  23
+    zmq::socket_t * worker = new zmq::socket_t(context, ZMQ_DEALER);
24 24
 
25 25
     //  Set random identity to make tracing easier
26 26
     identity = s_set_id(*worker);
4  examples/C++/rrbroker.cpp
@@ -11,8 +11,8 @@ int main (int argc, char *argv[])
11 11
 {
12 12
     //  Prepare our context and sockets
13 13
     zmq::context_t context(1);
14  
-    zmq::socket_t frontend (context, ZMQ_XREP);
15  
-    zmq::socket_t backend (context, ZMQ_XREQ);
  14
+    zmq::socket_t frontend (context, ZMQ_ROUTER);
  15
+    zmq::socket_t backend (context, ZMQ_DEALER);
16 16
 
17 17
     frontend.bind("tcp://*:5559");
18 18
     backend.bind("tcp://*:5560");
8  examples/C++/rtdealer.cpp
... ...
@@ -1,5 +1,5 @@
1 1
 //
2  
-//  Custom routing Router to Dealer (XREP to XREQ)
  2
+//  Custom routing Router to Dealer
3 3
 //
4 4
 // Olivier Chamoux <olivier.chamoux@fr.thalesgroup.com>
5 5
 
@@ -11,7 +11,7 @@
11 11
 void *worker_a (void *arg) {
12 12
 	
13 13
 	zmq::context_t * context = (zmq::context_t *)arg;
14  
-    zmq::socket_t worker (*context, ZMQ_XREQ);
  14
+    zmq::socket_t worker (*context, ZMQ_DEALER);
15 15
     worker.setsockopt( ZMQ_IDENTITY, "A", 1);
16 16
     worker.connect("ipc://routing.ipc");
17 17
 
@@ -32,7 +32,7 @@ void *worker_a (void *arg) {
32 32
 void *worker_b (void *arg) {
33 33
 	
34 34
 	zmq::context_t * context = (zmq::context_t *)arg;
35  
-    zmq::socket_t worker (*context, ZMQ_XREQ);
  35
+    zmq::socket_t worker (*context, ZMQ_DEALER);
36 36
     worker.setsockopt( ZMQ_IDENTITY, "B", 1);
37 37
     worker.connect("ipc://routing.ipc");
38 38
 
@@ -54,7 +54,7 @@ int main () {
54 54
 
55 55
     zmq::context_t context(1);
56 56
 
57  
-    zmq::socket_t client (context, ZMQ_XREP);
  57
+    zmq::socket_t client (context, ZMQ_ROUTER);
58 58
     client.bind("ipc://routing.ipc");
59 59
 
60 60
     pthread_t worker;
4  examples/C++/rtmama.cpp
... ...
@@ -1,5 +1,5 @@
1 1
 //
2  
-//  Custom routing Router to Mama (XREP to REQ)
  2
+//  Custom routing Router to Mama (ROUTER to REQ)
3 3
 //
4 4
 // Olivier Chamoux <olivier.chamoux@fr.thalesgroup.com>
5 5
 
@@ -40,7 +40,7 @@ worker_thread (void *arg) {
40 40
 
41 41
 int main () {
42 42
     zmq::context_t context(1);
43  
-    zmq::socket_t client (context, ZMQ_XREP);
  43
+    zmq::socket_t client (context, ZMQ_ROUTER);
44 44
     client.bind("ipc://routing.ipc");
45 45
 
46 46
     int worker_nbr;
6  examples/C++/rtpapa.cpp
... ...
@@ -1,5 +1,5 @@
1 1
 //
2  
-//  Custom routing Router to Papa (XREP to REP)
  2
+//  Custom routing Router to Papa (ROUTER to REP)
3 3
 //
4 4
 // Olivier Chamoux <olivier.chamoux@fr.thalesgroup.com>
5 5
 
@@ -10,7 +10,7 @@
10 10
 int main () {
11 11
     zmq::context_t context(1);
12 12
 
13  
-    zmq::socket_t client (context, ZMQ_XREP);
  13
+    zmq::socket_t client (context, ZMQ_ROUTER);
14 14
    client.bind("ipc://routing.ipc");
15 15
 
16 16
     zmq::socket_t worker (context, ZMQ_REP);
@@ -34,7 +34,7 @@ int main () {
34 34
     //  We don't play with envelopes in the worker
35 35
     s_send (worker, "This is the reply");
36 36
 
37  
-    //  Now dump what we got off the XREP socket...
  37
+    //  Now dump what we got off the ROUTER socket...
38 38
     s_dump (client);
39 39
 
40 40
     return 0;
4  examples/C++/spqueue.cpp
@@ -15,8 +15,8 @@ int main (void)
15 15
 
16 16
     //  Prepare our context and sockets
17 17
     zmq::context_t context(1);
18  
-    zmq::socket_t frontend (context, ZMQ_XREP);
19  
-    zmq::socket_t backend  (context, ZMQ_XREP);
  18
+    zmq::socket_t frontend (context, ZMQ_ROUTER);
  19
+    zmq::socket_t backend  (context, ZMQ_ROUTER);
20 20
     frontend.bind("tcp://*:5555");    //  For clients
21 21
     backend.bind("tcp://*:5556");     //  For workers
22 22
 
8  examples/C++/tripping.cpp
@@ -13,7 +13,7 @@ static void *
13 13
 client_task (void *args)
14 14
 {
15 15
     zmq::context_t context (1);
16  
-    zmq::socket_t client (context, ZMQ_XREQ);
  16
+    zmq::socket_t client (context, ZMQ_DEALER);
17 17
     client.setsockopt (ZMQ_IDENTITY, "C", 1);
18 18
     client.connect ("tcp://localhost:5555");
19 19
 
@@ -50,7 +50,7 @@ static void *
50 50
 worker_task (void *args)
51 51
 {
52 52
     zmq::context_t context (1);
53  
-    zmq::socket_t worker (context, ZMQ_XREQ);
  53
+    zmq::socket_t worker (context, ZMQ_DEALER);
54 54
     worker.setsockopt (ZMQ_IDENTITY, "W", 1);
55 55
     worker.connect ("tcp://localhost:5556");
56 56
 
@@ -66,8 +66,8 @@ broker_task (void *args)
66 66
 {
67 67
     //  Prepare our context and sockets
68 68
     zmq::context_t context (1);
69  
-    zmq::socket_t frontend (context, ZMQ_XREP);
70  
-    zmq::socket_t backend  (context, ZMQ_XREP);
  69
+    zmq::socket_t frontend (context, ZMQ_ROUTER);
  70
+    zmq::socket_t backend  (context, ZMQ_ROUTER);
71 71
     frontend.bind ("tcp://*:5555");
72 72
     backend.bind  ("tcp://*:5556");
73 73
 
4  examples/C++/zmsg.hpp
@@ -307,13 +307,13 @@ class zmsg {
307 307
    test(int verbose)
308 308
    {
309 309
       zmq::context_t context(1);
310  
-      zmq::socket_t output(context, ZMQ_XREQ);
  310
+      zmq::socket_t output(context, ZMQ_DEALER);
311 311
       try {
312 312
          output.bind("ipc://zmsg_selftest.ipc");
313 313
       } catch (zmq::error_t error) {
314 314
          assert(error.num()!=0);
315 315
       }
316  
-      zmq::socket_t input(context, ZMQ_XREP);
  316
+      zmq::socket_t input(context, ZMQ_ROUTER);
317 317
       try {
318 318
          input.connect("ipc://zmsg_selftest.ipc");
319 319
       } catch (zmq::error_t error) {
2  examples/C/rtdealer.c
... ...
@@ -1,5 +1,5 @@
1 1
 //
2  
-//  Custom routing Router to Dealer (ROUTER to DEALER)
  2
+//  Custom routing Router to Dealer
3 3
 //
4 4
 //  While this example runs in a single process, that is just to make
5 5
 //  it easier to start and stop the example. Each thread has its own
4  examples/C/zhelpers.h
@@ -32,10 +32,10 @@
32 32
 #   error "Please stick with ZeroMQ/2.1 stable for these examples"
33 33
 #endif
34 34
 #ifndef ZMQ_ROUTER
35  
-#   define ZMQ_ROUTER ZMQ_XREP
  35
+#   define ZMQ_ROUTER ZMQ_ROUTER
36 36
 #endif
37 37
 #ifndef ZMQ_DEALER
38  
-#   define ZMQ_DEALER ZMQ_XREQ
  38
+#   define ZMQ_DEALER ZMQ_DEALER
39 39
 #endif
40 40
 
41 41
 
6  examples/CL/identity.lisp
@@ -17,20 +17,20 @@
17 17
 
18 18
 (defun main ()
19 19
   (zmq:with-context (context 1)
20  
-    (zmq:with-socket (sink context zmq:xrep)
  20
+    (zmq:with-socket (sink context zmq:ROUTER)
21 21
       (zmq:bind sink "inproc://example")
22 22
 
23 23
       ;; First allow 0MQ to set the identity
24 24
       (zmq:with-socket (anonymous context zmq:req)
25 25
         (zmq:connect anonymous "inproc://example")
26  
-        (send-text anonymous "XREP uses a generated UUID")
  26
+        (send-text anonymous "ROUTER uses a generated UUID")
27 27
         (dump-socket sink)
28 28
 
29 29
         ;; Then set the identity ourself
30 30
         (zmq:with-socket (identified context zmq:req)
31 31
           (zmq:setsockopt identified zmq:identity "Hello")
32 32
           (zmq:connect identified "inproc://example")
33  
-          (send-text identified "XREP socket uses REQ's socket identity")
  33
+          (send-text identified "ROUTER socket uses REQ's socket identity")
34 34
           (dump-socket sink)))))
35 35
 
36 36
   (cleanup))
4  examples/CL/lruqueue.lisp
@@ -61,8 +61,8 @@
61 61
 (defun main ()
62 62
   ;; Prepare our context and sockets
63 63
   (zmq:with-context (context 1)
64  
-    (zmq:with-socket (frontend context zmq:xrep)
65  
-      (zmq:with-socket (backend context zmq:xrep)
  64
+    (zmq:with-socket (frontend context zmq:ROUTER)
  65
+      (zmq:with-socket (backend context zmq:ROUTER)
66 66
         (zmq:bind frontend "ipc://frontend.ipc")
67 67
         (zmq:bind backend "ipc://backend.ipc")
68 68
 
4  examples/CL/msgqueue.lisp
@@ -16,10 +16,10 @@
16 16
 (defun main ()
17 17
   (zmq:with-context (context 1)
18 18
     ;; Socket facing clients
19  
-    (zmq:with-socket (frontend context zmq:xrep)
  19
+    (zmq:with-socket (frontend context zmq:ROUTER)
20 20
       (zmq:bind frontend "tcp://*:5559")
21 21
       ;; Socket facing services
22  
-      (zmq:with-socket (backend context zmq:xreq)
  22
+      (zmq:with-socket (backend context zmq:DEALER)
23 23
         (zmq:bind backend  "tcp://*:5560")
24 24
 
25 25
         ;; Start built-in device
4  examples/CL/mtserver.lisp
@@ -33,10 +33,10 @@
33 33
   ;; Prepare our context and socket
34 34
   (zmq:with-context (context 1)
35 35
     ;; Socket to talk to clients
36  
-    (zmq:with-socket (clients context zmq:xrep)
  36
+    (zmq:with-socket (clients context zmq:ROUTER)
37 37
       (zmq:bind clients "tcp://*:5555")
38 38
       ;; Socket to talk to workers
39  
-      (zmq:with-socket (workers context zmq:xreq)
  39
+      (zmq:with-socket (workers context zmq:DEALER)
40 40
         (zmq:bind workers "inproc://workers")
41 41
 
42 42
         ;; Launch pool of worker threads
4  examples/CL/rrbroker.lisp
@@ -15,8 +15,8 @@
15 15
 (defun main ()
16 16
   ;; Prepare our context and sockets
17 17
   (zmq:with-context (context 1)
18  
-    (zmq:with-socket (frontend context zmq:xrep)
19  
-      (zmq:with-socket (backend context zmq:xreq)
  18
+    (zmq:with-socket (frontend context zmq:ROUTER)
  19
+      (zmq:with-socket (backend context zmq:DEALER)
20 20
         (zmq:bind frontend "tcp://*:5559")
21 21
         (zmq:bind backend  "tcp://*:5560")
22 22
 
4  examples/CL/rtdealer.asd
... ...
@@ -1,6 +1,6 @@
1 1
 ;;; -*- Mode:Lisp; Syntax:ANSI-Common-Lisp; -*-
2 2
 ;;;
3  
-;;;  Custom routing Router to Dealer (XREP to XREQ) in Common Lisp
  3
+;;;  Custom routing Router to Dealer in Common Lisp
4 4
 ;;;
5 5
 ;;; Kamil Shakirov <kamils80@gmail.com>
6 6
 ;;;
@@ -12,7 +12,7 @@
12 12
 
13 13
 (defsystem rtdealer
14 14
   :version "0.0.0"
15  
-  :description "Custom routing Router to Dealer (XREP to XREQ) in Common Lisp."
  15
+  :description "Custom routing Router to Dealer in Common Lisp."
16 16
   :maintainer "Kamil Shakirov <kamils80@gmail.com>"
17 17
   :author "Kamil Shakirov <kamils80@gmail.com>"
18 18
   :licence "MIT/X11"
8  examples/CL/rtdealer.lisp
... ...
@@ -1,6 +1,6 @@
1 1
 ;;; -*- Mode:Lisp; Syntax:ANSI-Common-Lisp; -*-
2 2
 ;;;
3  
-;;;  Custom routing Router to Dealer (XREP to XREQ) in Common Lisp
  3
+;;;  Custom routing Router to Dealer in Common Lisp
4 4
 ;;;
5 5
 ;;; Kamil Shakirov <kamils80@gmail.com>
6 6
 ;;;
@@ -16,7 +16,7 @@
16 16
 (in-package :zguide.rtdealer)
17 17
 
18 18
 (defun worker-a (context)
19  
-  (zmq:with-socket (worker context zmq:xreq)
  19
+  (zmq:with-socket (worker context zmq:DEALER)
20 20
     (zmq:setsockopt worker zmq:identity "A")
21 21
     (zmq:connect worker "ipc://routing.ipc")
22 22
 
@@ -30,7 +30,7 @@
30 30
           (incf total))))))
31 31
 
32 32
 (defun worker-b (context)
33  
-  (zmq:with-socket (worker context zmq:xreq)
  33
+  (zmq:with-socket (worker context zmq:DEALER)
34 34
     (zmq:setsockopt worker zmq:identity "B")
35 35
     (zmq:connect worker "ipc://routing.ipc")
36 36
 
@@ -45,7 +45,7 @@
45 45
 
46 46
 (defun main ()
47 47
   (zmq:with-context (context 1)
48  
-    (zmq:with-socket (client context zmq:xrep)
  48
+    (zmq:with-socket (client context zmq:ROUTER)
49 49
       (zmq:bind client "ipc://routing.ipc")
50 50
 
51 51
       (bt:make-thread (lambda () (worker-a context))
4  examples/CL/rtmama.asd
... ...
@@ -1,6 +1,6 @@
1 1
 ;;; -*- Mode:Lisp; Syntax:ANSI-Common-Lisp; -*-
2 2
 ;;;
3  
-;;;  Custom routing Router to Mama (XREP to REQ) in Common Lisp
  3
+;;;  Custom routing Router to Mama (ROUTER to REQ) in Common Lisp
4 4
 ;;;
5 5
 ;;; Kamil Shakirov <kamils80@gmail.com>
6 6
 ;;;
@@ -12,7 +12,7 @@
12 12
 
13 13
 (defsystem rtmama
14 14
   :version "0.0.0"
15  
-  :description "Custom routing Router to Mama (XREP to REQ) in Common Lisp."
  15
+  :description "Custom routing Router to Mama (ROUTER to REQ) in Common Lisp."
16 16
   :maintainer "Kamil Shakirov <kamils80@gmail.com>"
17 17
   :author "Kamil Shakirov <kamils80@gmail.com>"
18 18
   :licence "MIT/X11"
4  examples/CL/rtmama.lisp
... ...
@@ -1,6 +1,6 @@
1 1
 ;;; -*- Mode:Lisp; Syntax:ANSI-Common-Lisp; -*-
2 2
 ;;;
3  
-;;;  Custom routing Router to Mama (XREP to REQ) in Common Lisp
  3
+;;;  Custom routing Router to Mama (ROUTER to REQ) in Common Lisp
4 4
 ;;;
5 5
 ;;; Kamil Shakirov <kamils80@gmail.com>
6 6
 ;;;
@@ -37,7 +37,7 @@
37 37
 
38 38
 (defun main ()
39 39
   (zmq:with-context (context 1)
40  
-    (zmq:with-socket (client context zmq:xrep)
  40
+    (zmq:with-socket (client context zmq:ROUTER)
41 41
       (zmq:bind client "ipc://routing.ipc")
42 42
 
43 43
       (dotimes (i *number-workers*)
4  examples/CL/rtpapa.asd
... ...
@@ -1,6 +1,6 @@
1 1
 ;;; -*- Mode:Lisp; Syntax:ANSI-Common-Lisp; -*-
2 2
 ;;;
3  
-;;;  Custom routing Router to Papa (XREP to REP) in Common Lisp
  3
+;;;  Custom routing Router to Papa (ROUTER to REP) in Common Lisp
4 4
 ;;;
5 5
 ;;; Kamil Shakirov <kamils80@gmail.com>
6 6
 ;;;
@@ -12,7 +12,7 @@
12 12
 
13 13
 (defsystem rtpapa
14 14
   :version "0.0.0"
15  
-  :description "Custom routing Router to Papa (XREP to REP) in Common Lisp."
  15
+  :description "Custom routing Router to Papa (ROUTER to REP) in Common Lisp."
16 16
   :maintainer "Kamil Shakirov <kamils80@gmail.com>"
17 17
   :author "Kamil Shakirov <kamils80@gmail.com>"
18 18
   :licence "MIT/X11"
6  examples/CL/rtpapa.lisp
... ...
@@ -1,6 +1,6 @@
1 1
 ;;; -*- Mode:Lisp; Syntax:ANSI-Common-Lisp; -*-
2 2
 ;;;
3  
-;;;  Custom routing Router to Papa (XREP to REP) in Common Lisp
  3
+;;;  Custom routing Router to Papa (ROUTER to REP) in Common Lisp
4 4
 ;;;
5 5
 ;;; Kamil Shakirov <kamils80@gmail.com>
6 6
 ;;;
@@ -15,7 +15,7 @@
15 15
 ;; We will do this all in one thread to emphasize the sequence of events...
16 16
 (defun main ()
17 17
   (zmq:with-context (context 1)
18  
-    (zmq:with-socket (client context zmq:xrep)
  18
+    (zmq:with-socket (client context zmq:ROUTER)
19 19
       (zmq:bind client "ipc://routing.ipc")
20 20
       (zmq:with-socket (worker context zmq:rep)
21 21
         (zmq:setsockopt worker zmq:identity "A")
@@ -38,7 +38,7 @@
38 38
         ;; We don't play with envelopes in the worker
39 39
         (send-text worker "This is the reply")
40 40
 
41  
-        ;; Now dump what we got off the XREP socket...
  41
+        ;; Now dump what we got off the ROUTER socket...
42 42
         (dump-socket client))))
43 43
 
44 44
   (cleanup))
4  examples/CL/rtrouter.asd
... ...
@@ -1,6 +1,6 @@
1 1
 ;;; -*- Mode:Lisp; Syntax:ANSI-Common-Lisp; -*-
2 2
 ;;;
3  
-;;;  Cross-connected XREP sockets addressing each other in Common Lisp
  3
+;;;  Cross-connected ROUTER sockets addressing each other in Common Lisp
4 4
 ;;;
5 5
 ;;; Kamil Shakirov <kamils80@gmail.com>
6 6
 ;;;
@@ -12,7 +12,7 @@
12 12
 
13 13
 (defsystem rtrouter
14 14
   :version "0.0.0"
15  
-  :description "Cross-connected XREP sockets addressing each other in Common Lisp."
  15
+  :description "Cross-connected ROUTER sockets addressing each other in Common Lisp."
16 16
   :maintainer "Kamil Shakirov <kamils80@gmail.com>"
17 17
   :author "Kamil Shakirov <kamils80@gmail.com>"
18 18
   :licence "MIT/X11"
6  examples/CL/rtrouter.lisp
... ...
@@ -1,6 +1,6 @@
1 1
 ;;; -*- Mode:Lisp; Syntax:ANSI-Common-Lisp; -*-
2 2
 ;;;
3  
-;;;  Cross-connected XREP sockets addressing each other in Common Lisp
  3
+;;;  Cross-connected ROUTER sockets addressing each other in Common Lisp
4 4
 ;;;
5 5
 ;;; Kamil Shakirov <kamils80@gmail.com>
6 6
 ;;;
@@ -14,11 +14,11 @@
14 14
 
15 15
 (defun main ()
16 16
   (zmq:with-context (context 1)
17  
-    (zmq:with-socket (worker context zmq:xrep)
  17
+    (zmq:with-socket (worker context zmq:ROUTER)
18 18
       (zmq:setsockopt worker zmq:identity "WORKER")
19 19
       (zmq:bind worker "ipc://rtrouter.ipc")
20 20
 
21  
-      (zmq:with-socket (server context zmq:xrep)
  21
+      (zmq:with-socket (server context zmq:ROUTER)
22 22
         (zmq:setsockopt server zmq:identity "SERVER")
23 23
         (zmq:connect server "ipc://rtrouter.ipc")
24 24
 
4  examples/CL/zmsg.lisp
@@ -206,10 +206,10 @@ Discards empty message part after address, if any."
206 206
 
207 207
   ;; Prepare our context and sockets
208 208
   (zmq:with-context (context 1)
209  
-    (zmq:with-socket (output context zmq:xreq)
  209
+    (zmq:with-socket (output context zmq:DEALER)
210 210
       (zmq:bind output "ipc://zmsg_selftest.ipc")
211 211
 
212  
-      (zmq:with-socket (input context zmq:xrep)
  212
+      (zmq:with-socket (input context zmq:ROUTER)
213 213
         (zmq:connect input "ipc://zmsg_selftest.ipc")
214 214
 
215 215
         ;; Test send and receive of single-part message
2  examples/Clojure/identity.clj
@@ -11,7 +11,7 @@
11 11
 
12 12
 (defn -main []
13 13
   (let [ctx (mq/context 1)
14  
-        sink (mq/socket ctx mq/xrep)
  14
+        sink (mq/socket ctx mq/ROUTER)
15 15
         anonymous (mq/socket ctx mq/req)
16 16
         identified (mq/socket ctx mq/req)]
17 17
     (mq/bind sink "inproc://example")
4  examples/Clojure/rrbroker.clj
@@ -10,8 +10,8 @@
10 10
 
11 11
 (defn -main []
12 12
   (let [ctx (mq/context 1)
13  
-        frontend (mq/socket ctx mq/xrep)
14  
-        backend (mq/socket ctx mq/xreq)
  13
+        frontend (mq/socket ctx mq/ROUTER)
  14
+        backend (mq/socket ctx mq/DEALER)
15 15
         items (.poller ctx 2)]
16 16
     (mq/bind frontend "tcp://*:5559")
17 17
     (mq/bind backend "tcp://*:5560")
4  examples/Clojure/rtdealer.clj
@@ -4,7 +4,7 @@
4 4
   (:import [java.util Random]))
5 5
 
6 6
 ;;
7  
-;; Custom routing Router to Dealer (ROUTER to DEALER)
  7
+;; Custom routing Router to Dealer
8 8
 ;;
9 9
 ;; While this example runs in a single process, that is just to make
10 10
 ;; it easier to start and stop the example. Each thread has its own
@@ -28,7 +28,7 @@
28 28
 
29 29
 (defn -main []
30 30
   (let [ctx (mq/context 1)
31  
-        client (mq/socket ctx mq/xrep)
  31
+        client (mq/socket ctx mq/ROUTER)
32 32
         srandom (Random. (System/currentTimeMillis))]
33 33
     (mq/bind client "ipc://routing.ipc")
34 34
     (-> "A" Worker. Thread. .start)
8  examples/Clojure/zhelpers.clj
@@ -19,12 +19,12 @@
19 19
 
20 20
 (def sndmore ZMQ/SNDMORE)
21 21
 
22  
-(def router ZMQ/XREP)
23  
-(def dealer ZMQ/XREQ)
  22
+(def router ZMQ/ROUTER)
  23
+(def dealer ZMQ/DEALER)
24 24
 (def req ZMQ/REQ)
25 25
 (def rep ZMQ/REP)
26  
-(def xreq ZMQ/XREQ)
27  
-(def xrep ZMQ/XREP)
  26
+(def DEALER ZMQ/DEALER)
  27
+(def ROUTER ZMQ/ROUTER)
28 28
 (def pub ZMQ/PUB)
29 29
 (def sub ZMQ/SUB)
30 30
 (def pair ZMQ/PAIR)
2  examples/Erlang/rtdealer.es
... ...
@@ -1,6 +1,6 @@
1 1
 #! /usr/bin/env escript
2 2
 %%
3  
-%% Custom routing Router to Dealer (ROUTER to DEALER)
  3
+%% Custom routing Router to Dealer
4 4
 %%
5 5
 %% While this example runs in a single process, that is just to make
6 6
 %% it easier to start and stop the example. Each thread has its own
2  examples/F#/rtdealer.fsx
... ...
@@ -1,5 +1,5 @@
1 1
 (*
2  
-  Custom routing Router to Dealer (ROUTER to DEALER)
  2
+  Custom routing Router to Dealer
3 3
 
4 4
   While this example runs in a single process, that is just to make
5 5
   it easier to start and stop the example. Each thread has its own
4  examples/Haskell/msgqueue.hs
@@ -13,8 +13,8 @@ import Data.ByteString.Char8 (pack, unpack)
13 13
 import Control.Concurrent (threadDelay)
14 14
 
15 15
 main = withContext 1 $ \context -> do  
16  
-  withSocket context Xrep $ \frontend -> do
17  
-    withSocket context Xreq $ \backend -> do
  16
+  withSocket context ROUTER $ \frontend -> do
  17
+    withSocket context DEALER $ \backend -> do
18 18
       
19 19
       bind frontend "tcp://*:5559"
20 20
       bind backend "tcp://*:5560"      
4  examples/Haskell/mtserver.hs
@@ -23,11 +23,11 @@ worker context = do
23 23
 
24 24
 main = withContext 1 $ \context -> do  
25 25
   -- Socket to talk to clients
26  
-  withSocket context XRep $ \clients -> do
  26
+  withSocket context ROUTER $ \clients -> do
27 27
     bind clients "tcp://*:5555"
28 28
     
29 29
     -- Socket to talk to workers
30  
-    withSocket context XReq $ \workers -> do
  30
+    withSocket context DEALER $ \workers -> do
31 31
       bind workers "inproc://workers"
32 32
       
33 33
       replicateM_ 5 $ forkIO (worker context)
4  examples/Haskell/rrbroker.hs
@@ -5,9 +5,9 @@ import Control.Monad (forever)
5 5
     
6 6
 main :: IO ()
7 7
 main = withContext 1 $ \context -> do
8  
-    withSocket context XRep $ \frontend -> do
  8
+    withSocket context ROUTER $ \frontend -> do
9 9
         bind frontend "tcp://*:5559"
10  
-        withSocket context XReq $ \backend -> do
  10
+        withSocket context DEALER $ \backend -> do
11 11
             bind backend "tcp://*5560"
12 12
             forever $ loop_function frontend backend (-1)
13 13
 
2  examples/Haxe/rtdealer.hx
@@ -13,7 +13,7 @@ import org.zeromq.ZContext;
13 13
 import org.zeromq.ZMQSocket;
14 14
 
15 15
 /**
16  
- * Custom routing Router to Dealer (ROUTER to DEALER)
  16
+ * Custom routing Router to Dealer
17 17
  * 
18 18
  * While this example runs in a single process, that is just to make
19 19
  * it easier to start and stop the example.  Each thread has its own
4  examples/Java/lruqueue.java
@@ -87,8 +87,8 @@ public static void main(String[] args) {
87 87
 		Context context = ZMQ.context(1);
88 88
 
89 89
 		//  Prepare our context and sockets
90  
-		Socket frontend  = context.socket(ZMQ.XREP);
91  
-		Socket backend  = context.socket(ZMQ.XREP);
  90
+		Socket frontend  = context.socket(ZMQ.ROUTER);
  91
+		Socket backend  = context.socket(ZMQ.ROUTER);
92 92
 		frontend.bind("ipc://frontend.ipc");
93 93
 		backend.bind("ipc://backend.ipc");
94 94
 
4  examples/Java/msgqueue.java
@@ -16,11 +16,11 @@ public static void main (String[] args) {
16 16
 		Context context = ZMQ.context(1);
17 17
 
18 18
 		//  Socket facing clients
19  
-		Socket frontend = context.socket(ZMQ.XREP);
  19
+		Socket frontend = context.socket(ZMQ.ROUTER);
20 20
 		frontend.bind("tcp://*:5559");
21 21
 
22 22
 		//  Socket facing services
23  
-		Socket backend = context.socket(ZMQ.XREQ);
  23
+		Socket backend = context.socket(ZMQ.DEALER);
24 24
 		backend.bind("tcp://*:5560");
25 25
 
26 26
 		//  Start built-in device
4  examples/Java/ppqueue.java
@@ -116,8 +116,8 @@ public synchronized void close() {
116 116
     public static void main(String[] args) {
117 117
         // Prepare our context and sockets
118 118
         ZContext context = new ZContext();
119  
-        ZMQ.Socket frontend = context.createSocket(ZMQ.XREP);
120  
-        ZMQ.Socket backend = context.createSocket(ZMQ.XREP);
  119
+        ZMQ.Socket frontend = context.createSocket(ZMQ.ROUTER);
  120
+        ZMQ.Socket backend = context.createSocket(ZMQ.ROUTER);
121 121
         frontend.bind("tcp://*:5555"); // For clients
122 122
         backend.bind("tcp://*:5556"); // For workers
123 123
         WorkersPool workers = new WorkersPool();
2  examples/Java/ppworker.java
@@ -26,7 +26,7 @@
26 26
     private static final ZFrame heartbeatFrame = new ZFrame(PPP_HEARTBEAT);
27 27
 
28 28
     private static ZMQ.Socket connectWorker(ZContext context) {
29  
-        ZMQ.Socket worker = context.createSocket(ZMQ.XREQ);
  29
+        ZMQ.Socket worker = context.createSocket(ZMQ.DEALER);
30 30
         // Set random identity to make tracing easier
31 31
         Random rand = new Random();
32 32
         String id = String.format("%04x-%04x", rand.nextInt(0x10001),
4  examples/Java/rrbroker.java
@@ -14,8 +14,8 @@ public static void main (String[] args) {
14 14
 		//  Prepare our context and sockets
15 15
 		Context context = ZMQ.context(1);
16 16
 
17  
-		Socket frontend = context.socket(ZMQ.XREP);
18  
-		Socket backend  = context.socket(ZMQ.XREQ);
  17
+		Socket frontend = context.socket(ZMQ.ROUTER);
  18
+		Socket backend  = context.socket(ZMQ.DEALER);
19 19
 		frontend.bind("tcp://*:5559");
20 20
 		backend.bind("tcp://*:5560");
21 21
 
10  examples/Java/rtdealer.java
... ...
@@ -1,5 +1,5 @@
1 1
 /**
2  
- * Custom routing Router to Dealer. (XREP to XREQ)
  2
+ * Custom routing Router to Dealer.
3 3
  * Java version, based on the C version from
4 4
  * http://zguide.zeromq.org/chapter:all#toc45
5 5
  */
@@ -13,8 +13,8 @@
13 13
 /**
14 14
  * Router-to-dealer custom routing demo.
15 15
  *
16  
- * The router, in this case the main function, uses XREP.  The
17  
- * dealers, in this case the two worker threads, use XREQ.
  16
+ * The router, in this case the main function, uses ROUTER.  The
  17
+ * dealers, in this case the two worker threads, use DEALER.
18 18
  */
19 19
 public class rtdealer {
20 20
     static final String URI = "ipc://routing.ipc";
@@ -32,7 +32,7 @@
32 32
 
33 33
         public void run() {
34 34
             ZMQ.Context context = ZMQ.context(1);
35  
-            ZMQ.Socket socket = context.socket(ZMQ.XREQ);
  35
+            ZMQ.Socket socket = context.socket(ZMQ.DEALER);
36 36
             socket.setIdentity(name.getBytes());
37 37
             socket.connect(URI);
38 38
 
@@ -61,7 +61,7 @@ public void run() {
61 61
     public static void main(String[] args)
62 62
     throws InterruptedException {
63 63
         ZMQ.Context context = ZMQ.context(1);
64  
-        ZMQ.Socket socket = context.socket(ZMQ.XREP);
  64
+        ZMQ.Socket socket = context.socket(ZMQ.ROUTER);
65 65
         socket.bind(URI);
66 66
 
67 67
         Thread workerA = new Thread(new Worker("A"));
4  examples/Java/spqueue.java
@@ -19,8 +19,8 @@
19 19
     public static void main (String[] args) {
20 20
         //  Prepare our context and sockets
21 21
         ZMQ.Context context = ZMQ.context(1);
22  
-        ZMQ.Socket frontend = context.socket(ZMQ.XREP);
23  
-        ZMQ.Socket backend = context.socket(ZMQ.XREP);
  22
+        ZMQ.Socket frontend = context.socket(ZMQ.ROUTER);
  23
+        ZMQ.Socket backend = context.socket(ZMQ.ROUTER);