-Contributors
-============
+Corporate Contributors
+======================
+
+Copyright (c) 2007-2013 iMatix Corporation
+Copyright (c) 2009-2011 250bpm s.r.o.
+Copyright (c) 2010-2011 Miru Limited
+Copyright (c) 2011 VMware, Inc.
+Copyright (c) 2012 Spotify AB
+
+Individual Contributors
+=======================
AJ Lewis <aj.lewis@quantum.com>
Alexej Lotz <alexej.lotz@arcor.de>
Andrew Thompson <andy@fud.org.nz>
Asko Kauppi <askok@dnainternet.net>
+Attila Mark <gougolith@gmail.com>
Barak Amar <barak.amar@gmail.com>
Ben Gray <ben@benjamg.com>
Bernd Prager <bernd@prager.ws>
Bernd Melchers <melchers@ZEDAT.FU-Berlin.DE>
Bob Beaty <rbeaty@peak6.com>
+Brandon Carpenter <hashstat@yahoo.com>
Brian Buchanan <bwb@holo.org>
Brett Cameron <Brett.Cameron@hp.com>
Burak Arslan <burak-github@arskom.com.tr>
Chris Rempel <csrl@gmx.com>
Chris Wong <chris@chriswongstudio.com>
Christian Gudrian <christian.gudrian@fluidon.com>
+Christian Kamm <kamm@incasoftware.de>
Chuck Remes <cremes@mac.com>
Conrad D. Steenberg <conrad.steenberg@caltech.edu>
Dhammika Pathirana <dhammika@gmail.com>
Joe Thornber <joe.thornber@gmail.com>
Jon Dyte <jon@totient.co.uk>
Kamil Shakirov <kamils80@gmail.com>
+Ken Steele <ken@tilera.com>
Marc Rossi <mrossi19@gmail.com>
Martin Hurton <hurtonm@gmail.com>
Martin Lucina <martin@lucina.net>
Philip Kovacs <phil@philkovacs.com>
Pieter Hintjens <ph@imatix.com>
Piotr Trojanek <piotr.trojanek@gmail.com>
+Richard Newton <richard_newton@waters.com>
Robert G. Jakabosky <bobby@sharedrealm.com>
Sebastian Otaegui <feniix@gmail.com>
+Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de>
Steven McCoy <steven.mccoy@miru.hk>
Stuart Webster <sw_webster@hotmail.com>
Tamara Kustarova <kustarova.tamara@gmail.com>
Tore Halvorsen <tore.halvorsen@gmail.com>
Vitaly Mayatskikh <v.mayatskih@gmail.com>
Lourens Naudé <lourens@methodmissing.com>
+Hardeep Singh <hshardeesi@gmail.com>
Credits
=======
Robert Zhang <robert@scout-trading.com>
Toralf Wittner <toralf.wittner@gmail.com>
Zed Shaw <zed.shaw@gmail.com>
-
derived from or based on this library. If you modify this library, you must
extend this exception to your version of the library.
+Note: this exception relieves you of any obligations under sections 4 and 5
+of this license, and section 6 of the GNU General Public License.
# Generated by Makefile. Do not edit.
-commit 2ae1bd2088555193daf34dd0a9bffebb85b8e3cb
-Merge: 025e218 3b268c6
+commit 1ac53ed1f75202bbe36dd0b409736f90984638e5
+Merge: 2eb6336 7f08204
Author: Pieter Hintjens <ph@imatix.com>
-Date: Thu Nov 22 23:58:03 2012 -0800
+Date: Mon Mar 10 22:41:14 2014 +0100
Merge pull request #66 from hintjens/master
- One fix to NEWS
+ Source package did not build
-commit 3b268c6943dff8e36d88f7f846bb5726ea4eac8f
+commit 7f08204e9fa0c98cbf29229167d7a9939f61179c
Author: Pieter Hintjens <ph@imatix.com>
-Date: Fri Nov 23 16:57:23 2012 +0900
+Date: Mon Mar 10 22:39:59 2014 +0100
- Added NEWS entry for issue 465
+ Source package did not build
- NEWS | 1 +
+ src/Makefile.am | 2 ++
+ 1 file changed, 2 insertions(+)
+
+commit 2eb63360d60097ca6bca5eeffbc789c72994125c
+Merge: e5473a7 930ef37
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Mar 10 13:41:48 2014 +0100
+
+ Merge pull request #64 from hintjens/master
+
+ Bumped NEWS for 4.0.4 release
+
+commit 930ef3773861170fba44ab2f8cb1a47e5a3a315d
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Mar 10 13:40:49 2014 +0100
+
+ Bumped NEWS for 4.0.4 release
+
+ NEWS | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit e5473a7a6998311ef098ca25077ba1a3755df0dd
+Merge: ebbbdf8 dd5603d
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Mar 3 12:10:18 2014 +0100
+
+ Merge pull request #63 from hintjens/master
+
+ Backported fix for #909
+
+commit dd5603d6e95e22e8b9f963680e99e11de6a4de3a
+Author: Josh Blum <josh@joshknows.com>
+Date: Wed Feb 12 11:22:37 2014 -0800
+
+ Updated NEWS for #909
+
+ NEWS | 2 ++
+ src/Makefile.am | 6 +++++-
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+commit 03dc70c3507e2e430d5c065cd64f60d8635f8837
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Feb 13 19:21:42 2014 +0100
+
+ Updated for #60
+
+ NEWS | 2 ++
+ 1 file changed, 2 insertions(+)
+
+commit 97292367ebeb541ae37c83f432bc4970511b6bf9
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Feb 13 09:33:14 2014 +0100
+
+ Updated NEWS
+
+ NEWS | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+commit ebbbdf89cb29e68119d24acc55d89e4e95bbe638
+Merge: e655fd1 c7a7de1
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Feb 13 19:20:28 2014 +0100
+
+ Merge pull request #60 from ricnewton/master
+
+ Fix hang on terminate when inproc is connected but never bound
+
+commit c7a7de12a351b26c39758db5bc0d310ae6598c24
+Author: Richard Newton <richard_newton@waters.com>
+Date: Thu Feb 13 14:56:09 2014 +0000
+
+ Backported fix for #888
+
+ src/ctx.cpp | 10 +++++++++-
+ tests/test_inproc_connect.cpp | 20 +++++++++++++++++++-
+ tests/testutil.hpp | 2 +-
+ 3 files changed, 29 insertions(+), 3 deletions(-)
+
+commit e655fd138d948800df80959d71da12738a1c4bc1
+Merge: 0e147bb 2493a99
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Feb 5 21:11:10 2014 +0100
+
+ Merge pull request #57 from Debian/counter
+
+ Fix timestamp counter on s390/s390x
+
+commit 0e147bb69144856b81816d57c570aa867e76a2eb
+Merge: d4f9886 4b9cd77
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Feb 5 21:10:49 2014 +0100
+
+ Merge pull request #56 from Debian/symbols
+
+ Only export zmq_* symbols
+
+commit 4b9cd7764ab7ee6b9c82f216f0c8801493f33fa2
+Author: Alessandro Ghedini <alessandro@ghedini.me>
+Date: Sun Jan 12 12:30:45 2014 +0100
+
+ Only export zmq_* symbols
+
+ src/Makefile.am | 2 +-
+ src/libzmq.vers | 4 ++++
+ 2 files changed, 5 insertions(+), 1 deletion(-)
+
+commit 2493a9973582cb079a2bda5beeb8b1f3e9332b48
+Author: Alessandro Ghedini <alessandro@ghedini.me>
+Date: Sun Jan 12 12:31:31 2014 +0100
+
+ Fix timestamp counter on s390/s390x
+
+ Fixes #811
+
+ src/clock.cpp | 1 -
+ 1 file changed, 1 deletion(-)
+
+commit d4f988649da12415e431001fb7c0b748d4742714
+Merge: 0b11c31 830e022
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Feb 3 02:55:18 2014 -0800
+
+ Merge pull request #55 from hintjens/master
+
+ Fixed issue #868
+
+commit 830e0229875791641e449ec1429c7e6a7f3fd163
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Feb 3 11:20:58 2014 +0100
+
+ Fixed #868
+
+ NEWS | 2 ++
+ src/ip.cpp | 1 -
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+commit 5a576d22dbc3efa3e50832d61a5d73abc02ece28
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Jan 16 07:13:29 2014 +0100
+
+ Updated NEWS for #584
+
+ NEWS | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+commit 89c762fb0ae0f7a62b70be12d07139190bf52d97
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Jan 1 13:43:14 2014 +0100
+
+ Clarified ZMQ_IDENTITY doc for duplicate identities
+
+ doc/zmq_setsockopt.txt | 15 ++++++---------
+ 1 file changed, 6 insertions(+), 9 deletions(-)
+
+commit 0b11c3174ef4e096dec07d0b4f62bbbeda93933e
+Merge: 129cb00 63fe43a
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Jan 15 22:11:50 2014 -0800
+
+ Merge pull request #51 from EricMCornelius/master
+
+ Corrects ypipe initialization when conflate is NOT enabled.
+
+commit 129cb00d8f04391fce7db3ba6732cf4fa0be2844
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Jan 15 21:39:21 2014 +0100
+
+ Update README.md
+
+ README.md | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 6982e69da4acc720f23bce6c7b8fb005ea4bbabe
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Jan 15 21:39:00 2014 +0100
+
+ Update README.md
+
+ README.md | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+commit 63fe43a101ac0e70cb254463a4e76081f175d775
+Author: Eric Cornelius <Eric.Cornelius@mandiant.com>
+Date: Wed Jan 15 12:18:50 2014 -0800
+
+ Corrects ypipe initialization when conflate is NOT enabled. Fixes LIBZMQ-584
+
+ src/pipe.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit 3f3f9dcec23d4927586a4bf37afe3ee27efa2169
+Merge: a37c198 53bef03
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Jan 2 14:45:47 2014 -0800
+
+ Merge pull request #47 from vortechs2000/fix_news
+
+ Adjust NEWS to include LIBZMQ-576
+
+commit 53bef03e7bc8199da915d76394f39dff4f257f04
+Author: AJ Lewis <aj.lewis@quantum.com>
+Date: Thu Jan 2 16:39:03 2014 -0600
+
+ Adjust NEWS to include LIBZMQ-576
+
+ NEWS | 2 ++
+ 1 file changed, 2 insertions(+)
+
+commit a37c198c7db547129bb47d02597ee5669183478b
+Merge: 5db0acb 047bd13
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Jan 2 13:12:18 2014 -0800
+
+ Merge pull request #46 from vortechs2000/fix-libzmq-576
+
+ Fix LIBZMQ-576 - Revert "Merge pull request #510 from miniway/master"
+
+commit 047bd130cfd885ce76d4c04914adaa5333f4efe7
+Author: AJ Lewis <aj.lewis@quantum.com>
+Date: Thu Jan 2 11:04:43 2014 -0600
+
+ Fix LIBZMQ-576 - Revert "Merge pull request #510 from miniway/master"
+
+ This reverts commit f27eb67e1abb0484c41050e454404cce30647b63, reversing
+ changes made to a3ae0d4c16c892a4e6c96d626a7c8b7068450336.
+
+ Conflicts:
+ src/stream_engine.cpp
+
+ Conflicts were around additional defaults to the constructor after the
+ 'terminating' default. The additional defaults were left alone, and
+ the 'terminating' default was removed.
+
+ src/encoder.hpp | 5 -----
+ src/i_encoder.hpp | 1 -
+ src/stream_engine.cpp | 12 ------------
+ src/stream_engine.hpp | 1 -
+ 4 files changed, 19 deletions(-)
+
+commit 5db0acb044ae8feb04f8ba6ae679d7a6050bd009
+Merge: 571c668 845ee0c
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Dec 23 04:18:04 2013 -0800
+
+ Merge pull request #44 from hintjens/master
+
+ Issue 797
+
+commit 845ee0c7bc4a189f612b7a6577454924bce26d56
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Dec 23 13:17:38 2013 +0100
+
+ Updated NEWS
+
+ NEWS | 2 ++
+ 1 file changed, 2 insertions(+)
+
+commit 2ba0d159b598e4e7886c917cfb63b48d77991403
+Author: Alex Grönholm <alex.gronholm+git@nextday.fi>
+Date: Sun Dec 22 02:55:18 2013 +0200
+
+ Fixed setting TCP keepalive parameters on Windows
+
+ src/tcp.cpp | 30 ++++++++++--------------------
+ src/windows.hpp | 1 +
+ 2 files changed, 11 insertions(+), 20 deletions(-)
+
+commit 571c668fa2e0b101f607b4c4a34c30da2f174499
+Merge: 97e1ecc 0552d91
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Dec 6 14:30:23 2013 -0800
+
+ Merge pull request #43 from hintjens/master
+
+ Backporting fixes from master
+
+commit 0552d9119bada6a132a612e8284eb82a58ba26b0
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Dec 5 16:52:36 2013 +0100
+
+ Updated news for #775
+
+ NEWS | 2 ++
+ 1 file changed, 2 insertions(+)
+
+commit 3dc89feafcee31ef5169d827015f1fe2a18da08b
+Author: KIU Shueng Chuan <nixchuan@gmail.com>
+Date: Thu Dec 5 07:04:21 2013 +0800
+
+ use enum retired_fd instead of -1
+
+ using -1 causes a warning on Windows platform because SOCKET is unsigned.
+
+ src/socket_base.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 97e1ecce228c1465d619db7c3c5a11a9dd36670c
+Merge: 8b9a824 d958b67
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Dec 1 02:55:48 2013 -0800
+
+ Merge pull request #40 from hintjens/master
+
+ Backported fix for #763
+
+commit d958b675c7918c05b92c3e0cfbd49601142cdefd
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Dec 1 11:54:55 2013 +0100
+
+ Updated NEWS for #763
+
+ NEWS | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+commit ff8f97e7d770651ef2e50e6f2a36069ae78e7814
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Sat Nov 30 21:24:32 2013 +0100
+
+ Fix issue #763
+
+ src/stream_engine.cpp | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+commit 75ba4c7292bc09e7fc58dd206447777391d06100
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Nov 24 19:00:18 2013 +0100
+
+ Updated version number for release 4.0.4
+
+ include/zmq.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 8b9a82476b196a200b9698c9345ae8ba50cccb1c
+Merge: 78b741b 4363b75
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Nov 24 09:58:59 2013 -0800
+
+ Merge pull request #37 from hintjens/master
+
+ Fixed test_many_sockets
+
+commit 4363b75b4d9aec70b297e96d4b933110ce161a62
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Nov 24 18:56:50 2013 +0100
+
+ Release notes for 4.0.3
+
+ NEWS | 10 ++++++++++
+ include/zmq.h | 2 +-
+ 2 files changed, 11 insertions(+), 1 deletion(-)
+
+commit c022c048dcbe15a2757ab90d2d03d89f615744a8
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Nov 19 16:51:06 2013 +0100
+
+ Fixed test_many_sockets
+
+ * failed on systems where process could not allocate 1024 sockets by default
+ * include path for platform.hpp was wrong; fixed it
+
+ tests/test_many_sockets.cpp | 73 ++++++++++++++++++-------------------------
+ tests/testutil.hpp | 2 +-
+ 2 files changed, 32 insertions(+), 43 deletions(-)
+
+commit 78b741bd71995c7b73a2cbe449f2c6028610f7e4
+Merge: d743dda ba7c065
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Nov 24 03:47:58 2013 -0800
+
+ Merge pull request #36 from hintjens/master
+
+ Updated version number for 4.0.2
+
+commit ba7c065c3dd13453c79d7a07efa1c6c3e56bdf18
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Nov 24 12:45:47 2013 +0100
+
+ Updated version number for 4.0.2
+
+ - also moved macros to top of zmq.h for better visibility
+
+ include/zmq.h | 30 +++++++++++++-----------------
+ 1 file changed, 13 insertions(+), 17 deletions(-)
+
+commit d743ddafda6dd45f178cd6c8bd98c32b1aa4c49b
+Merge: e193915 84c0caf
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Nov 24 03:42:01 2013 -0800
+
+ Merge pull request #35 from hintjens/master
+
+ Updated NEWS for release 4.0.2
+
+commit 84c0caf42eae2e1871d880bfd6722a5011c8e531
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Nov 24 12:41:16 2013 +0100
+
+ Updated NEWS for release 4.0.2
+
+ NEWS | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+commit e1939155ff4aab3c7d543e0ef089349a10814895
+Merge: 30309d6 9ece2d3
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Nov 19 02:01:23 2013 -0800
+
+ Merge pull request #34 from hintjens/master
+
+ Backporting fixes from master
+
+commit 9ece2d322a6189d02f1a57bf499dda8510665d16
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Nov 13 13:57:53 2013 +0100
+
+ Added links to RFCs for socket patterns
+
+ doc/zmq_socket.txt | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+commit 589bf436dd08066b7a7fdd608c31c41b9a15b936
+Author: KIU Shueng Chuan <nixchuan@gmail.com>
+Date: Tue Nov 12 01:12:24 2013 +0800
+
+ remove all asserts during critical section
+
+ the size of the critical section is reduced by only entering the critical
+ section right before the bind().
+
+ src/signaler.cpp | 76 ++++++++++++++++++++++--------------------------------
+ 1 file changed, 31 insertions(+), 45 deletions(-)
+
+commit e54e55835e6caa07a5805e1b7d1e7e6e5e098b74
+Author: KIU Shueng Chuan <nixchuan@gmail.com>
+Date: Tue Nov 12 00:07:06 2013 +0800
+
+ return error to caller on bind error
+
+ src/signaler.cpp | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+commit 111c20dc22709e58ff2c5718c04210eee1a359e5
+Author: Richard Newton <richard_newton@waters.com>
+Date: Mon Nov 11 13:54:58 2013 +0000
+
+ Fix signed/unsigned comparison
+
+ tests/test_many_sockets.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit 3a4896f4a36e6df2d2f7b62b1d64ef7d74774a90
+Author: Richard Newton <richard_newton@waters.com>
+Date: Mon Nov 11 13:53:25 2013 +0000
+
+ Fix signed/unsigned comparison
+
+ tests/test_many_sockets.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 0855c28069bd87f4c50ecb5606641522654f97a1
+Author: Richard Newton <richard_newton@waters.com>
+Date: Mon Nov 11 13:41:42 2013 +0000
+
+ Reduce default maximum number of sockets by 1 so there is room for the reaper socket.
+
+ include/zmq.h | 2 +-
+ tests/test_many_sockets.cpp | 79 +++++++++++++++++++++++++++++++++++--------
+ 2 files changed, 65 insertions(+), 16 deletions(-)
+
+commit 737b6afc97ef959480fb2ae69192eb8965fe99d6
+Author: Richard Newton <richard_newton@waters.com>
+Date: Mon Nov 11 13:09:23 2013 +0000
+
+ Revert "Make FD_SETSIZE = ZMQ_MAX_SOCKETS_DFLT + 1 so there is room for the repear socket."
+
+ This reverts commit 0b92831b2a82c3bbc0e9371662c546b94915a3ea.
+
+ CMakeLists.txt | 2 +-
+ builds/mingw32/Makefile.mingw32 | 2 +-
+ builds/msvc/libzmq/libzmq.vcproj | 10 +++++-----
+ builds/msvc/properties/ZeroMQ.props | 2 +-
+ builds/msvc/properties/ZeroMQ_Static.props | 2 +-
+ 5 files changed, 9 insertions(+), 9 deletions(-)
+
+commit 8f85bafe372d96212764a51737835fef82e035a8
+Author: psl-felipefarinon <felipe.farinon@powersyslab.com>
+Date: Mon Nov 11 10:20:28 2013 -0200
+
+ issue #583 removing C++11 code.
+
+ src/clock.cpp | 1 -
+ 1 file changed, 1 deletion(-)
+
+commit f72dbb35d5e9d864acb1634f96c7efd7f4ead15f
+Author: Bruno D. Rodrigues <bruno.rodrigues@litux.org>
+Date: Sun Nov 10 10:19:19 2013 +0000
+
+ Fix socket creation above sistem limits for all 'other' OS not covered by eventfd, windows or vms; enhanced test to create sockets up to a bigger limit to really test hitting the OS limit
+
+ src/signaler.cpp | 2 +-
+ tests/test_many_sockets.cpp | 3 ++-
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+commit 5d6e7a74c1e50559f0ee3cb37dc61e21ea818c67
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sat Nov 9 09:59:21 2013 +0100
+
+ Added test case to ignore
+
+ .gitignore | 1 +
1 file changed, 1 insertion(+)
-commit 025e2186293c4a3d84f5b0f9b904dfe1a09b611a
-Merge: 12f3f8a 61b9368
+commit 30309d660e4d3ef72d677ad059ed57f0ca80471c
+Merge: f745e4c e0c8a11
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sat Nov 9 00:56:52 2013 -0800
+
+ Merge pull request #32 from hintjens/master
+
+ Cherry picking changes from libzmq master
+
+commit e0c8a112a43cd13bd3e21696b26e0357037d4759
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sat Nov 9 09:56:21 2013 +0100
+
+ Cherry picking fixes from master
+
+ .gitignore | 1 +
+ NEWS | 13 +++++++------
+ tests/Makefile.am | 1 -
+ 3 files changed, 8 insertions(+), 7 deletions(-)
+
+commit f6293d257d9f649ef82ce40850d1b18cca9a89dd
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Wed Oct 9 10:51:30 2013 +0200
+
+ Signal that the peer performed orderly shutdown
+
+ src/stream_engine.cpp | 77 +++++++++++++++++++++++--------------------------
+ src/stream_engine.hpp | 7 ++---
+ 2 files changed, 39 insertions(+), 45 deletions(-)
+
+commit f33bdcf02e4781943a5c000af707a0d011d59b8f
+Author: Richard Newton <richard_newton@waters.com>
+Date: Thu Nov 7 17:50:29 2013 +0000
+
+ Fix formatting.
+
+ src/ctx.cpp | 8 ++++----
+ src/devpoll.cpp | 2 +-
+ src/devpoll.hpp | 2 +-
+ src/epoll.cpp | 2 +-
+ src/epoll.hpp | 2 +-
+ src/kqueue.cpp | 2 +-
+ src/kqueue.hpp | 2 +-
+ src/poll.cpp | 2 +-
+ src/poll.hpp | 2 +-
+ src/select.cpp | 2 +-
+ src/select.hpp | 2 +-
+ 11 files changed, 14 insertions(+), 14 deletions(-)
+
+commit fef24a8c1f5c1f806c11e35eb8d93e1fc334bb47
+Author: Richard Newton <richard_newton@waters.com>
+Date: Thu Nov 7 18:26:13 2013 +0000
+
+ Make FD_SETSIZE = ZMQ_MAX_SOCKETS_DFLT + 1 so there is room for the repear socket.
+
+ CMakeLists.txt | 2 +-
+ builds/mingw32/Makefile.mingw32 | 2 +-
+ builds/msvc/libzmq/libzmq.vcproj | 10 +++++-----
+ builds/msvc/properties/ZeroMQ.props | 2 +-
+ builds/msvc/properties/ZeroMQ_Static.props | 2 +-
+ 5 files changed, 9 insertions(+), 9 deletions(-)
+
+commit bfc3deb43a271e13c0cb44ed0694fdd80848298d
+Author: Richard Newton <richard_newton@waters.com>
+Date: Thu Nov 7 17:46:19 2013 +0000
+
+ Get maximum number of sockets it can handle from poller_t
+
+ src/ctx.cpp | 12 ++++++++++--
+ src/devpoll.cpp | 5 +++++
+ src/devpoll.hpp | 2 ++
+ src/epoll.cpp | 5 +++++
+ src/epoll.hpp | 2 ++
+ src/kqueue.cpp | 5 +++++
+ src/kqueue.hpp | 2 ++
+ src/poll.cpp | 5 +++++
+ src/poll.hpp | 2 ++
+ src/select.cpp | 5 +++++
+ src/select.hpp | 2 ++
+ 11 files changed, 45 insertions(+), 2 deletions(-)
+
+commit dccf1dce1e12109adc669b68a80398c3b927b804
+Author: psl-felipefarinon <felipe.farinon@powersyslab.com>
+Date: Thu Nov 7 15:21:42 2013 -0200
+
+ Fixing broken build issue #583
+
+ src/clock.cpp | 2 ++
+ 1 file changed, 2 insertions(+)
+
+commit 24311dee1b8b53b9280a255e5a05b180f812afdf
+Author: Richard Newton <richard_newton@waters.com>
+Date: Thu Nov 7 16:47:55 2013 +0000
+
+ Add test case for many sockets
+
+ Conflicts:
+ CMakeLists.txt
+ tests/Makefile.am
+
+ CMakeLists.txt | 4 +++-
+ tests/Makefile.am | 5 ++++-
+ tests/test_many_sockets.cpp | 51 +++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 58 insertions(+), 2 deletions(-)
+
+commit 27d20aacc7563ffa376198acb1a509c4fb35f4fb
+Author: psl-felipefarinon <felipe.farinon@powersyslab.com>
+Date: Thu Nov 7 14:06:54 2013 -0200
+
+ Fixing issue #583. Using low resolution timer for clock::now_ms
+
+ src/clock.cpp | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--
+ 1 file changed, 56 insertions(+), 2 deletions(-)
+
+commit b2698474d2b0036ad27b9056d703e864bd96b706
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Nov 7 15:30:25 2013 +0100
+
+ Simplified fdpair reset after fork
+
+ src/signaler.cpp | 22 ++++------------------
+ 1 file changed, 4 insertions(+), 18 deletions(-)
+
+commit 0465e9abe922db5f47e50998c0d495351373b1c1
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Nov 7 15:26:56 2013 +0100
+
+ Simplified error handling for make_fdpair on Windows
+
+ src/signaler.cpp | 7 -------
+ 1 file changed, 7 deletions(-)
+
+commit 885c816e5718c406d18cbccbc4093b0e46761821
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Nov 7 14:59:53 2013 +0100
+
+ Fix for issue 574
+
+ src/signaler.cpp | 89 ++++++++++++++++++++++++++-------------------------
+ src/signaler.hpp | 4 +--
+ src/socket_base.cpp | 82 ++++++++++++++++++++++++-----------------------
+ 3 files changed, 89 insertions(+), 86 deletions(-)
+
+commit 7f3d0995cda22fd504bbf106a719a8f8c755ce96
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Nov 6 13:30:41 2013 +0100
+
+ Removed over-long pauses in tests
+
+ - used msleep (10) in most places instead of zmq_sleep (1)
+ - may cause failures on slower machines
+ - to change, modify SETTLE_TIME in testutil.h
+ - tested down to 1 msec on fast boxes
+
+ Conflicts:
+ tests/test_connect_delay_tipc.cpp
+ tests/test_proxy.cpp
+ tests/test_sub_forward_tipc.cpp
+ tests/test_term_endpoint_tipc.cpp
+ tests/testutil.hpp
+
+ tests/test_conflate.cpp | 7 ++-----
+ tests/test_ctx_destroy.cpp | 2 +-
+ tests/test_immediate.cpp | 3 +--
+ tests/test_inproc_connect.cpp | 2 +-
+ tests/test_iov.cpp | 2 +-
+ tests/test_monitor.cpp | 6 +++---
+ tests/test_req_relaxed.cpp | 2 +-
+ tests/test_spec_req.cpp | 2 +-
+ tests/test_sub_forward.cpp | 2 +-
+ tests/test_term_endpoint.cpp | 4 ++--
+ tests/testutil.hpp | 17 +++++++++++++++++
+ 11 files changed, 31 insertions(+), 18 deletions(-)
+
+commit f745e4ce64d772c40fa7622568f886984f5c7ce2
+Merge: 806f57e de239f3
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Nov 6 11:26:05 2013 -0800
+
+ Merge pull request #31 from hintjens/master
+
+ Backported fixes for libzmq-39 and other patches.
+
+commit de239f358e02c4d42a2c4426ffee893e101c90b2
+Author: Richard Newton <richard_newton@waters.com>
+Date: Wed Nov 6 15:19:04 2013 +0000
+
+ Fix race condition on shutdown
+
+ src/ctx.cpp | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+commit 30f470eff56d4b7f778cd83bda0ea689cf752a41
+Author: Richard Newton <richard_newton@waters.com>
+Date: Mon Oct 28 08:34:32 2013 +0000
+
+ Fix test warning.
+
+ tests/test_ctx_options.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit f0b69bba286dcd9689e40674a84cf1ab940a2d81
+Author: Richard Newton <richard_newton@waters.com>
+Date: Mon Oct 28 08:30:31 2013 +0000
+
+ Fix test warning.
+
+ tests/test_router_raw_empty.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit 60032ef3301316ef00e9bce4f34a9a22d075b83e
+Author: MinRK <benjaminrk@gmail.com>
+Date: Sun Oct 27 22:50:32 2013 -0700
+
+ test zmq_msg_close after sending empty message on ROUTER_RAW
+
+ tests/Makefile.am | 2 ++
+ tests/test_router_raw_empty.cpp | 65 +++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 67 insertions(+)
+
+commit c663f37761c7bebd0061061ede13a4e9aef5b6f4
+Author: MinRK <benjaminrk@gmail.com>
+Date: Sun Oct 27 22:50:04 2013 -0700
+
+ add missing msg->init for ROUTER_RAW with empty message
+
+ src/router.cpp | 2 ++
+ 1 file changed, 2 insertions(+)
+
+commit 806f57e7f6e93a4c3e333e63fab8cfc003a29368
+Merge: 28b7c99 b22c2e4
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Nov 4 08:44:38 2013 -0800
+
+ Merge pull request #30 from hintjens/master
+
+ Cherry picking fixes from libzmq
+
+commit b22c2e4f8a8c11bfbbe74c43134a481b3a90d104
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Nov 4 17:37:15 2013 +0100
+
+ Updated NEWS
+
+ NEWS | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+commit 54a3ebcac656d9451e7a3b59f092b1949c9e9ac7
+Author: Denis Mingulov <denis@mingulov.com>
+Date: Mon Nov 4 15:15:23 2013 +0200
+
+ Doc examples with zmq_msg_close usage - parameter is 'zmq_msg_t *'
+
+ Documentation examples for zmq_msg_get and zmq_msg_more functions have an
+ incorrect call to zmq_msg_close function - with 'zmq_msg_t' as a parameter
+ despite 'zmq_msg_t *' is required, so it is impossible to compile these
+ examples properly.
+
+ Also for zmq_msg_get example - declaration of zmq_msg_t variable is added
+ (like it is done in other examples).
+
+ doc/zmq_msg_get.txt | 3 ++-
+ doc/zmq_msg_more.txt | 2 +-
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+commit aede37e3e5913b6c8abdd286c2991f2784344140
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Nov 4 16:04:13 2013 +0100
+
+ Fixed issue 578 - corrected type usage
+
+ src/zmq_utils.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 2949f2dbc5c1e73ab50333fb4fae60852bf21c85
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Nov 4 15:39:20 2013 +0100
+
+ Fixed issue 578
+
+ .gitignore | 9 +++++++++
+ src/zmq_utils.cpp | 11 ++++++-----
+ 2 files changed, 15 insertions(+), 5 deletions(-)
+
+commit 28b7c991afe738a88d7f6d0340987898e06b0c7a
+Merge: c85fbaf 1c70e91
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Oct 28 03:58:52 2013 -0700
+
+ Merge pull request #28 from hintjens/master
+
+ Fixed configure error on non-Linux boxes
+
+commit 1c70e91c6f0db4418b4ff4eccf935af667ddbfeb
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Oct 28 11:58:29 2013 +0100
+
+ Fixed configure error on non-Linux boxes
+
+ tests/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit c85fbaf22e5f8ff79039ee2d87dd455484979b75
+Merge: cb3c822 b580557
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Oct 28 03:49:45 2013 -0700
+
+ Merge pull request #27 from hintjens/master
+
+ Fixed ref to zmq_socket_monitor
+
+commit b58055794bda1c25be7b7d9829f96913f1ce2758
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Oct 28 11:49:23 2013 +0100
+
+ Fixed ref to zmq_socket_monitor
+
+ NEWS | 2 +-
+ doc/zmq.txt | 6 +++---
+ tests/Makefile.am | 3 ---
+ 3 files changed, 4 insertions(+), 7 deletions(-)
+
+commit cb3c82271a7a34ab0ebe0d3353105ba2c14a2d35
+Merge: bf97ea8 9bf10a8
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Oct 25 01:04:06 2013 -0700
+
+ Merge pull request #26 from hintjens/master
+
+ Backporting fixes from master
+
+commit 9bf10a83a17a900640f4658a3ce9b695359a70ce
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Oct 25 10:03:42 2013 +0200
+
+ Updated NEWS
+
+ NEWS | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+commit 8efd7affc677cb9d40167137b27d99e9b670affc
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Oct 23 23:58:39 2013 +0200
+
+ test_stream failed when response was broken into frames
+
+ tests/test_stream.cpp | 13 ++++++-------
+ 1 file changed, 6 insertions(+), 7 deletions(-)
+
+commit bf97ea8ed8ecb5b3d13e7a0c7ace631437f7151e
+Merge: 2b8d86c cd2afeb
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Oct 23 07:04:20 2013 -0700
+
+ Merge pull request #25 from hintjens/master
+
+ Clarified use of secret/public keys
+
+commit cd2afebd0a0f9861f4d90282029822d94aa1c979
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Oct 23 16:03:45 2013 +0200
+
+ Clarified use of secret/public keys
+
+ doc/zmq_setsockopt.txt | 23 +++++++++++------------
+ 1 file changed, 11 insertions(+), 12 deletions(-)
+
+commit 2b8d86c24a092d8622643ea68830daa6477ee227
+Merge: 573d7b0 bd411bb
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Oct 23 03:05:44 2013 -0700
+
+ Merge pull request #24 from hintjens/master
+
+ Fixed man page for CURVE key options
+
+commit bd411bbf116d491e08eef9172dee1bc6786196e3
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Oct 23 12:04:50 2013 +0200
+
+ Fixed man page for CURVE key options
+
+ doc/zmq_setsockopt.txt | 24 ++++++++++++------------
+ 1 file changed, 12 insertions(+), 12 deletions(-)
+
+commit 573d7b0c0b8abd4a4e616d503f8a2c80a1ecaf40
+Merge: 07d7cf6 dcb9312
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Oct 13 23:05:54 2013 -0700
+
+ Merge pull request #23 from hintjens/master
+
+ Backporting LIBZMQ-569 fix from master
+
+commit dcb9312ba697b3dcb0912344f27d5665ced7d8a2
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Oct 14 08:04:57 2013 +0200
+
+ Updated NEWS for backport
+
+ NEWS | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+commit 54907946664d6eed2e12e7e9eda7de3f4d9f290f
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Fri Jun 21 16:23:38 2013 +0200
+
+ Load identity message to decoder at start
+
+ src/stream_engine.cpp | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+commit 07d7cf69d03635cb249fc01e082d68669b4f26a6
+Merge: 4f2ac39 b24db36
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Oct 13 05:47:11 2013 -0700
+
+ Merge pull request #22 from hintjens/master
+
+ Temporary workaround for broken libsodium install
+
+commit b24db360570c335b9f420b07574dd0c9873e6136
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Oct 13 14:46:08 2013 +0200
+
+ Temporary workaround for broken libsodium install
+
+ .travis.yml | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+commit 4f2ac39d2822c5d30554a56db4dbd58b7bb534d5
+Merge: 8cdff6f a32c02a
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Oct 11 03:12:27 2013 -0700
+
+ Merge pull request #21 from hintjens/master
+
+ Backporting fixes from master
+
+commit a32c02ae47484a6b60fb7895fb0b9ee39573fc10
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Oct 9 19:52:46 2013 +0200
+
+ Identity can only be set on sockets that can connect to ROUTER
+
+ doc/zmq_getsockopt.txt | 6 +++---
+ doc/zmq_setsockopt.txt | 2 +-
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+commit 622e3b54760a78d6f7d14cc5b1ceba99f3e690ad
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Thu Sep 26 09:37:04 2013 +0200
+
+ Rename engine's methods to improve code readability
+
+ src/i_engine.hpp | 4 ++--
+ src/pgm_receiver.cpp | 4 ++--
+ src/pgm_receiver.hpp | 4 ++--
+ src/pgm_sender.cpp | 4 ++--
+ src/pgm_sender.hpp | 4 ++--
+ src/session_base.cpp | 4 ++--
+ src/stream_engine.cpp | 34 +++++++++++++++++-----------------
+ src/stream_engine.hpp | 8 ++++----
+ 8 files changed, 33 insertions(+), 33 deletions(-)
+
+commit 6c036b39ae7de197473c43c5f8de79657b0e8ae6
+Author: xantares <xantares09@hotmail.com>
+Date: Thu Oct 10 22:08:54 2013 +0200
+
+ Fixed out-of-source build
+
+ tools/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 8cdff6fa2e06763bb430a04f4159135e558ca001
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Oct 8 17:54:41 2013 +0200
+
+ Fixed NEWS
+
+ NEWS | 3 ---
+ 1 file changed, 3 deletions(-)
+
+commit f8cebb460a94ddee613fd7f4ed23300f9cc790ba
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Oct 8 15:02:58 2013 +0200
+
+ Revert "replace macro constants with enum types for user facing constants"
+
+ This reverts commit 4fb74539250d83e82e40e85d39e2e756eccdb8a3.
+
+ include/zmq.h | 222 ++++++++++++++++++++++++++-------------------------------
+ 1 file changed, 101 insertions(+), 121 deletions(-)
+
+commit d62e7a0734b7a69e199bfa22209275ab5da7a639
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Oct 8 15:02:47 2013 +0200
+
+ Revert "distinguish between options and defaults"
+
+ This reverts commit e7db680f5b709ce821f79b1e8956f4cbd1931c11.
+
+ include/zmq.h | 9 ++-------
+ 1 file changed, 2 insertions(+), 7 deletions(-)
+
+commit a44bd65d03f1d6a79bf818584c0ae37ef46478d4
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Oct 8 10:46:47 2013 +0200
+
+ Fixed NEWS for 4.0.1 release
+
+ NEWS | 28 ++++++++++++++++------------
+ 1 file changed, 16 insertions(+), 12 deletions(-)
+
+commit 437e4070a37367a4d6c272b4c39ea9b92c31c2b3
+Merge: c852620 0bfcd4d
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Oct 8 01:36:58 2013 -0700
+
+ Merge pull request #19 from hintjens/master
+
+ Updated NEWS for 4.0.1
+
+commit 0bfcd4da2f50c215836c878d00175e73e6fa4d46
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Oct 8 10:33:50 2013 +0200
+
+ Updated NEWS for 4.0.1
+
+ NEWS | 33 ++++++++++++++++++++++++++++++---
+ 1 file changed, 30 insertions(+), 3 deletions(-)
+
+commit c852620f5f33d50698817be0b66f85fbc7ac59a3
+Merge: 163aebb ca122e9
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Oct 8 00:20:40 2013 -0700
+
+ Merge pull request #18 from hintjens/master
+
+ Cherry picking changes from libzmq master
+
+commit ca122e9d01f44194bb2a107ed1f8275a0b17c319
+Author: Volodymyr Korniichuk <9173519@gmail.com>
+Date: Tue Oct 8 00:40:30 2013 +0300
+
+ Typo in type name "emTPy_slots_t"
+
+ https://zeromq.jira.com/browse/LIBZMQ-565
+
+ src/ctx.hpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit e7db680f5b709ce821f79b1e8956f4cbd1931c11
+Author: Dylan Cali <calid1984@gmail.com>
+Date: Fri Oct 4 02:19:07 2013 -0500
+
+ distinguish between options and defaults
+
+ include/zmq.h | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+commit 4fb74539250d83e82e40e85d39e2e756eccdb8a3
+Author: Dylan Cali <calid1984@gmail.com>
+Date: Fri Oct 4 01:45:42 2013 -0500
+
+ replace macro constants with enum types for user facing constants
+
+ include/zmq.h | 222 +++++++++++++++++++++++++++++++--------------------------
+ 1 file changed, 121 insertions(+), 101 deletions(-)
+
+commit 813166019e1c6955776ff3fab1918b1b4b4c5445
+Author: Brandon Carpenter <brandon.carpenter@pnnl.gov>
+Date: Mon Oct 7 10:55:40 2013 -0700
+
+ Add tests/test_abstract_ipc to .gitignore.
+
+ .gitignore | 1 +
+ 1 file changed, 1 insertion(+)
+
+commit 127cd7585a992a2f9a2a30c172f624fd2dc1196e
+Author: Brandon Carpenter <brandon.carpenter@pnnl.gov>
+Date: Mon Oct 7 10:42:39 2013 -0700
+
+ Fix detection of abstract ipc pathname and length calculation.
+
+ Abstract socket pathnames must have a NULL character in the first
+ position, but the second character must also be checked to differentiate
+ an abstract name from the empty string. The address length must also
+ indicate the length of the pathname because the kernel uses the entire
+ address as the name, including NULL characters. ZMQ uses
+ NULL-terminated strings for the address, so the abstract address length
+ is the length of the string following the initial NULL byte plus 3; two
+ bytes for the address family and one for the initial NULL character.
+
+ src/ipc_address.cpp | 19 +++++++++++++++----
+ 1 file changed, 15 insertions(+), 4 deletions(-)
+
+commit 0666152b216fe20e54c082461924e034af2efd11
+Author: Brandon Carpenter <brandon.carpenter@pnnl.gov>
+Date: Mon Oct 7 10:41:20 2013 -0700
+
+ Add note on Linux abstract namespace to ipc documentation.
+
+ doc/zmq_ipc.txt | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+commit 9293153f71e7fa9c34eecb3951fc08f71c9630bb
+Author: Volodymyr Korniichuk <VolodymyrKorn@gmail.com>
+Date: Fri Oct 4 21:54:52 2013 +0300
+
+ useless checks were removed
+
+ src/ctx.cpp | 6 ++----
+ src/mtrie.cpp | 3 +--
+ src/session_base.cpp | 3 +--
+ src/stream_engine.cpp | 9 +++------
+ src/trie.cpp | 3 +--
+ src/yqueue.hpp | 6 ++----
+ 6 files changed, 10 insertions(+), 20 deletions(-)
+
+commit 163aebbacfc904bf5b29454a641ddb7a597b3552
+Merge: b20573c 80d657a
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sat Oct 5 00:20:49 2013 -0700
+
+ Merge pull request #17 from hintjens/master
+
+ Cherry picking changes from libzmq master
+
+commit 80d657a2c529a1d847eab4cf6285c2279aae208c
+Author: Brandon Carpenter <brandon.carpenter@pnnl.gov>
+Date: Thu Oct 3 16:35:30 2013 -0700
+
+ Add test for abstract namespace support in ipc sockets on Linux.
+
+ See issue 567.
+
+ configure.ac | 3 +++
+ tests/Makefile.am | 8 +++++-
+ tests/test_abstract_ipc.cpp | 57 +++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 67 insertions(+), 1 deletion(-)
+
+commit 668f000cb148ee9e06b90d3b0b9504a16a3e7c52
+Author: Brandon Carpenter <brandon.carpenter@pnnl.gov>
+Date: Thu Oct 3 16:21:42 2013 -0700
+
+ Add abstract namespace support for IPC sockets on Linux.
+
+ Converts an initial strudel or "at sign" (@) in the Unix socket path to
+ a NULL character ('\0') indicating that the socket uses the abstract
+ namespace instead of the filesystem namespace. For instance, binding a
+ socket to 'ipc://@/tmp/tester' will not create a file associated with
+ the socket whereas binding to 'ipc:///tmp/tester' will create the file
+ /tmp/tester. See issue 567 for more information.
+
+ AUTHORS | 1 +
+ src/ipc_address.cpp | 12 ++++++++++++
+ 2 files changed, 13 insertions(+)
+
+commit a570b18931b52ac1d4b26eef88fe7dc630a4d192
+Author: KIU Shueng Chuan <nixchuan@gmail.com>
+Date: Sat Oct 5 00:51:47 2013 +0800
+
+ WinSock2.h filename should be all lowercase
+
+ tests/test_system.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 5493d4d180924f67c755e2c44d615910b25402ce
+Author: KIU Shueng Chuan <nixchuan@gmail.com>
+Date: Sat Oct 5 00:48:52 2013 +0800
+
+ test for _MSC_VER before using MSVC specific code
+
+ tests/testutil.hpp | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+commit b20573c8412f822cde267d93cccb981815251501
+Merge: 34471cd 814b93e
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Oct 4 00:19:57 2013 -0700
+
+ Merge pull request #16 from hintjens/master
+
+ Cherry picking changes from libzmq master
+
+commit 814b93e0cff2e2437c6b33b2bcb007ad79ad42ee
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Fri Oct 4 08:20:55 2013 +0200
+
+ Stop curve handshake when cookie box verification fails
+
+ src/curve_server.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit d723b08c134e5f07897c48aaa99fc0b7b2afff02
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Sep 24 15:31:10 2013 +0200
+
+ Updated libzmq CURVE to track RFC 27
+
+ * The INITIATE command vouch box is Box[C',S](C->S') instead of Box[C'](C->S),
+ as recommended by https://codesinchaos.wordpress.com/2012/09/09/curvecp-1/,
+ to reduce the risk of client impersonation.
+
+ * Mirrors the change in libcurve and CurveZMQ specifications.
+
+ src/curve_client.cpp | 25 ++++++++++++++-----------
+ src/curve_server.cpp | 26 ++++++++++++--------------
+ 2 files changed, 26 insertions(+), 25 deletions(-)
+
+commit 62fd6fa8614f86a25ab9f4b2a3fab548c7eb6eaa
+Author: Matt Connolly <matt.connolly@me.com>
+Date: Tue Sep 24 08:07:10 2013 +1000
+
+ git ignore test run output files: tests/test*.{log|trs}
+
+ .gitignore | 2 ++
+ 1 file changed, 2 insertions(+)
+
+commit a78ccf293fbef3d18e05e904a78d54bb7b2d7e0c
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Oct 2 12:15:31 2013 +0200
+
+ Disabled randomly failing part of test
+
+ tests/test_spec_rep.cpp | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+commit d82ba6bd534e20fbad35bae1e8504624967e02fb
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Oct 2 12:05:14 2013 +0200
+
+ Clarified that zmq.h constants are part of the public contract
+
+ include/zmq.h | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+commit 9da52ddf59127858e89f5c6ca7e54dcd1c769f1e
+Author: Dylan Cali <calid1984@gmail.com>
+Date: Wed Oct 2 02:59:44 2013 -0500
+
+ fix minor typo in zmq_ctx_get doc example
+
+ doc/zmq_ctx_get.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit a69fa9ecde029db8052cc2df94e4f7ae1eca26ba
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Sep 30 15:14:02 2013 +0200
+
+ Packaging for zmq_curve_keypair function
+
+ * Added new man page for this
+ * Added test case, in tests/test_security_curve.cpp
+ * Noted in zmq_utils.h that these methods are documented
+
+ doc/Makefile.am | 2 +-
+ doc/zmq.txt | 9 +++++++
+ doc/zmq_curve_keypair.txt | 56 +++++++++++++++++++++++++++++++++++++++++
+ doc/zmq_z85_decode.txt | 2 +-
+ doc/zmq_z85_encode.txt | 1 +
+ include/zmq_utils.h | 24 ++++++++++--------
+ tests/test_security_curve.cpp | 24 ++++++++++++------
+ 7 files changed, 98 insertions(+), 20 deletions(-)
+
+commit facb96ffca8a6ef505348ba449dd447ba2dcb52e
+Author: MinRK <benjaminrk@gmail.com>
+Date: Sun Sep 29 13:05:27 2013 -0700
+
+ use zmq_curve_keypair in curve_keygen
+
+ tools/curve_keygen.c | 34 ++++++++++++----------------------
+ 1 file changed, 12 insertions(+), 22 deletions(-)
+
+commit 3c469d04c1e4879610fae795046c7373abdabd2a
+Author: MinRK <benjaminrk@gmail.com>
+Date: Sun Sep 29 13:07:51 2013 -0700
+
+ return NULL and set EINVAL on bad z85 input
+
+ asserts aren't appropriate for checking user input.
+
+ src/zmq_utils.cpp | 13 +++++++++++--
+ 1 file changed, 11 insertions(+), 2 deletions(-)
+
+commit 870233522c4be1202ba2ed333f32d1c2738698d4
+Author: MinRK <benjaminrk@gmail.com>
+Date: Sun Sep 29 13:02:39 2013 -0700
+
+ add zmq_curve_keypair to zmq_utils
+
+ include/zmq_utils.h | 4 ++++
+ src/zmq_utils.cpp | 37 ++++++++++++++++++++++++++++++++++++-
+ 2 files changed, 40 insertions(+), 1 deletion(-)
+
+commit 34471cd59110d5adb9d428a93db3df45ae9a4ec8
+Merge: 17d12a6 453ceb6
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Sep 29 08:04:10 2013 -0700
+
+ Merge pull request #12 from hintjens/master
+
+ Backporting fixes from master
+
+commit 453ceb65b4a5e47fd8afe01035fda6b71512addb
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Sep 29 17:03:44 2013 +0200
+
+ Fixed merge conflict error
+
+ configure.ac | 1 -
+ 1 file changed, 1 deletion(-)
+
+commit 4d82544c34990423a2195385b6a7d0cdb2c0abc0
+Author: Matt Connolly <matt.connolly@me.com>
+Date: Sun Sep 29 21:19:50 2013 +1000
+
+ config for libsodium in alternate path, using CPP flags for both C and C++ sources.
+
+ configure.ac | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit bd6bca7c8209a5503eee1e2dba07c4674058e66a
+Author: MinRK <benjaminrk@gmail.com>
+Date: Sat Sep 28 15:42:52 2013 -0700
+
+ include missing platform.hpp in curve_keygen
+
+ it was excluded, so HAVE_SODIUM would never be defined,
+ leading to curve_keygen always reporting "recompile with libsodium"
+
+ tools/curve_keygen.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+commit 087ddac593570b8efb115d592318bafe7b6748e3
+Author: MinRK <benjaminrk@gmail.com>
+Date: Sat Sep 28 15:42:00 2013 -0700
+
+ declare z85_encode / decode in zmq_utils
+
+ they are used by curve_keygen, but not available
+
+ include/zmq_utils.h | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+commit d1b686b644f834b319378d65935a23a59c997b5c
+Author: Matt Connolly <matt.connolly@me.com>
+Date: Fri Sep 27 11:20:09 2013 +0000
+
+ Disable compiler warning for Solaris
+
+ configure.ac | 1 +
+ 1 file changed, 1 insertion(+)
+
+commit 4dc36c0dba23c93703450ad73ecbd0587d772e31
+Author: Matt Connolly <matt.connolly@me.com>
+Date: Fri Sep 27 11:12:16 2013 +0000
+
+ Add '-lssp' linker flag for Solaris. Check for libraries after host specific setup.
+
+ configure.ac | 50 ++++++++++++++++++++++++++++++++++++++++++++++----
+ 1 file changed, 46 insertions(+), 4 deletions(-)
+
+commit 17d12a6be192210f0c67b50eda024a1b65a81d69
+Merge: cd452d5 89b97cb
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Sep 26 05:48:49 2013 -0700
+
+ Merge pull request #9 from hintjens/master
+
+ Cherry picking changes from libzmq master
+
+commit 89b97cbe5955d3fd34734656f9a589968d90189c
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Sep 26 14:32:47 2013 +0200
+
+ Updated CMake project for test_issue_566
+
+ CMakeLists.txt | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+commit b0059211d53f9d7919fe461c681cee0f0c9ecdbe
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Sep 26 14:18:40 2013 +0200
+
+ Added test case for issue 566
+
+ * Tests dealer-to-router connection 100 times
+ * This was failing in ZMQ v4.0.0 RC1
+
+ .gitignore | 1 +
+ src/stream_engine.cpp | 2 +-
+ tests/Makefile.am | 4 ++-
+ tests/test_issue_566.cpp | 85 ++++++++++++++++++++++++++++++++++++++++++++++
+ 4 files changed, 90 insertions(+), 2 deletions(-)
+
+commit cd452d501967d6d753ed132305252970d9608436
+Merge: 9cbcc49 dd185e1
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Sep 26 03:32:10 2013 -0700
+
+ Merge pull request #8 from hintjens/master
+
+ Backporting fixes from master
+
+commit dd185e13bf0e502e38412cc712717ce2bc771302
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Sep 26 12:31:43 2013 +0200
+
+ Bumped version for 4.0.1
+
+ NEWS | 13 +++++++++++++
+ include/zmq.h | 2 +-
+ 2 files changed, 14 insertions(+), 1 deletion(-)
+
+commit 517601de10450635fd9d6cef5f7a8d9ef88a6a56
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Sep 26 11:35:52 2013 +0200
+
+ curve_keygen needed assert.h
+
+ tools/curve_keygen.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+commit 5e25b32c3679752b40c7a7aa0d25c83150b688d1
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Sep 26 11:33:44 2013 +0200
+
+ Build/test errors on OS/X with clang++
+
+ src/options.cpp | 2 +-
+ tests/test_stream.cpp | 1 -
+ 2 files changed, 1 insertion(+), 2 deletions(-)
+
+commit a5152245bdd39caa747ae7f38374faa945cb51ed
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Thu Sep 26 09:38:09 2013 +0200
+
+ Call flush after writing the identity message
+
+ src/stream_engine.cpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+commit 9cbcc49a4acee8d84890f70698b8233debefb1cf
+Merge: 2d5bad9 8a931a7
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Sep 24 03:32:02 2013 -0700
+
+ Merge pull request #6 from ipechorin/master
+
+ stdint.h is not available on all platforms
+
+commit 2d5bad96e3c4b1bc5dd9cd822afca5b4e6f01ce5
+Merge: b04df2c c99b727
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Sep 24 03:31:08 2013 -0700
+
+ Merge pull request #7 from hintjens/master
+
+ Fixed build for MSVC 2008
+
+commit c99b727f6dbbc8fdfa70d1ca2a5ca538601805a1
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Sep 24 12:29:29 2013 +0200
+
+ Fixed build for MSVC 2008
+
+ include/zmq_utils.h | 15 ++++++++++++++-
+ 1 file changed, 14 insertions(+), 1 deletion(-)
+
+commit 8a931a7554931d9a387edaa07fd76b5d41257b1e
+Author: Ivan Pechorin <ivan.pechorin@gmail.com>
+Date: Tue Sep 24 14:00:08 2013 +0400
+
+ stdint.h is not available on all platforms
+
+ include/zmq.h | 3 +++
+ include/zmq_utils.h | 1 -
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+commit b04df2c5309f049202c4f7da78258e3f4fb5432a
+Merge: ad1bae2 4df7cb0
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Sep 24 00:12:03 2013 -0700
+
+ Merge pull request #4 from hintjens/master
+
+ Updated library ABI version
+
+commit 4df7cb043e3649550de7fadbc53635056fb2f4ed
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Sep 24 09:11:17 2013 +0200
+
+ Bumped library version and age
+
+ configure.ac | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+commit 201454e8660477fd683aa29d9dadc379c60f5c5a
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Sep 20 23:17:01 2013 +0200
+
+ Move away from port 8080 which is occupied on some boxes
+
+ tests/test_stream.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit ad1bae21608710e3f85253f9ad7fb4ecf1431fc8
+Merge: 61d8bf9 77f394a
+Author: Richard Newton <richard_newton@waters.com>
+Date: Fri Sep 20 12:48:29 2013 -0700
+
+ Merge pull request #3 from vortechs2000/fix_aix
+
+ Revert "Reference platform.h by ../src/platform.h - AIX is ignoring -I flags"
+
+commit 77f394a6813fcf238eb44c9c320116f9921fd1f7
+Author: AJ Lewis <aj.lewis@quantum.com>
+Date: Fri Sep 20 14:39:01 2013 -0500
+
+ Revert "Reference platform.h by ../src/platform.h - AIX is ignoring -I flags"
+
+ This reverts commit 1e8e4d79c885b27831e2196d94987cc2817e0f04.
+
+ perf/inproc_lat.cpp | 3 +--
+ perf/inproc_thr.cpp | 3 +--
+ tests/testutil.hpp | 3 +--
+ 3 files changed, 3 insertions(+), 6 deletions(-)
+
+commit 61d8bf9b11e11cfd49302d850dacb5feda33b4aa
+Merge: c0c8ce5 1e8e4d7
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Sep 20 09:54:03 2013 -0700
+
+ Merge pull request #2 from vortechs2000/fix_aix
+
+ Reference platform.h by ../src/platform.h - AIX is ignoring -I flags
+
+commit 1e8e4d79c885b27831e2196d94987cc2817e0f04
+Author: AJ Lewis <aj.lewis@quantum.com>
+Date: Fri Sep 20 11:43:53 2013 -0500
+
+ Reference platform.h by ../src/platform.h - AIX is ignoring -I flags
+
+ perf/inproc_lat.cpp | 3 ++-
+ perf/inproc_thr.cpp | 3 ++-
+ tests/testutil.hpp | 3 ++-
+ 3 files changed, 6 insertions(+), 3 deletions(-)
+
+commit c0c8ce550888272b155400457661e8315546822f
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Sep 20 16:41:08 2013 +0200
+
+ File was missing from Makefile.am
+
+ src/Makefile.am | 1 +
+ 1 file changed, 1 insertion(+)
+
+commit 66b1bc6d7f3e04df298270c10f16bf07cc7ef326
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Sep 20 16:15:53 2013 +0200
+
+ Added link to security tutorial
+
+ NEWS | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit f5ecc826d963d72affb8cf79c6fd279662fd4b7a
+Merge: 8f0a757 a31fe95
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Sep 20 07:06:48 2013 -0700
+
+ Merge pull request #1 from hintjens/master
+
+ Preparation for 4.0.0 release
+
+commit a31fe9565aa26d73aa4d8bbb0091552056cb5751
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Sep 20 16:03:14 2013 +0200
+
+ Source distribution was broken
+
+ src/Makefile.am | 1 -
+ tools/Makefile.am | 2 +-
+ 2 files changed, 1 insertion(+), 2 deletions(-)
+
+commit 2f4905500d862bb9f0f3871c367d67fb020384b0
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Sep 20 16:02:55 2013 +0200
+
+ Version number is 4.0.0
+
+ include/zmq.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit c10a3ec526a0cc226ad64b74fed6c1b3b04b8daa
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Sep 20 15:53:27 2013 +0200
+
+ Updated NEWS for 4.0.0
+
+ NEWS | 111 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
+ 1 file changed, 109 insertions(+), 2 deletions(-)
+
+commit e0676a2b26c5b215d07061c8b6606b12a9e0c961
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Sep 20 15:30:04 2013 +0200
+
+ Renamed new socket options to be clearer
+
+ * ZMQ_REQ_STRICT was negative option (default 1) which goes against
+ the standard, where defaults are zero. I renamed this to
+ ZMQ_REQ_RELAXED.
+
+ * ZMQ_REQ_REQUEST_IDS felt clumsy and describes the technical solution
+ rather than the problem/requirement. I changed to ZMQ_REQ_CORRELATE
+ which seems more explicit.
+
+ .gitignore | 4 +-
+ CMakeLists.txt | 4 +-
+ doc/zmq_getsockopt.txt | 4 +-
+ doc/zmq_setsockopt.txt | 26 +++---
+ include/zmq.h | 4 +-
+ src/req.cpp | 6 +-
+ tests/Makefile.am | 8 +-
+ tests/test_req_correlate.cpp | 177 ++++++++++++++++++++++++++++++++++++++++
+ tests/test_req_relaxed.cpp | 116 ++++++++++++++++++++++++++
+ tests/test_req_request_ids.cpp | 177 ----------------------------------------
+ tests/test_req_strict.cpp | 117 --------------------------
+ 11 files changed, 321 insertions(+), 322 deletions(-)
+
+commit b411a3561d2f9f2de29bf42820ca4d408b602107
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Sep 20 14:39:35 2013 +0200
+
+ Removed inaccurate note in zmq_poll man page
+
+ doc/zmq_poll.txt | 4 ----
+ 1 file changed, 4 deletions(-)
+
+commit 4ce9b4240596f3146a15c97d11f5a3068a805883
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Sep 20 14:28:06 2013 +0200
+
+ Built zmq_send_const man page properly
+
+ doc/Makefile.am | 2 +-
+ doc/zmq.txt | 1 +
+ doc/zmq_send_const.txt | 2 +-
+ 3 files changed, 3 insertions(+), 2 deletions(-)
+
+commit fef4fa8fc54eb267575e534bff35cd0009485d26
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Sep 20 14:23:43 2013 +0200
+
+ Renamed test_connect_delay to test_immediate
+
+ * The ZMQ_CONNECT_DELAY option was renamed to ZMQ_IMMEDIATE
+
+ .gitignore | 2 +-
+ CMakeLists.txt | 2 +-
+ tests/Makefile.am | 4 +-
+ tests/test_connect_delay.cpp | 229 ------------------------------------------
+ tests/test_immediate.cpp | 229 ++++++++++++++++++++++++++++++++++++++++++
+ 5 files changed, 233 insertions(+), 233 deletions(-)
+
+commit 4298f71cbf94cf391a9b6f6e6bc9971843f06bd6
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Sep 20 13:28:25 2013 +0200
+
+ Updated NEWS for 3.2.x releases
+
+ NEWS | 37 ++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 36 insertions(+), 1 deletion(-)
+
+commit 8f0a757f08f66688ccffdc43ca01b9d07464f032
+Merge: 90867a4 78cabfe
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Sep 19 06:09:13 2013 -0700
+
+ Merge pull request #671 from ricnewton/master
+
+ Testing github jenkins integration
+
+commit 78cabfe8eabd252cd7a75a6a2b8af8ef1552dd51
+Author: Richard Newton <richard_newton@waters.com>
+Date: Thu Sep 19 12:58:58 2013 +0100
+
+ More testing github jenkins integration
+
+ AUTHORS | 1 -
+ 1 file changed, 1 deletion(-)
+
+commit d503e19381e96d7cf0a07d78b33cdb55c880cac4
+Merge: 544575d 90867a4
+Author: Richard Newton <richard_newton@waters.com>
+Date: Thu Sep 19 12:37:54 2013 +0100
+
+ Merge branch 'master' of https://github.com/zeromq/libzmq
+
+commit 544575d18ca4c81827c0becb8fa27c03e78f64bf
+Author: Richard Newton <richard_newton@waters.com>
+Date: Thu Sep 19 12:28:21 2013 +0100
+
+ Revert "More testing github jenkins integratio"
+
+ This reverts commit 0640d6d2baa014ad93ba57ad2f692af8f9081eb0.
+
+ AUTHORS | 1 +
+ 1 file changed, 1 insertion(+)
+
+commit 0640d6d2baa014ad93ba57ad2f692af8f9081eb0
+Author: Richard Newton <richard_newton@waters.com>
+Date: Thu Sep 19 12:11:50 2013 +0100
+
+ More testing github jenkins integratio
+
+ AUTHORS | 1 -
+ 1 file changed, 1 deletion(-)
+
+commit 575ff39bfe6b9c51b159e1e10d7881c017ef7d62
+Author: Richard Newton <richard_newton@waters.com>
+Date: Thu Sep 19 12:02:17 2013 +0100
+
+ Testing github jenkins integration
+
+ AUTHORS | 1 +
+ 1 file changed, 1 insertion(+)
+
+commit 90867a4e8f23c9a360c7b276b93521b1a61b7866
+Merge: 39de9be 7a747b5
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Sep 19 02:42:31 2013 -0700
+
+ Merge pull request #670 from ricnewton/master
+
+ Fix cmake build
+
+commit 7a747b5797e4976012cfe1f96f44e224b5f643f0
+Author: Richard Newton <richard_newton@waters.com>
+Date: Thu Sep 19 09:46:26 2013 +0100
+
+ Fix cmake build
+
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 39de9bebcb53ad08f745c29befe8e13c88c0cf57
+Merge: de91c73 e055560
+Author: Richard Newton <richard_newton@waters.com>
+Date: Thu Sep 19 00:43:49 2013 -0700
+
+ Merge pull request #669 from hintjens/master
+
+ Renamed inproc connect test (name was too long)
+
+commit e05556075f446c1b5004e6854a157648fe077f8b
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Sep 19 09:36:43 2013 +0200
+
+ Renamed inproc connect test (name was too long)
+
+ .gitignore | 3 +-
+ tests/Makefile.am | 4 +-
+ tests/test_inproc_connect.cpp | 339 +++++++++++++++++++++++++++++
+ tests/test_inproc_connect_before_bind.cpp | 339 -----------------------------
+ 4 files changed, 342 insertions(+), 343 deletions(-)
+
+commit de91c7362cd6ca64a1a964b126658768c45e2814
+Merge: 94c98ab b132305
+Author: Richard Newton <richard_newton@waters.com>
+Date: Wed Sep 18 04:09:51 2013 -0700
+
+ Merge pull request #668 from mrothe/no-public-tests
+
+ tests: don't listen on public ports
+
+commit 94c98abba3cfcdbd1127840e7ba5a06d63d467af
+Merge: dc79171 825052f
+Author: Richard Newton <richard_newton@waters.com>
+Date: Wed Sep 18 04:07:35 2013 -0700
+
+ Merge pull request #667 from hintjens/master
+
+ Reverted pull request 666
+
+commit b13230510ceced26f2dd6ee4707d9403f645da15
+Author: Markus Rothe <markus@unixforces.net>
+Date: Wed Sep 18 12:58:19 2013 +0200
+
+ tests: don't listen on public ports
+
+ tests/test_connect_delay.cpp | 8 ++++----
+ tests/test_disconnect_inproc.cpp | 2 +-
+ tests/test_probe_router.cpp | 2 +-
+ tests/test_req_request_ids.cpp | 2 +-
+ tests/test_req_strict.cpp | 2 +-
+ tests/test_security_curve.cpp | 2 +-
+ tests/test_security_null.cpp | 12 ++++++------
+ tests/test_security_plain.cpp | 2 +-
+ tests/test_spec_dealer.cpp | 2 +-
+ tests/test_spec_pushpull.cpp | 2 +-
+ tests/test_spec_rep.cpp | 2 +-
+ tests/test_spec_req.cpp | 2 +-
+ tests/test_spec_router.cpp | 2 +-
+ tests/test_stream.cpp | 4 ++--
+ 14 files changed, 23 insertions(+), 23 deletions(-)
+
+commit 825052f83fd32179d0c52478ae4eb9266e2c4a6b
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Sep 17 14:05:55 2013 +0200
+
+ Revert "makes curve keys symetric as in libcurve + factorisation"
+
+ This reverts commit bfd472f97cad5e37fa384b687a906f515600bac4.
+
+ include/zmq.h | 21 +++-----
+ src/curve_client.cpp | 54 +++++++++----------
+ src/curve_client.hpp | 30 +++++------
+ src/curve_server.cpp | 54 +++++++++----------
+ src/curve_server.hpp | 20 +++----
+ src/options.cpp | 120 ++++++++++++++++++++++++-----------------
+ src/options.hpp | 10 ++--
+ tests/test_security_curve.cpp | 37 ++++++-------
+ 8 files changed, 178 insertions(+), 168 deletions(-)
+
+commit 22eb4d600b237cee894c7f32c6cdc8d5594fb9e3
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Sep 17 14:05:41 2013 +0200
+
+ Revert "oblige the application to explicitely set the node type for PLAIN"
+
+ This reverts commit 1206f4572b4b3bb405a14cc60605b75d53b819a0.
+
+ include/zmq.h | 4 ++--
+ src/options.cpp | 16 +++++++++-------
+ tests/test_security_curve.cpp | 4 ++--
+ tests/test_security_plain.cpp | 9 +++------
+ 4 files changed, 16 insertions(+), 17 deletions(-)
+
+commit 9e66685c0874210cbd74eb4a4c1283f249863973
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Sep 17 13:33:24 2013 +0200
+
+ Reformatted text
+
+ doc/zmq_setsockopt.txt | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+commit dc79171fc37597613c827f5ab00aa71fee3d2ac9
+Merge: ad0b325 1206f45
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Sep 17 04:32:45 2013 -0700
+
+ Merge pull request #666 from lalebarde/master
+
+ curve key names as in libcurve, symetry design, a few logic improvements
+
+commit 1206f4572b4b3bb405a14cc60605b75d53b819a0
+Author: Laurent Alebarde <l.alebarde@free.fr>
+Date: Tue Sep 17 12:47:21 2013 +0200
+
+ oblige the application to explicitely set the node type for PLAIN
+
+ include/zmq.h | 4 ++--
+ src/options.cpp | 16 +++++++---------
+ tests/test_security_curve.cpp | 4 ++--
+ tests/test_security_plain.cpp | 9 ++++++---
+ 4 files changed, 17 insertions(+), 16 deletions(-)
+
+commit bfd472f97cad5e37fa384b687a906f515600bac4
+Author: Laurent Alebarde <l.alebarde@free.fr>
+Date: Tue Sep 17 12:44:14 2013 +0200
+
+ makes curve keys symetric as in libcurve + factorisation
+
+ include/zmq.h | 21 +++++---
+ src/curve_client.cpp | 54 +++++++++----------
+ src/curve_client.hpp | 30 +++++------
+ src/curve_server.cpp | 54 +++++++++----------
+ src/curve_server.hpp | 20 +++----
+ src/options.cpp | 120 +++++++++++++++++------------------------
+ src/options.hpp | 10 ++--
+ tests/test_security_curve.cpp | 37 +++++++------
+ 8 files changed, 168 insertions(+), 178 deletions(-)
+
+commit ad0b325e4a0f172438700d933b8bcaee7caf4d73
+Merge: 67013f1 7bb2b6a
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Tue Sep 17 01:53:59 2013 -0700
+
+ Merge pull request #665 from hintjens/master
+
+ Added test case for NULL domains
+
+commit 7bb2b6ae11cafd241a6007bb2d564d4765ff8cf9
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Sep 17 10:04:57 2013 +0200
+
+ Fixed length of domain setting
+
+ tests/test_security_null.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 7735ca5f8dcc98f71e24ca15c980fd6e2715c036
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Sep 17 09:48:32 2013 +0200
+
+ Added test case for NULL domains
+
+ tests/test_security_null.cpp | 90 +++++++++++++++++++++++++++++++-----------
+ 1 file changed, 67 insertions(+), 23 deletions(-)
+
+commit 67013f19f6fd37c1abe9cc89102e7bb38628ebea
+Merge: 971b275 321a8ff
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Mon Sep 16 06:20:21 2013 -0700
+
+ Merge pull request #664 from hintjens/master
+
+ NULL mechanism was not dealing with ZAP denials properly
+
+commit 321a8ffea91583535a7cddf7b970cff7f9414b4c
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Sep 16 15:09:55 2013 +0200
+
+ NULL mechanism was not dealing with ZAP denials properly
+
+ src/null_mechanism.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+commit 971b275f7acc3573575f5375453dd2a93e2605fd
+Merge: 276cd1f fe9815a
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Mon Sep 16 02:04:44 2013 -0700
+
+ Merge pull request #663 from hintjens/master
+
+ Fixed random failures in test_security_plain and _curve
+
+commit fe9815a7892404deef3989d9ff35a9e78935bc83
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Sep 16 10:56:49 2013 +0200
+
+ Fixed random failures in test_security_plain and _curve
+
+ * ZAP handler thread was not getting time to start up
+ * Code now creates and binds handler socket in parent thread and
+ passes the socket to the zap_handler, so this always gets the
+ authentication requests.
+
+ tests/test_security_curve.cpp | 55 ++++++++++++++++++++---------------------
+ tests/test_security_null.cpp | 45 +++++++++++++++++----------------
+ 2 files changed, 49 insertions(+), 51 deletions(-)
+
+commit 276cd1f1dae6e1404a143edfe7e1323314224e16
+Merge: fbe1b79 6f35100
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Sep 16 01:32:55 2013 -0700
+
+ Merge pull request #662 from ricnewton/master
+
+ Fix windows build
+
+commit 6f351007d4a710207ad4730923add9635873af11
+Author: Richard Newton <richard_newton@waters.com>
+Date: Mon Sep 16 09:23:47 2013 +0100
+
+ Fix windows build
+
+ tests/testutil.hpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit fbe1b79188eb45deaa67a95e9a21a62a52e54b7e
+Merge: d76f3f7 dc1f5e9
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Sep 15 15:36:00 2013 -0700
+
+ Merge pull request #661 from lalebarde/master
+
+ simplify test_security_curve.cpp with zmq_z85_encode
+
+commit dc1f5e9f7c0c2331b0eb5edc487b711f257bc89b
+Author: Laurent Alebarde <l.alebarde@free.fr>
+Date: Mon Sep 16 00:06:24 2013 +0200
+
+ simplify test_security_curve.cpp with zmq_z85_encode
+
+ tests/test_security_curve.cpp | 35 +----------------------------------
+ 1 file changed, 1 insertion(+), 34 deletions(-)
+
+commit d76f3f7c036d02e7ac36d444bec471425cd36d5c
+Merge: 5c7b392 576e3ca
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Sun Sep 15 11:37:16 2013 -0700
+
+ Merge pull request #660 from hintjens/master
+
+ Added z85 codec to ZMQ API
+
+commit 576e3ca5e0f0d67f673e1ef30ec1071d19cb6b3a
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Sep 15 20:07:33 2013 +0200
+
+ Added z85 codec to ZMQ API
+
+ * Removed redundant Z85 code and include files from project
+ * Simplified use of headers in test cases (now they all just use testutil.hpp)
+ * Export zmq_z85_encode() and zmq_z85_decode() in API
+ * Added man pages for these two functions
+
+ doc/Makefile.am | 3 +-
+ doc/zmq_curve.txt | 2 +
+ doc/zmq_z85_decode.txt | 50 +++++++++++++
+ doc/zmq_z85_encode.txt | 56 +++++++++++++++
+ include/zmq.h | 6 ++
+ include/zmq_utils.h | 5 ++
+ src/Makefile.am | 1 -
+ src/options.cpp | 14 ++--
+ src/z85_codec.hpp | 109 -----------------------------
+ src/zmq_utils.cpp | 91 ++++++++++++++++++++++--
+ tests/test_conflate.cpp | 2 -
+ tests/test_connect_delay.cpp | 6 --
+ tests/test_connect_resolve.cpp | 3 -
+ tests/test_ctx_destroy.cpp | 3 -
+ tests/test_ctx_options.cpp | 2 -
+ tests/test_disconnect_inproc.cpp | 2 -
+ tests/test_fork.cpp | 10 +--
+ tests/test_hwm.cpp | 3 -
+ tests/test_inproc_connect_before_bind.cpp | 2 -
+ tests/test_invalid_rep.cpp | 4 +-
+ tests/test_iov.cpp | 5 --
+ tests/test_last_endpoint.cpp | 2 -
+ tests/test_linger.cpp | 3 -
+ tests/test_monitor.cpp | 4 --
+ tests/test_msg_flags.cpp | 2 -
+ tests/test_pair_inproc.cpp | 1 -
+ tests/test_pair_ipc.cpp | 1 -
+ tests/test_pair_tcp.cpp | 1 -
+ tests/test_probe_router.cpp | 3 -
+ tests/test_req_request_ids.cpp | 2 -
+ tests/test_req_strict.cpp | 3 -
+ tests/test_reqrep_device.cpp | 3 -
+ tests/test_reqrep_inproc.cpp | 1 -
+ tests/test_reqrep_ipc.cpp | 1 -
+ tests/test_reqrep_tcp.cpp | 1 -
+ tests/test_router_mandatory.cpp | 3 -
+ tests/test_security_curve.cpp | 4 --
+ tests/test_security_null.cpp | 3 -
+ tests/test_security_plain.cpp | 3 -
+ tests/test_shutdown_stress.cpp | 4 --
+ tests/test_spec_dealer.cpp | 2 -
+ tests/test_spec_pushpull.cpp | 2 -
+ tests/test_spec_rep.cpp | 2 -
+ tests/test_spec_req.cpp | 3 -
+ tests/test_spec_router.cpp | 2 -
+ tests/test_stream.cpp | 2 -
+ tests/test_sub_forward.cpp | 4 --
+ tests/test_system.cpp | 15 ++--
+ tests/test_term_endpoint.cpp | 4 --
+ tests/test_timeo.cpp | 5 --
+ tests/testutil.hpp | 14 +++-
+ tools/curve_keygen.c | 46 +-----------
+ tools/z85_codec.h | 109 -----------------------------
+ 53 files changed, 237 insertions(+), 397 deletions(-)
+
+commit 5c7b39275f322799d1baa9be79340943071fa950
+Merge: 9066851 193d0bb
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Sun Sep 15 09:51:09 2013 -0700
+
+ Merge pull request #659 from hintjens/master
+
+ Fixed Z85 methods to be static
+
+commit 193d0bb63400d1a0f9a4c970e08c4807358244eb
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Sep 15 17:30:18 2013 +0200
+
+ Fixed Z85 methods to be static and not pollute library
+
+ src/z85_codec.hpp | 4 ++--
+ tests/test_security_curve.cpp | 41 +++++++++++++++++++++++++++++++++++++++--
+ tools/curve_keygen.c | 39 +++++++++++++++++++++++++++++++++++++--
+ tools/z85_codec.h | 4 ++--
+ 4 files changed, 80 insertions(+), 8 deletions(-)
+
+commit 65ef76bb59255c2614055910748359276656c996
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Sep 15 15:45:37 2013 +0200
+
+ Minor simplification to makefile
+
+ tools/Makefile.am | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+commit 90668517da4d29383470a794c51bb1647b2cc8ab
+Merge: 133c32d 4e6c56e
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Sep 15 06:19:00 2013 -0700
+
+ Merge pull request #658 from ricnewton/inproc_connect_before_bind
+
+ Support high water mark on inproc socket connect before bind.
+
+commit 4e6c56e081a00f9963af337f5d49c73e2ac8afc3
+Merge: b929882 133c32d
+Author: Richard Newton <richard_newton@waters.com>
+Date: Sun Sep 15 13:36:07 2013 +0100
+
+ Merge branch 'master' of https://github.com/zeromq/libzmq into inproc_connect_before_bind
+
+commit b9298823b4b42dd5beeedfcf8e06cb5f57ecd3bb
+Author: Richard Newton <richard_newton@waters.com>
+Date: Sun Sep 15 13:35:44 2013 +0100
+
+ Set hwm on connect socket before bind has happend to just that of connects hwm.
+
+ src/pipe.cpp | 4 +-
+ src/socket_base.cpp | 8 ++-
+ tests/test_hwm.cpp | 156 ++++++++++++++++++++++++++++++++++++++++++++++++++-
+ 3 files changed, 163 insertions(+), 5 deletions(-)
+
+commit 7841b0dd0f94e050bce753c394cd034ab3184ee9
+Author: Richard Newton <richard_newton@waters.com>
+Date: Sat Sep 14 17:27:18 2013 +0100
+
+ Support high water mark on inproc socket connect before bind.
+
+ src/ctx.cpp | 97 ++++++++++++++++++++++---------------
+ src/ctx.hpp | 2 +
+ src/object.hpp | 3 +-
+ src/pipe.cpp | 5 ++
+ src/pipe.hpp | 3 ++
+ tests/test_hwm.cpp | 134 +++++++++++++++++++++++++++++++++++++++-------------
+ 6 files changed, 171 insertions(+), 73 deletions(-)
+
+commit 133c32d5ed523c8bd7976f1fd43663083d9456ff
+Merge: 3298e5a 0db2bbe
+Author: Richard Newton <richard_newton@waters.com>
+Date: Fri Sep 13 00:52:12 2013 -0700
+
+ Merge pull request #657 from hintjens/master
+
+ Build didn't work if libsodium wasn't installed
+
+commit 0db2bbe29d4b4096ecb863c1702cb29d3eadbd29
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Sep 13 09:47:23 2013 +0200
+
+ Build didn't work if libsodium wasn't installed
+
+ tools/curve_keygen.c | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+commit 3298e5a206ccab9c441c69a165332a97cbf6ccb9
+Merge: c1fabf5 b9c0906
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Sep 12 13:46:37 2013 -0700
+
+ Merge pull request #656 from ricnewton/inproc_connect_before_bind
+
+ Allow inproc sockets to connect before bind
+
+commit b9c09064d5760e015b33c716aace846eb3802c43
+Author: Richard Newton <richard_newton@waters.com>
+Date: Thu Sep 12 21:22:47 2013 +0100
+
+ Fix whitespace
+
+ src/socket_base.cpp | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+commit d5bd68b60b0311699b0fad411db0f1a09f3ee030
+Merge: 379bcb0 c1fabf5
+Author: Richard Newton <richard_newton@waters.com>
+Date: Thu Sep 12 21:09:30 2013 +0100
+
+ Merge branch 'master' of https://github.com/zeromq/libzmq into inproc_connect_before_bind
+
+commit 379bcb088153cf4207e46b82bebd50f9fcf7e359
+Author: Richard Newton <richard_newton@waters.com>
+Date: Thu Sep 12 21:07:29 2013 +0100
+
+ Send identities when connecting pending sockets.
+
+ src/ctx.cpp | 39 ++++++++++++----
+ src/ctx.hpp | 7 +--
+ src/object.cpp | 2 +-
+ src/object.hpp | 2 +-
+ src/socket_base.cpp | 3 +-
+ tests/test_inproc_connect_before_bind.cpp | 71 +++++++++++++++++++++++++----
+ 6 files changed, 102 insertions(+), 22 deletions(-)
+
+commit c1fabf5ca9e7e9c575ab7a6e8a648a9f0e0ebf2a
+Merge: 60f4704 345bf14
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Thu Sep 12 10:27:57 2013 -0700
+
+ Merge pull request #655 from hintjens/master
+
+ Fixed overwrite in zmq_getsockopt
+
+commit 7c3496a76acfad992ebd7f1af1c2b22174b79530
+Author: Richard Newton <richard_newton@waters.com>
+Date: Thu Sep 12 18:09:37 2013 +0100
+
+ Fix race condition and support multiple socket connects before bind.
+
+ .gitignore | 1 +
+ src/command.hpp | 1 +
+ src/ctx.cpp | 43 +++++--
+ src/ctx.hpp | 4 +-
+ src/object.cpp | 16 ++-
+ src/object.hpp | 3 +-
+ src/socket_base.cpp | 46 +-------
+ tests/Makefile.am | 4 +-
+ tests/test_inproc_connect_before_bind.cpp | 180 ++++++++++++++++++++++++++++-
+ 9 files changed, 232 insertions(+), 66 deletions(-)
+
+commit 60f470450d5d541eed604b437252b0c300f1f6ee
+Merge: 168efb9 6c84a54
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Sep 12 09:53:26 2013 -0700
+
+ Merge pull request #654 from lalebarde/master
+
+ add exhaustive comparison in testutil bounce
+
+commit 6c84a543882c8ac4e673c5de40df11a27ab76c75
+Author: Laurent Alebarde <l.alebarde@free.fr>
+Date: Thu Sep 12 18:17:31 2013 +0200
+
+ add exhaustive comparison in testutil bounce
+
+ tests/testutil.hpp | 11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+commit 345bf146f151cbc62fd8b000dbe1316463d2a82d
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Sep 12 18:03:23 2013 +0200
+
+ Fixed overwrite in zmq_getsockopt
+
+ On ZMQ_CURVE_xxxKEY fetches, would return 41 bytes into caller's 40-byte
+ buffer. Now these fetches only return 41 bytes if the caller explicitly
+ provides a 41-byte buffer (i.e. the option size is 41).
+
+ doc/zmq_getsockopt.txt | 12 +++++++-----
+ src/options.cpp | 6 +++---
+ src/options.hpp | 2 +-
+ src/z85_codec.hpp | 3 ++-
+ tools/z85_codec.h | 3 ++-
+ 5 files changed, 15 insertions(+), 11 deletions(-)
+
+commit 6fefa4166acae14edf69473bb739a34d46128a70
+Merge: 5f20d63 168efb9
+Author: Richard Newton <richard_newton@waters.com>
+Date: Thu Sep 12 15:13:25 2013 +0100
+
+ Merge remote-tracking branch 'upstream/master' into inproc_connect_before_bind
+
+commit 5f20d63665c0ddbd3ff8824a9d1eda33bea07735
+Author: Richard Newton <richard_newton@waters.com>
+Date: Thu Sep 12 14:44:44 2013 +0100
+
+ First attempt at inproc connect before bind
+
+ CMakeLists.txt | 3 +-
+ src/ctx.cpp | 28 +++++++
+ src/ctx.hpp | 13 +++
+ src/object.cpp | 15 ++++
+ src/object.hpp | 5 ++
+ src/socket_base.cpp | 127 ++++++++++++++++++++---------
+ tests/test_ctx_destroy.cpp | 3 +
+ tests/test_inproc_connect_before_bind.cpp | 114 ++++++++++++++++++++++++++
+ tests/test_pair_inproc.cpp | 2 +-
+ 9 files changed, 270 insertions(+), 40 deletions(-)
+
+commit 168efb9739eb3064bbbffc7c5849e4682e47547b
+Merge: 0d14efe 0f9e5f6
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Thu Sep 12 05:21:25 2013 -0700
+
+ Merge pull request #653 from mattconnolly/master
+
+ Fix preprocessor typoe
+
+commit 6ff65a8aa4c97ddf442c4d72a74a95a81be5057f
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Sep 12 13:16:22 2013 +0200
+
+ Builds and installs curve_keygen tool
+
+ tools/Makefile.am | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+commit 0d14efe73a9c39b263240614ad4a40ac5020e55e
+Merge: 0f7141c ac8c72c
+Author: Richard Newton <richard_newton@waters.com>
+Date: Thu Sep 12 03:56:27 2013 -0700
+
+ Merge pull request #652 from hintjens/master
+
+ Minor fixes to project packaging
+
+commit ac8c72cea68235faffe71b248bf45ae57fe5619f
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Sep 12 12:47:14 2013 +0200
+
+ Added test_ctx_destroy to .gitignore
+
+ .gitignore | 1 +
+ 1 file changed, 1 insertion(+)
+
+commit d1ba8a50d2fad55dbb000065326e2e9138bfd1d0
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Sep 12 12:46:43 2013 +0200
+
+ Extended TravisCI build to use libsodium
+
+ .travis.yml | 18 +++++++++++++++++-
+ 1 file changed, 17 insertions(+), 1 deletion(-)
+
+commit 52370bff4485d6aa3e84ccf49f4f6020b50b76af
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Sep 12 12:46:23 2013 +0200
+
+ Removed debugging printfs
+
+ tests/test_security_curve.cpp | 2 --
+ tests/test_security_null.cpp | 2 --
+ tests/test_security_plain.cpp | 2 --
+ 3 files changed, 6 deletions(-)
+
+commit 0f9e5f60498cdd2146c24a8133356d59d963d806
+Author: Matt Connolly <matt.connolly@me.com>
+Date: Thu Sep 12 20:30:16 2013 +1000
+
+ Fix preprocessor typoe
+
+ tests/test_system.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 0f7141c21a2eb5adc6cb14530b7cce7d048ccbd6
+Merge: bba0dd1 8e6b5ad
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Sep 11 09:33:08 2013 -0700
+
+ Merge pull request #651 from ricnewton/master
+
+ Fix Makefile.am for test_ctx_destroy
+
+commit 8e6b5ad17ef963d2ecafa3b25659a226fa1d212c
+Author: Richard Newton <richard_newton@waters.com>
+Date: Wed Sep 11 15:02:16 2013 +0100
+
+ Fix Makefile.am for test_ctx_destroy
+
+ tests/Makefile.am | 1 +
+ 1 file changed, 1 insertion(+)
+
+commit bba0dd19a1886ed818c537abd8ca7896bafc2f68
+Merge: 25c89ca ccf0e61
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Sep 10 07:03:40 2013 -0700
+
+ Merge pull request #650 from ricnewton/master
+
+ Implement non-blocking shutdown command
+
+commit ccf0e61b770bde35b6ce7d46ca026c15a2101b1c
+Merge: 64e1c18 25c89ca
+Author: Richard Newton <richard_newton@waters.com>
+Date: Tue Sep 10 13:30:11 2013 +0100
+
+ Merge remote-tracking branch 'upstream/master'
+
+commit 64e1c181f71299614975b2809e112803719221b1
+Author: Richard Newton <richard_newton@waters.com>
+Date: Tue Sep 10 13:30:00 2013 +0100
+
+ Implement non-blocking shutdown command that unblocks other threads waiting on blocking operations.
+
+ CMakeLists.txt | 1 +
+ doc/zmq_ctx_shutdown.txt | 52 +++++++++++++++++++++++++
+ include/zmq.h | 1 +
+ src/ctx.cpp | 19 ++++++++++
+ src/ctx.hpp | 9 +++++
+ src/zmq.cpp | 10 +++++
+ tests/Makefile.am | 1 +
+ tests/test_ctx_destroy.cpp | 90 ++++++++++++++++++++++++++++++++++++++++++++
+ 8 files changed, 183 insertions(+)
+
+commit 25c89cace164c50434ec0300aa2fd50337064561
+Merge: 4edad54 6725c46
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Mon Sep 9 12:12:36 2013 -0700
+
+ Merge pull request #649 from hintjens/master
+
+ Fixed minor error in NULL mechanism (spec was wrong)
+
+commit 6725c4644f111ba3f3ab3b0aba5a53cea0265391
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Sep 9 20:40:34 2013 +0200
+
+ Added ZMQ_ZAP_DOMAIN socket option
+
+ * This is passed to the ZAP handler in the 'domain' field
+
+ * If not set, or empty, then NULL security does not call the ZAP handler
+
+ * This resolves the phantom ZAP request syndrome seen with sockets where
+ security was never intended (e.g. in test cases)
+
+ * This means if you install a ZAP handler, it will not get any requests
+ for new connections until you take some explicit action, which can be
+ setting a username/password for PLAIN, a key for CURVE, or the domain
+ for NULL.
+
+ doc/zmq_getsockopt.txt | 50 +++++++++++++++++----------
+ doc/zmq_setsockopt.txt | 76 +++++++++++++++++++++++++----------------
+ include/zmq.h | 5 +--
+ src/curve_server.cpp | 7 ++--
+ src/null_mechanism.cpp | 9 +++--
+ src/options.cpp | 53 +++++++++++++++++-----------
+ src/options.hpp | 11 +++---
+ src/plain_mechanism.cpp | 7 ++--
+ tests/test_security_curve.cpp | 22 ++++++------
+ tests/test_security_null.cpp | 27 ++++++++-------
+ tests/test_security_plain.cpp | 16 +++++----
+ 11 files changed, 171 insertions(+), 112 deletions(-)
+
+commit c45d91a10611b8a9812691f404fd3e30f002585a
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Sep 9 19:58:31 2013 +0200
+
+ Fixed comments on curve_keygen tool
+
+ tools/curve_keygen.c | 26 ++++++++++----------------
+ 1 file changed, 10 insertions(+), 16 deletions(-)
+
+commit 635a03d2404129d0d5cee0ad517591befeba4f14
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Sep 9 19:58:18 2013 +0200
+
+ Was sending NULL mechanism name with extra null (fixed)
+
+ src/null_mechanism.cpp | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+commit 4edad545372774c5d8aaae87d45490f27d171884
+Merge: 498dc37 a601b3f
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Sep 6 03:19:45 2013 -0700
+
+ Merge pull request #648 from ricnewton/master
+
+ Fix tests on windows
+
+commit a601b3f6f40e8d5a2926dbf61c00d9b416e33560
+Author: Richard Newton <richard_newton@waters.com>
+Date: Fri Sep 6 10:25:00 2013 +0100
+
+ Remove windows debug code.
+
+ tests/test_system.cpp | 1 -
+ 1 file changed, 1 deletion(-)
+
+commit 7485b09cba0d335de271949f41bb6a5b77ee08c4
+Author: Richard Newton <richard_newton@waters.com>
+Date: Fri Sep 6 10:08:11 2013 +0100
+
+ Fix tests on windows
+
+ tests/test_security_curve.cpp | 2 +-
+ tests/test_system.cpp | 33 +++++++++++++++++++++++++++++++++
+ 2 files changed, 34 insertions(+), 1 deletion(-)
+
+commit 498dc3798878c611392b27064efa1e2161d1d9bf
+Merge: 1f03710 4c75306
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Fri Sep 6 00:54:51 2013 -0700
+
+ Merge pull request #645 from hintjens/master
+
+ Updated libzmq to match RFCs
+
+commit 4c753060236caf12102194b313abfb28dccaa7ff
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Sep 6 09:22:09 2013 +0200
+
+ Fixed test_stream case
+
+ - was not looping to read all input from peer
+ - broke on OS/X specifically
+
+ tests/test_stream.cpp | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+commit 9dd324aab23d8540260c8da93ae3927854542ecb
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Sep 5 15:18:42 2013 +0200
+
+ z85 encoding buffer overrun
+
+ tests/test_security_curve.cpp | 2 +-
+ tools/curve_keygen.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+commit 1f037109806081468f250dda4f2762cec8e1f452
+Merge: 7b02f1c 11deee4
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Sep 4 12:12:28 2013 -0700
+
+ Merge pull request #647 from sebastien/master
+
+ Clarified zmq_socket.txt ZMQ_STREAM section, added HTTP server example
+
+commit 11deee4e3eafb0f97aae95b786e39007e335ca41
+Merge: f918884 7b02f1c
+Author: Sebastien Pierre <sebastien.pierre@gmail.com>
+Date: Wed Sep 4 15:02:50 2013 -0400
+
+ Merge branch 'master' of github.com:sebastien/libzmq
+
+commit f9188841b02b90fbba493c803f17be082d47f4d1
+Author: Sebastien Pierre <sebastien.pierre@gmail.com>
+Date: Wed Sep 4 14:58:07 2013 -0400
+
+ Clarified zmq_socket.txt ZMQ_STREAM section, added example
+
+ doc/zmq_socket.txt | 45 +++++++++++++++++++++++++++++++++++++++++++--
+ 1 file changed, 43 insertions(+), 2 deletions(-)
+
+commit 0a9261472f6c28e4092b0564da3960146bdfd743
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Sep 4 19:41:33 2013 +0200
+
+ Removed test_raw_socket
+
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 32fa426e61b92bdd0929990cebc799839cc335a7
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Sep 4 19:38:15 2013 +0200
+
+ Added system check at start of selftests
+
+ - tests that system can provide at least 1,000 sockets
+ - we could expand on this but this covers the main case of OS/X
+ having a too-low default limit of 256 handles per process
+
+ .gitignore | 1 +
+ tests/Makefile.am | 4 +++-
+ tests/test_system.cpp | 51 +++++++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 55 insertions(+), 1 deletion(-)
+
+commit 7b02f1c966cc7b615b6cfd5df81f09478be2dcb0
+Merge: ef207e4 bb34885
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Sep 4 09:42:39 2013 -0700
+
+ Merge pull request #646 from minrk/xfail-linger
+
+ mark test_linger as expected failure
+
+commit bb348858f14e797ef125f8ba95a3218ddbc3180a
+Author: MinRK <benjaminrk@gmail.com>
+Date: Wed Sep 4 09:38:54 2013 -0700
+
+ mark test_linger as expected failure
+
+ rather than pretending it passes
+
+ tests/Makefile.am | 3 ++-
+ tests/test_linger.cpp | 3 ---
+ 2 files changed, 2 insertions(+), 4 deletions(-)
+
+commit 6612280946a40ae3d0d48ff729a1a81c23046ca8
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Sep 4 18:10:47 2013 +0200
+
+ Removed temporary patch on tests/Makefile.am
+
+ tests/Makefile.am | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+commit 28b0a5fa2711b43e2378b7c16367ce14604df096
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Sep 4 17:59:45 2013 +0200
+
+ Updated libzmq to match RFC 23, 24, 25, 26
+
+ * Command names changed from null terminated to length-specified
+ * Command frames use the correct flag (bit 2)
+ * test_stream acts as test case for command frames
+ * Some code cleanups
+
+ src/curve_client.cpp | 24 +++++++--------
+ src/curve_client.hpp | 8 ++---
+ src/curve_server.cpp | 24 +++++++--------
+ src/curve_server.hpp | 8 ++---
+ src/mechanism.hpp | 8 ++---
+ src/msg.hpp | 3 +-
+ src/null_mechanism.cpp | 8 ++---
+ src/null_mechanism.hpp | 4 +--
+ src/plain_mechanism.cpp | 66 +++++++++++++++++++++--------------------
+ src/plain_mechanism.hpp | 20 ++++++-------
+ src/stream_engine.cpp | 20 ++++++-------
+ src/stream_engine.hpp | 8 ++---
+ src/v2_decoder.cpp | 2 ++
+ src/v2_encoder.cpp | 2 ++
+ src/v2_protocol.hpp | 3 +-
+ tests/Makefile.am | 3 +-
+ tests/test_security_curve.cpp | 2 +-
+ tests/test_stream.cpp | 8 ++---
+ 18 files changed, 114 insertions(+), 107 deletions(-)
+
+commit 1844a27c82fbd72a83ffd28b59c2e5ab1f2ddab7
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Sep 4 15:00:05 2013 +0200
+
+ Removed test_raw_sock test case (replaced by test_stream)
+
+ tests/Makefile.am | 6 +-
+ tests/test_raw_sock.cpp | 166 -----------------------------------------------
+ 2 files changed, 1 insertion(+), 171 deletions(-)
+
+commit ef207e45ce88d5aab6c92b0f8f4322881fb73b44
+Merge: 7561ff7 873d80c
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Sep 4 04:19:34 2013 -0700
+
+ Merge pull request #644 from ipechorin/master
+
+ Fix MSVC 2008 and 2010 project files
+
+commit 873d80c9fecc823d903b7e458b959f9877598d8c
+Author: Ivan Pechorin <ivan.pechorin@gmail.com>
+Date: Wed Sep 4 15:13:14 2013 +0400
+
+ fix MSVC 2008 project: include the source files added recently
+
+ builds/msvc/libzmq/libzmq.vcproj | 62 ++++++++++++++++++++++++++++++++------
+ 1 file changed, 53 insertions(+), 9 deletions(-)
+
+commit e071d3a4ae1421941127d360e31284eac5451047
+Author: Ivan Pechorin <ivan.pechorin@gmail.com>
+Date: Wed Sep 4 15:00:59 2013 +0400
+
+ fix MSVC10 project: include the source files added recently
+
+ builds/msvc/libzmq/libzmq.vcxproj | 10 +++++++++-
+ builds/msvc/libzmq/libzmq.vcxproj.filters | 24 ++++++++++++++++++++++++
+ 2 files changed, 33 insertions(+), 1 deletion(-)
+
+commit 7561ff70f36b23f40366c1ac721f1b4fbd16c4fa
+Merge: 0ff896d 4696f00
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Sep 2 16:10:07 2013 -0700
+
+ Merge pull request #643 from ricnewton/master
+
+ Fix cmake file for security tests
+
+commit 4696f002ca5c36d19967f414ffd673c9d156a3fc
+Author: Richard Newton <richard_newton@waters.com>
+Date: Mon Sep 2 23:41:17 2013 +0100
+
+ Fix cmake file for security tests
+
+ CMakeLists.txt | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+commit 0ff896d094100b530ec253b71f2c9c0a76dac1d7
+Merge: 3a50aa4 fb67e16
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Mon Sep 2 10:30:49 2013 -0700
+
+ Merge pull request #642 from hintjens/master
+
+ Fixed ZAP authentication
+
+commit fb67e160a11db104f89043c702000b7c974d7537
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Sep 2 18:21:36 2013 +0200
+
+ Fixed ZAP authentication
+
+ - if ZAP server returns anything except 200, connection is closed
+ - all security tests now pass correctly
+ - test_security_curve now does proper client key authentication using test key
+ - test_security_plain now does proper password authentication
+
+ src/curve_server.cpp | 4 ++++
+ src/plain_mechanism.cpp | 4 ++++
+ tests/test_security_curve.cpp | 46 ++++++++++++++++++++++++++---------------
+ tests/test_security_plain.cpp | 27 ++++++++++++------------
+ tests/testutil.hpp | 11 +++++-----
+ 5 files changed, 56 insertions(+), 36 deletions(-)
+
+commit 3a50aa4473a0d808da3530f1d2977e5298ebe272
+Merge: c128fac fba5612
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Mon Sep 2 08:32:09 2013 -0700
+
+ Merge pull request #641 from hintjens/master
+
+ Fixed regression tests
+
+commit fba56120262c18b8c54902509f85a544f06048d1
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Sep 2 17:22:24 2013 +0200
+
+ Fixed 'make check' failures
+
+ - Split off NULL security check from PLAIN
+ - Cleaned up test_linger code a little
+ - Got all tests to pass, added TODOs for outstanding issues
+ - Added ZAP authentication for NULL test case
+ - NULL mechanism was not passing server identity - fixed
+ - cleaned up test_security_plain and removed option double-checks (made code ugly)
+ - lowered timeout on expect_bounce_fail to 150 msec to speed up checks
+ - removed all sleeps from test_fork and simplified code (it still passes :-)
+
+ .gitignore | 5 +
+ include/zmq_utils.h | 4 +-
+ src/curve_server.cpp | 2 +-
+ src/null_mechanism.cpp | 8 ++
+ src/plain_mechanism.cpp | 2 +-
+ tests/Makefile.am | 8 +-
+ tests/test_fork.cpp | 115 ++++++----------
+ tests/test_linger.cpp | 98 +++++++-------
+ tests/test_security.cpp | 292 -----------------------------------------
+ tests/test_security_curve.cpp | 242 +++++++++++++++-------------------
+ tests/test_security_null.cpp | 109 +++++++++++++++
+ tests/test_security_plain.cpp | 154 ++++++++++++++++++++++
+ tests/testutil.hpp | 10 +-
+ 13 files changed, 482 insertions(+), 567 deletions(-)
+
+commit 01b336f1f179d62d096e2629956fbcd95c504664
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Sep 2 15:08:36 2013 +0200
+
+ Whitespace fixes
+
+ tests/test_security.cpp | 4 ++--
+ tests/test_security_curve.cpp | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+commit c128fac7a7401421e179bf8fd19c1faf2ecf0bd7
+Merge: 6fa274e c646ac9
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Sep 2 06:06:58 2013 -0700
+
+ Merge pull request #639 from minrk/test_linger
+
+ add test_linger
+
+commit 6fa274ebeff1c5f34e523fc3f2297ea7969bcae8
+Merge: 282765c 1771755
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Sep 2 06:06:31 2013 -0700
+
+ Merge pull request #640 from mattconnolly/fork
+
+ Adding ability for a context to be terminated in a forked child process
+
+commit 282765cab41ca49eb1b4083f56aaa4aaed3c1b12
+Merge: ca8ac83 436cad3
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Sep 2 06:04:51 2013 -0700
+
+ Merge pull request #628 from ianbarber/master
+
+ Remove delay options
+
+commit 1771755888a1b7bb8b17a111d5be93b7f2d4d9be
+Author: Matt Connolly <matt.connolly@me.com>
+Date: Mon Sep 2 07:13:46 2013 +1000
+
+ test_fork.cpp: adding missing headers for linux
+
+ tests/test_fork.cpp | 2 ++
+ 1 file changed, 2 insertions(+)
+
+commit c646ac96c084f618d2267ce8c738ca561a5c1bdf
+Author: MinRK <benjaminrk@gmail.com>
+Date: Sun Sep 1 13:50:18 2013 -0700
+
+ cast rc to size_t for comparisons
+
+ avoids -Wall failures comparing int to uint
+
+ tests/test_linger.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit c3adc86d6b9da02603e665822df295372778e06c
+Author: Matt Connolly <matt.connolly@me.com>
+Date: Mon Sep 2 06:49:30 2013 +1000
+
+ Fix unused variable when using eventfd
+
+ src/signaler.cpp | 2 ++
+ 1 file changed, 2 insertions(+)
+
+commit ca8ac83e97d48e97c332da6935f80dca042b7d58
+Merge: 8ef7fbb 9d94640
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Sep 1 10:18:50 2013 -0700
+
+ Merge pull request #637 from minrk/test_plain_inauth
+
+ test failed auth for both PLAIN and CURVE
+
+commit a3d9d01af87a8f4817df0d369c605931ea9ebf03
+Author: Matt Connolly <matt.connolly@me.com>
+Date: Sun Sep 1 20:40:45 2013 +1000
+
+ test_fork: update test to verify communication between parent and child
+
+ tests/test_fork.cpp | 69 ++++++++++++++++++++++++++++++++++++++++-----------
+ 1 file changed, 55 insertions(+), 14 deletions(-)
+
+commit ff2900fd5286013ae37c00fd0d578bc1eab93140
+Author: Matt Connolly <matt.connolly@me.com>
+Date: Sat Aug 31 21:17:11 2013 +1000
+
+ Terminate context in a child process of fork() to replace file descriptors to not interfere with parent process's context
+
+ src/ctx.cpp | 16 ++++++++++++++
+ src/ctx.hpp | 5 +++++
+ src/kqueue.cpp | 10 +++++++++
+ src/kqueue.hpp | 6 ++++++
+ src/mailbox.cpp | 1 -
+ src/mailbox.hpp | 7 ++++++
+ src/reaper.cpp | 11 ++++++++++
+ src/reaper.hpp | 5 +++++
+ src/signaler.cpp | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ src/signaler.hpp | 20 +++++++++++++++++-
+ 10 files changed, 141 insertions(+), 2 deletions(-)
+
+commit 0478ee04f4f4525715e78f31a3209de6880a0a5e
+Author: Matt Connolly <matt.connolly@me.com>
+Date: Sun Sep 1 20:19:58 2013 +1000
+
+ Adding test showing failure to close socket/context in forked child
+
+ .gitignore | 1 +
+ configure.ac | 2 +-
+ tests/Makefile.am | 4 ++-
+ tests/test_fork.cpp | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++
+ 4 files changed, 80 insertions(+), 2 deletions(-)
+
+commit 58b370df699c5f535e2d5ae6e0a631d2ca330435
+Author: MinRK <benjaminrk@gmail.com>
+Date: Sat Aug 31 18:27:50 2013 -0700
+
+ add test_linger
+
+ tests that default LINGER (-1) ensures message delivery.
+
+ Note: it fails for large messages ( > 1MB, depending on the system).
+
+ tests/Makefile.am | 2 +
+ tests/test_linger.cpp | 103 +++++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 105 insertions(+)
+
+commit 8ef7fbb4a4a1b1f9062046ed3d268433c974c38d
+Merge: 82a00e3 6a18f59
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Sat Aug 31 13:35:21 2013 -0700
+
+ Merge pull request #638 from shawnjgoff/master
+
+ Change name of icanhasall to subscribe_to_all
+
+commit 6a18f59532e8361384519f0f637baabe17380e2a
+Author: Shawn J. Goff <shawn.goff@accelecon.com>
+Date: Sat Aug 31 09:53:47 2013 -0400
+
+ Change name of icanhasall to subscribe_to_all
+
+ icanhasall is cute (for now), but the effect of the variable is clear
+ only after tracking down its origin reading the commit. This change is
+ intended to make it easier for people to have some intuition about its
+ effect from its name.
+
+ src/dealer.cpp | 6 +++---
+ src/dealer.hpp | 2 +-
+ src/pair.cpp | 6 +++---
+ src/pair.hpp | 2 +-
+ src/pull.cpp | 6 +++---
+ src/pull.hpp | 2 +-
+ src/push.cpp | 6 +++---
+ src/push.hpp | 2 +-
+ src/router.cpp | 6 +++---
+ src/router.hpp | 2 +-
+ src/socket_base.cpp | 10 +++++-----
+ src/socket_base.hpp | 4 ++--
+ src/stream.cpp | 6 +++---
+ src/stream.hpp | 2 +-
+ src/xpub.cpp | 6 +++---
+ src/xpub.hpp | 2 +-
+ src/xsub.cpp | 6 +++---
+ src/xsub.hpp | 2 +-
+ 18 files changed, 39 insertions(+), 39 deletions(-)
+
+commit 9d94640edc5b6fc6a7d3a2b66abea680f478921e
+Author: MinRK <benjaminrk@gmail.com>
+Date: Fri Aug 30 17:56:59 2013 -0700
+
+ test failed CURVE auth
+
+ adds expect_bounce_fail test function
+
+ which is like bounce, but fails if messages arrive.
+
+ tests/test_security.cpp | 17 +--------
+ tests/test_security_curve.cpp | 83 ++++++++++++++++++++++++++++++++++++++++-
+ tests/testutil.hpp | 37 ++++++++++++++++++
+ 3 files changed, 119 insertions(+), 18 deletions(-)
+
+commit 0cac56fe524bd5a85c4f1e08f5a4492bab1c2b30
+Author: MinRK <benjaminrk@gmail.com>
+Date: Fri Aug 30 15:28:16 2013 -0700
+
+ test PLAIN auth with failed login
+
+ This test fails because PLAIN authentication doesn't actually reject connections
+
+ tests/test_security.cpp | 80 ++++++++++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 79 insertions(+), 1 deletion(-)
+
+commit 82a00e3a985c6c13e34f385fd19624d521620c5d
+Merge: 22f05fa da52806
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Aug 30 13:38:27 2013 -0700
+
+ Merge pull request #636 from ricnewton/master
+
+ Disable failing tests on windows.
+
+commit da52806d68cd663495ec9c58a2a712bb5561b64c
+Author: Richard Newton <richard_newton@waters.com>
+Date: Fri Aug 30 19:04:32 2013 +0100
+
+ Disable failing tests on windows.
+
+ CMakeLists.txt | 15 +++++++++------
+ 1 file changed, 9 insertions(+), 6 deletions(-)
+
+commit 22f05fa2fa43a72de8a0f9b195514749665447a7
+Merge: 4ca6ab2 93a068a
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Thu Aug 29 12:37:15 2013 -0700
+
+ Merge pull request #635 from guidog/master
+
+ Fixed silly port number.
+
+commit 93a068a832ae64f294e68f54fa828cb6be24f93e
+Author: Guido Goldstein <github@a-nugget.de>
+Date: Thu Aug 29 20:55:23 2013 +0200
+
+ Fixed silly port number.
+
+ tests/test_conflate.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 4ca6ab26fa8b026215515355b6179966e4fa77ed
+Merge: 83e547f 455739f
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Thu Aug 29 04:54:55 2013 -0700
+
+ Merge pull request #634 from guidog/master
+
+ Fixed markup so documentation can be built.
+
+commit 455739f94258c021bfdc001f3aa315374058e912
+Author: Guido Goldstein <github@a-nugget.de>
+Date: Thu Aug 29 09:35:17 2013 +0200
+
+ Fixed markup so documentation can be built.
+
+ doc/zmq_setsockopt.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 83e547f09f985a4bf1e4a19bdc13f03315f450ef
+Merge: 2e9385a eaf227d
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sat Aug 24 14:31:16 2013 -0700
+
+ Merge pull request #633 from eburkitt/vs2012-clean-compile
+
+ get to clean compile under vs2012
+
+commit eaf227d4deb3bc43c5507f7b86d8c46ec4912b06
+Author: Evan Burkitt <evanb@edulinksys.com>
+Date: Fri Aug 23 17:14:03 2013 -0700
+
+ get to clean compile under vs2012
+
+ Added some missing (but existing in branch) files to libzmq11 project needed
+ to compile as static library by VS2012 (at least), and fixed some warnings.
+ One warning remains in raw_decoder.cpp, which I'm leaving for now because I'm
+ not sure how project owners would like to fix it.
+
+ builds/msvc/libzmq/libzmq11.vcxproj | 4 ++++
+ src/dealer.cpp | 2 +-
+ src/mutex.hpp | 2 +-
+ src/req.cpp | 4 ++--
+ src/router.cpp | 6 +++---
+ 5 files changed, 11 insertions(+), 7 deletions(-)
+
+commit 2e9385ac02d14ce78837deb2c9f76155eacdda14
+Merge: d485404 19ca8a0
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Aug 21 01:35:43 2013 -0700
+
+ Merge pull request #631 from jrossi/master
+
+ Add the Socket Identity info to the ZAP Messages
+
+commit 436cad37ece8bc81d333b8a33d38af4ebaea26db
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Tue Aug 20 22:49:19 2013 +0100
+
+ fix type on HWM
+
+ src/pipe.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit a9baa051dd42e584d382a62a98fb31bac47674fa
+Merge: 531d3eb d485404
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Tue Aug 20 22:48:04 2013 +0100
+
+ Merge in master changes
+
+commit d485404aab6efa15a1bdcb881874a4fad4b0b5a8
+Merge: cb6b5a6 3f3777d
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Tue Aug 20 14:37:52 2013 -0700
+
+ Merge pull request #626 from dkrikun/master
+
+ Add ZMQ_CONFLATE socket option
+
+commit 19ca8a0fc0a13e3da6af6636bf3756d77397734f
+Author: Jeremy Rossi <jeremy@jeremyrossi.com>
+Date: Tue Aug 20 13:48:05 2013 -0400
+
+ Add the Socket Identity info to the ZAP Messages
+
+ This change adds the socket identity infomartion from the socket to the
+ zap frames. In doing this the ZAP is able preform different operations
+ based on different sockets. This is not compaitable with the current ZAP
+ RFC, but that can be updated. As the ZAP rfc is currently draft for I
+ did not change the version number.
+
+ Tests also modified and passing.
+
+ src/curve_server.cpp | 8 ++++++++
+ src/plain_mechanism.cpp | 8 ++++++++
+ tests/test_security.cpp | 5 +++++
+ tests/test_security_curve.cpp | 5 +++++
+ 4 files changed, 26 insertions(+)
+
+commit cb6b5a65fcee87d343cf6d12b792c28a2625aa77
+Merge: bcfe863 fd8b0fe
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Mon Aug 19 05:55:07 2013 -0700
+
+ Merge pull request #629 from ulikoehler/init_data_assert
+
+ Minor doc & assert fixes
+
+commit fd8b0fec077c6f4724b6dd17018ed4edd0bbe6c4
+Author: Uli Köhler <ulikoehler@online.de>
+Date: Mon Aug 19 14:49:29 2013 +0200
+
+ Re-add comment line from cmsg branch
+
+ src/msg.cpp | 2 ++
+ 1 file changed, 2 insertions(+)
+
+commit a28c38efa5084ba92ec98f1f055bbe22881548a6
+Author: Uli Köhler <ulikoehler@online.de>
+Date: Mon Aug 19 14:45:29 2013 +0200
+
+ Fix spaces before comments
+
+ src/msg.hpp | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+commit 3f3777d05bada63414339bedb7aefc56051836c2
+Author: danielkr <krikun.daniel@gmail.com>
+Date: Mon Aug 19 15:34:11 2013 +0300
+
+ Add test for ZMQ_CONFLATE option
+
+ tests/Makefile.am | 4 ++-
+ tests/test_conflate.cpp | 77 +++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 80 insertions(+), 1 deletion(-)
+
+commit 9c2740d9fad86fb3b983ba30cde10b4cf5b4c7cc
+Author: Uli Köhler <ulikoehler@online.de>
+Date: Sun Aug 18 22:50:50 2013 +0200
+
+ Minor fixes to doc ; added zmq_msg_init_data() assert preventing deferred segfault
+
+ src/msg.cpp | 6 ++++--
+ src/msg.hpp | 5 ++++-
+ src/zmq.cpp | 2 +-
+ 3 files changed, 9 insertions(+), 4 deletions(-)
+
+commit bcfe863fd4d8500217ea0b9e22296101249867fa
+Merge: b3ca7fd 121a838
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Mon Aug 19 01:11:07 2013 -0700
+
+ Merge pull request #630 from ulikoehler/cmsg
+
+ Optimized zmq::msg_t for constant messages
+
+commit da4a70d59d14f68d5cb463cce01e9a772f6ca5a2
+Author: danielkr <krikun.daniel@gmail.com>
+Date: Mon Aug 19 08:18:20 2013 +0300
+
+ Fix indentation
+
+ src/pipe.cpp | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+commit 121a838a0ce824f40ef57dbc24234409f368ebdb
+Author: Uli Köhler <ulikoehler@online.de>
+Date: Sun Aug 18 23:40:38 2013 +0200
+
+ Added message type for constant messages
+
+ src/msg.cpp | 44 +++++++++++++++++++++++++++++++-------------
+ src/msg.hpp | 13 ++++++++++++-
+ 2 files changed, 43 insertions(+), 14 deletions(-)
+
+commit 531d3ebc096c65b3e2772958acde9bf329136b18
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Sun Aug 18 11:16:21 2013 +0100
+
+ Remove delay options
+
+ These were exposed to users, but have subsequently been removed as
+ sockopts. They are currently only being used by ZAP, so I've moved it to
+ a simpl function call (actually it's only used in one case even in that,
+ so there may be a further simplification possible there).
+
+ src/options.cpp | 2 --
+ src/options.hpp | 8 --------
+ src/pipe.cpp | 15 ++++++++++-----
+ src/pipe.hpp | 9 ++++++---
+ src/session_base.cpp | 10 +++++-----
+ src/socket_base.cpp | 6 ++----
+ 6 files changed, 23 insertions(+), 27 deletions(-)
+
+commit b3ca7fd4253531ad3f001196ba3eafbec931b2f9
+Merge: 1011e8a cb35fd7
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Aug 18 00:58:03 2013 -0700
+
+ Merge pull request #627 from ianbarber/master
+
+ Attempt to fix disconnect not respecting linger
+
+commit 1011e8ad2078e923541f16ec738837550e710b6e
+Merge: ed272fe 70a1fbe
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Aug 18 00:51:39 2013 -0700
+
+ Merge pull request #624 from ricnewton/master
+
+ Port tests to windows and add to cmake build.
+
+commit cb35fd7bfed767a303da43da523c91b98321a58f
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Sun Aug 18 07:50:53 2013 +0100
+
+ Attempt to fix disconnect not respecting linger
+
+ Looks like linger is honoured properly, but shutting down the session
+ causes the pipe termination to come from that side - because the local
+ pipe then shuts down right away it seems to trigger a terminated on the
+ other end instead of waiting. This way we trigger the termination from
+ the local end and then terminate the session.
+
+ src/socket_base.cpp | 20 +++++++++++++-------
+ src/socket_base.hpp | 5 +++--
+ 2 files changed, 16 insertions(+), 9 deletions(-)
+
+commit ed272fe56d3b16c9f111aa4db97432d3327d92d8
+Merge: eccfede e23d396
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Sat Aug 17 23:27:17 2013 -0700
+
+ Merge pull request #625 from ulikoehler/zmq_send_const
+
+ Add zmq_send_const for constant data
+
+commit f59c1a5c5aec15cd6117eee951ad51ac302ca1ad
+Author: danielkr <krikun.daniel@gmail.com>
+Date: Sat Aug 17 23:55:00 2013 +0300
+
+ Update doc for ZMQ_CONFLATE socket option
+
+ doc/zmq_setsockopt.txt | 16 ++++++++++++++++
+ 1 file changed, 16 insertions(+)
+
+commit daa7a8021f6802d12d8fcfd771dda3101d192f15
+Author: danielkr <krikun.daniel@gmail.com>
+Date: Sat Aug 17 23:08:07 2013 +0300
+
+ Plug in dbuffer to serve the ZMQ_CONFLATE option
+
+ ZMQ_CONFLATE option is passed to pipepair() which creates a usual
+ ypipe_t or ypipe_conflate_t and plugs it into pipe_t under a common
+ abstract base.
+
+ src/Makefile.am | 5 +-
+ src/pipe.cpp | 51 ++++++++++++++-----
+ src/pipe.hpp | 15 ++++--
+ src/session_base.cpp | 17 +++++--
+ src/socket_base.cpp | 27 ++++++++--
+ src/ypipe.hpp | 3 +-
+ src/ypipe_base.hpp | 44 +++++++++++++++++
+ src/ypipe_conflate.hpp | 127 ++++++++++++++++++++++++++++++++++++++++++++++++
+ 8 files changed, 263 insertions(+), 26 deletions(-)
+
+commit 4c35b88acbc7d1237e86833253737632cfd6a216
+Author: danielkr <krikun.daniel@gmail.com>
+Date: Sat Aug 17 23:00:46 2013 +0300
+
+ Implement double buffer for conflate option
+
+ Add simple double buffer implementation tailored to handle msg_t,
+ i.e invoke msg_t::close instead of destructor and so on.
+ Seems to me mutex is good enough at this point.
+
+ src/dbuffer.hpp | 134 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 134 insertions(+)
+
+commit d020dd677f9c8c4f89f244b19f1b809fb9b3a635
+Author: danielkr <krikun.daniel@gmail.com>
+Date: Sat Aug 17 22:59:07 2013 +0300
+
+ Declare ZMQ_CONFLATE option
+
+ include/zmq.h | 1 +
+ src/options.cpp | 21 ++++++++++++++++++++-
+ src/options.hpp | 6 ++++++
+ 3 files changed, 27 insertions(+), 1 deletion(-)
+
+commit 4eac7e3e4fc443d3ad058d245f88f52ae7a1a817
+Author: danielkr <krikun.daniel@gmail.com>
+Date: Sat Aug 17 22:55:04 2013 +0300
+
+ Add scoped_lock_t syntactic sugar
+
+ src/mutex.hpp | 26 ++++++++++++++++++++++++++
+ 1 file changed, 26 insertions(+)
+
+commit 87c84a252abc59bf34895a42f799278f2f9e478f
+Author: danielkr <krikun.daniel@gmail.com>
+Date: Sat Aug 17 22:54:29 2013 +0300
+
+ Add try_lock() to mutex_t
+
+ src/mutex.hpp | 15 +++++++++++++++
+ 1 file changed, 15 insertions(+)
+
+commit 503da83fceac8c2d6c37ff6fbfac0c4c31e59a91
+Author: danielkr <krikun.daniel@gmail.com>
+Date: Sat Aug 17 22:53:02 2013 +0300
+
+ Add #include to string.h in blob.hpp
+
+ Required for memmove(), memcpy()
+
+ src/blob.hpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+commit e23d3963d337985c80523327a29480625a009d37
+Author: Uli Köhler <ulikoehler@online.de>
+Date: Sat Aug 17 20:39:10 2013 +0200
+
+ Fix doc typo
+
+ doc/zmq_send_const.txt | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+commit 10becae7eb7c43e7ec854c5f7d9f365566e1deef
+Author: Uli Köhler <ulikoehler@online.de>
+Date: Sat Aug 17 20:37:07 2013 +0200
+
+ Added zmq_send_const test
+
+ tests/test_pair_inproc.cpp | 21 +++++++++++++++++++++
+ 1 file changed, 21 insertions(+)
+
+commit e2c322cf80e158a59d5b917a76693afc39f5de4e
+Author: Uli Köhler <ulikoehler@online.de>
+Date: Sat Aug 17 20:22:50 2013 +0200
+
+ Implemented zmq_send_const
+
+ doc/zmq_send.txt | 1 +
+ doc/zmq_send_const.txt | 103 ++++++++++++++++++++++++++++++++++++++++++++++++
+ include/zmq.h | 1 +
+ src/zmq.cpp | 26 ++++++++++++
+ 4 files changed, 131 insertions(+)
+
+commit 70a1fbee7a94a7e2ace3c5b5f376c997ccc68ea7
+Author: Richard Newton <richard_newton@waters.com>
+Date: Sat Aug 17 14:39:38 2013 +0100
+
+ Fix running tests from cmake on linux.
+
+ CMakeLists.txt | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+commit e1b2b649fb7459203939cc0dd0446df4f88bb273
+Merge: a83baa9 eccfede
+Author: Richard Newton <richard_newton@waters.com>
+Date: Sat Aug 17 14:23:42 2013 +0100
+
+ Merge branch 'master' of https://github.com/zeromq/libzmq
+
+commit a83baa9b0b35a3664d22a48b918e644c77b47114
+Author: Richard Newton <richard_newton@waters.com>
+Date: Sat Aug 17 14:23:22 2013 +0100
+
+ Fix up threading code from port tests to windows.
+
+ include/zmq_utils.h | 4 +++-
+ src/zmq_utils.cpp | 4 ++--
+ tests/test_monitor.cpp | 15 ++++++---------
+ tests/test_security.cpp | 5 +----
+ tests/test_security_curve.cpp | 5 +----
+ tests/test_shutdown_stress.cpp | 6 ++----
+ tests/testutil.hpp | 3 +++
+ 7 files changed, 18 insertions(+), 24 deletions(-)
+
+commit 7f74fc7c998cba2efd2bc286ab2aad711fb5c475
+Author: Richard Newton <richard_newton@waters.com>
+Date: Sat Aug 17 13:43:45 2013 +0100
+
+ Port tests to windows and add to cmake build.
+
+ CMakeLists.txt | 52 +++++++++++++++++++++++++++++++++++---
+ include/zmq_utils.h | 6 +++++
+ src/zmq_utils.cpp | 15 +++++++++++
+ tests/test_connect_delay.cpp | 12 ++++-----
+ tests/test_connect_resolve.cpp | 5 ++--
+ tests/test_ctx_options.cpp | 5 ++--
+ tests/test_disconnect_inproc.cpp | 3 ++-
+ tests/test_hwm.cpp | 4 +--
+ tests/test_invalid_rep.cpp | 5 ++--
+ tests/test_iov.cpp | 10 ++++----
+ tests/test_last_endpoint.cpp | 5 ++--
+ tests/test_monitor.cpp | 23 ++++++++---------
+ tests/test_msg_flags.cpp | 5 ++--
+ tests/test_pair_inproc.cpp | 1 +
+ tests/test_pair_ipc.cpp | 1 +
+ tests/test_pair_tcp.cpp | 1 +
+ tests/test_probe_router.cpp | 4 +--
+ tests/test_raw_sock.cpp | 5 ++--
+ tests/test_req_request_ids.cpp | 2 +-
+ tests/test_req_strict.cpp | 7 +++--
+ tests/test_reqrep_device.cpp | 5 ++--
+ tests/test_reqrep_inproc.cpp | 1 +
+ tests/test_reqrep_ipc.cpp | 1 +
+ tests/test_reqrep_tcp.cpp | 1 +
+ tests/test_router_mandatory.cpp | 4 +--
+ tests/test_security.cpp | 9 +++----
+ tests/test_security_curve.cpp | 9 +++----
+ tests/test_shutdown_stress.cpp | 15 +++++------
+ tests/test_spec_dealer.cpp | 1 +
+ tests/test_spec_pushpull.cpp | 1 +
+ tests/test_spec_rep.cpp | 1 +
+ tests/test_spec_req.cpp | 6 ++---
+ tests/test_spec_router.cpp | 1 +
+ tests/test_stream.cpp | 5 ++--
+ tests/test_sub_forward.cpp | 8 +++---
+ tests/test_term_endpoint.cpp | 12 ++++-----
+ tests/test_timeo.cpp | 16 ++++--------
+ tests/testutil.hpp | 12 +++++++++
+ 38 files changed, 171 insertions(+), 108 deletions(-)
+
+commit eccfede10d73bf8505a841b3d75c6f200d31728a
+Merge: 749c391 e16a6af
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Thu Aug 8 11:42:53 2013 -0700
+
+ Merge pull request #623 from ricnewton/master
+
+ Fix compile error on windows.
+
+commit e16a6af0c7430ecc0efac674e75fe3f66b0f6ee5
+Author: Richard Newton <richard_newton@waters.com>
+Date: Thu Aug 8 17:27:49 2013 +0100
+
+ Fix compile error on windows.
+
+ src/ip.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 749c391b3414cc57afbb4a108867ebc062b2195f
+Merge: fe30cc6 423ca36
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Sat Aug 3 12:42:53 2013 -0700
+
+ Merge pull request #622 from ckamm/req-strict
+
+ Rename ZMQ_REQ_SEND_RESETS -> ZMQ_REQ_STRICT.
+
+commit 423ca36b17264ca7b71b23e4a110aa847fd7ac27
+Author: Christian Kamm <kamm@incasoftware.de>
+Date: Sat Aug 3 14:35:18 2013 +0200
+
+ Rename ZMQ_REQ_SEND_RESETS -> ZMQ_REQ_STRICT.
+
+ It defaults to enabled. Switch it off to be able to send a new message
+ before the previous reply has been received.
+
+ .gitignore | 2 +-
+ doc/zmq_setsockopt.txt | 15 ++---
+ include/zmq.h | 2 +-
+ src/req.cpp | 10 ++--
+ src/req.hpp | 4 +-
+ tests/Makefile.am | 4 +-
+ tests/test_req_send_resets.cpp | 120 ---------------------------------------
+ tests/test_req_strict.cpp | 121 ++++++++++++++++++++++++++++++++++++++++
+ 8 files changed, 140 insertions(+), 138 deletions(-)
+
+commit fe30cc6d99d82eebb4145575bc0f95888cc9ff8e
+Merge: 9f4526f f5c5955
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sat Aug 3 02:44:53 2013 -0700
+
+ Merge pull request #619 from ckamm/req-send-resets
+
+ Add ZMQ_REQ_SEND_RESETS option.
+
+commit 9f4526f59a4252f75639178d11a716a7250065ba
+Merge: 637f794 39ddc69
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Mon Jul 29 06:11:03 2013 -0700
+
+ Merge pull request #621 from hintjens/master
+
+ Added note to clarify policy for embedded apps
+
+commit 39ddc695bc99905382affa4f075f7512851665cf
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Jul 29 10:42:15 2013 +0200
+
+ Added note about tivotisation
+
+ COPYING.LESSER | 2 ++
+ 1 file changed, 2 insertions(+)
+
+commit f5c59556bd232064230b39c05d858ce69d59ae09
+Author: Christian Kamm <kamm@incasoftware.de>
+Date: Mon Jul 29 09:33:10 2013 +0200
+
+ REQ: Unset reply_pipe if it terminates.
+
+ * Fixes a terminate() call on a dangling pointer in the SEND_RESETS
+ case.
+ * Fixes recv_reply_pipe() never receiving a message once the pipe it is
+ waiting on is terminated.
+
+ src/req.cpp | 15 +++++++++++----
+ src/req.hpp | 1 +
+ 2 files changed, 12 insertions(+), 4 deletions(-)
+
+commit a0cc87a9d922dd3187f07962536ee676033e0ef8
+Author: Christian Kamm <kamm@incasoftware.de>
+Date: Sun Jul 21 13:16:47 2013 +0200
+
+ Add ZMQ_REQ_SEND_RESETS option.
+
+ This allows making a new request on a REQ socket by sending a new
+ message. Without the option set, calling send() after the first message
+ is done will continue to return an EFSM error.
+
+ It's useful for when a REQ is not getting a response. Previously that
+ meant creating a new socket or switching to DEALER.
+
+ .gitignore | 1 +
+ doc/zmq_setsockopt.txt | 30 ++++++++--
+ include/zmq.h | 1 +
+ src/req.cpp | 23 ++++++--
+ src/req.hpp | 7 ++-
+ tests/Makefile.am | 4 +-
+ tests/test_req_send_resets.cpp | 120 ++++++++++++++++++++++++++++++++++++++++
+ 7 files changed, 174 insertions(+), 12 deletions(-)
+
+commit 637f79419325952d0b3e63fe09ead81769884785
+Merge: 6473dfd b9646f2
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Fri Jul 26 15:41:29 2013 -0700
+
+ Merge pull request #620 from ckamm/req-id
+
+ Add ZMQ_REQ_REQUEST_IDS option.
+
+commit b9646f2aacf414eb30044a9be3a03d2bd9230c7f
+Author: Christian Kamm <kamm@incasoftware.de>
+Date: Fri Jul 26 21:13:43 2013 +0200
+
+ Add ZMQ_REQ_REQUEST_IDS option.
+
+ * Documentation:
+ The default behavior of REQ sockets is to rely on the ordering of messages
+ to match requests and responses and that is usually sufficient. When this option
+ is set to 1, the REQ socket will prefix outgoing messages with an extra frame
+ containing a request id. That means the full message is (request id, 0,
+ user frames...). The REQ socket will discard all incoming messages that don't
+ begin with these two frames.
+
+ * Behavior change: When a REQ socket gets an invalid reply, it used to
+ discard the message and return EAGAIN. REQ sockets still discard
+ invalid messages, but keep looking at the next one automatically
+ until a good one is found or there are no more messages.
+ * Add test_req_request_ids.
+
+ .gitignore | 1 +
+ doc/zmq_setsockopt.txt | 17 ++++
+ include/zmq.h | 1 +
+ src/req.cpp | 77 ++++++++++++++---
+ src/req.hpp | 12 +++
+ tests/Makefile.am | 4 +-
+ tests/test_req_request_ids.cpp | 179 ++++++++++++++++++++++++++++++++++++++++
+ 7 files changed, 277 insertions(+), 14 deletions(-)
+
+commit 6473dfd8f43beaa62b233f30ea839e25caf47382
+Merge: 4944095 4a5358f
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Thu Jul 18 03:26:21 2013 -0700
+
+ Merge pull request #617 from hurtonm/zap_updates
+
+ Zap updates
+
+commit 4a5358f4d0f227844b5e66a5724fd4df930b25e1
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Thu Jul 18 10:10:10 2013 +0200
+
+ Implement ZAP for NULL mechanism
+
+ src/null_mechanism.cpp | 155 +++++++++++++++++++++++++++++++++++++++++++++++-
+ src/null_mechanism.hpp | 16 ++++-
+ src/stream_engine.cpp | 3 +-
+ 3 files changed, 169 insertions(+), 5 deletions(-)
+
+commit 53bc53da04a4fb2fe666e6607c29d11bec780984
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Thu Jul 18 09:49:42 2013 +0200
+
+ Update PLAIN mechanism to the latest ZAP revision
+
+ src/plain_mechanism.cpp | 31 ++++++++++++++++++++++---------
+ src/plain_mechanism.hpp | 3 +++
+ src/stream_engine.cpp | 3 ++-
+ tests/test_security.cpp | 6 +++++-
+ 4 files changed, 32 insertions(+), 11 deletions(-)
+
+commit d65231be1ced9f6411427a1be971525e7f19f5e9
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Thu Jul 18 09:39:19 2013 +0200
+
+ Update CURVE mechanism to the latest ZAP revision
+
+ src/curve_server.cpp | 29 ++++++++++++++++++++++-------
+ src/curve_server.hpp | 3 +++
+ src/stream_engine.cpp | 6 +++++-
+ src/stream_engine.hpp | 2 ++
+ tests/test_security_curve.cpp | 5 ++++-
+ 5 files changed, 36 insertions(+), 9 deletions(-)
+
+commit 7541debe6de46308ada745e08348eb457623acba
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Thu Jul 18 09:28:56 2013 +0200
+
+ Add get_peer_ip_address utility function
+
+ The functon returns string representation of peer's
+ IP address. We will need this to update ZAP implementation.
+
+ src/ip.cpp | 40 ++++++++++++++++++++++++++++++++++++++++
+ src/ip.hpp | 7 ++++++-
+ 2 files changed, 46 insertions(+), 1 deletion(-)
+
+commit 49440952621cdea052e8539aaa0542de42f6759b
+Merge: 1068bc0 d46c2ee
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Mon Jul 15 00:15:55 2013 -0700
+
+ Merge pull request #615 from hintjens/master
+
+ Last step in test_spec_req is still failing; disabled it.
+
+commit 1068bc0795f11f6dd543997126150758c8f2b8c4
+Merge: 4fb004f 409721b
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Jul 14 14:48:17 2013 -0700
+
+ Merge pull request #616 from steve-o/master
+
+ Add static libraries to CMake, minor housekeeping.
+
+commit 409721b9d2657b937d1de6c7eca7111d16c4a125
+Author: Steven McCoy <steven.mccoy@miru.hk>
+Date: Sun Jul 14 13:58:46 2013 -0400
+
+ Add CMake support for static libraries.
+
+ CMakeLists.txt | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+commit 21fe600848a01f4014aa97b04cc301669502db69
+Author: Steven McCoy <steven.mccoy@miru.hk>
+Date: Sun Jul 14 13:36:30 2013 -0400
+
+ Move CMake dependencies together.
+
+ CMakeLists.txt | 6 +-
+ builds/cmake/Modules/FindAsciiDoc.cmake | 24 +
+ builds/cmake/Modules/TestZMQVersion.cmake | 18 +
+ builds/cmake/Modules/ZMQSourceRunChecks.cmake | 129 ++++
+ builds/cmake/NSIS.template32.in | 952 ++++++++++++++++++++++++
+ builds/cmake/NSIS.template64.in | 960 +++++++++++++++++++++++++
+ cmake/Modules/FindAsciiDoc.cmake | 24 -
+ cmake/Modules/TestZMQVersion.cmake | 18 -
+ cmake/Modules/ZMQSourceRunChecks.cmake | 129 ----
+ cmake/NSIS.template32.in | 952 ------------------------
+ cmake/NSIS.template64.in | 960 -------------------------
+ 11 files changed, 2086 insertions(+), 2086 deletions(-)
+
+commit ae86c56d74a4cc549629829714ff189369027a29
+Author: Steven McCoy <steven.mccoy@miru.hk>
+Date: Sun Jul 14 13:26:55 2013 -0400
+
+ README file moved to GitHub format and extension, drop from packaging and default to NEWS file for popup.
+
+ CMakeLists.txt | 7 +++----
+ cmake/NSIS.template32.in | 2 +-
+ cmake/NSIS.template64.in | 2 +-
+ 3 files changed, 5 insertions(+), 6 deletions(-)
+
+commit d46c2ee2fc566a6ddceae2820a552dbce1c15bff
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Jul 14 13:04:31 2013 +0200
+
+ Disabled last step in test_spec_req so build can complete
+
+ tests/test_spec_req.cpp | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+commit 4fb004f59b81a09a8b428409b61baa79b642712d
+Merge: bccf3d6 7de23c0
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Jul 14 03:00:06 2013 -0700
+
+ Merge pull request #614 from ckamm/fix-spec-req-fail
+
+ Fix intermittent failure in test_spec_req.
+
+commit 7de23c0c8dafe9305fc89203ff420da9b191d814
+Author: Christian Kamm <kamm@incasoftware.de>
+Date: Sun Jul 14 11:55:57 2013 +0200
+
+ Fix intermittent failure in test_spec_req.
+
+ There still is a problem when a stale peer's message
+ arrives at the REQ just after a request was sent to that peer.
+
+ tests/test_spec_req.cpp | 12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
+
+commit bccf3d61268b3809cb609e9c9a4ec98575fee179
+Merge: 93b9f90 bbc9a61
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Jul 14 02:32:20 2013 -0700
+
+ Merge pull request #613 from ckamm/coding-style-spec-tests
+
+ Fix coding style in spec tests.
+
+commit 93b9f9021c76c7812adb592bf29d29ad9eed2ac5
+Merge: 524bd7a c56d797
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Jul 14 02:30:21 2013 -0700
+
+ Merge pull request #608 from ckamm/req-drops-unwanted
+
+ REQ sockets drop replies from unasked peers.
+
+commit bbc9a611979aaa62c67eaa768d7f0735d1f53272
+Author: Christian Kamm <kamm@incasoftware.de>
+Date: Sun Jul 14 08:32:35 2013 +0200
+
+ Fix coding style in spec tests.
+
+ tests/test_spec_dealer.cpp | 66 +++++++++++++---------------
+ tests/test_spec_pushpull.cpp | 99 ++++++++++++++++++------------------------
+ tests/test_spec_rep.cpp | 57 +++++++++++-------------
+ tests/test_spec_req.cpp | 8 ++--
+ tests/test_spec_router.cpp | 61 ++++++++++++--------------
+ 5 files changed, 130 insertions(+), 161 deletions(-)
+
+commit c56d797bf915e0774646e651dbbce89b8e566f45
+Author: Christian Kamm <kamm@incasoftware.de>
+Date: Tue Jul 2 20:05:20 2013 +0200
+
+ REQ sockets drop replies from unasked peers.
+
+ * Add lb_t::sendpipe() that returns the pipe that was used for sending,
+ similar to fq_t::recvpipe().
+ * Add forwarder functions to dealer_t to access these two.
+ * Add logic to req_t to ignore replies on pipes that are not the one
+ where the request was sent.
+ * Enable test in test_spec_req.
+
+ AUTHORS | 1 +
+ src/dealer.cpp | 14 ++++++++++++--
+ src/dealer.hpp | 4 ++++
+ src/lb.cpp | 10 +++++++++-
+ src/lb.hpp | 7 +++++++
+ src/req.cpp | 39 +++++++++++++++++++++++++++++++++++----
+ src/req.hpp | 9 +++++++++
+ tests/test_spec_req.cpp | 3 +--
+ 8 files changed, 78 insertions(+), 9 deletions(-)
+
+commit 524bd7ac765d33e537ffcf981e7f3d06899a9aca
+Merge: 7560910 6bf4ffe
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sat Jul 13 16:27:41 2013 -0700
+
+ Merge pull request #612 from ulikoehler/markdown
+
+ Converted README to markdown
+
+commit 6bf4ffe7270d5079de5760e471595f24acdcc788
+Author: Uli Köhler <ulikoehler@online.de>
+Date: Sun Jul 14 00:55:40 2013 +0200
+
+ Converted README to markdown + added travis build img
+
+ README | 39 ---------------------------------------
+ README.md | 38 ++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 38 insertions(+), 39 deletions(-)
+
+commit 7560910f505c06d29191bdff1659133342ceadfa
+Merge: 5ac1964 0f28b72
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sat Jul 13 10:39:06 2013 -0700
+
+ Merge pull request #611 from pijyoi/master
+
+ update Makefile to include new files
+
+commit 0f28b729140900f6dcb7a560e13cbcd85537f2d1
+Author: KIU Shueng Chuan <nixchuan@gmail.com>
+Date: Sat Jul 13 14:31:46 2013 +0800
+
+ update to include stream.cpp and curve related
+
+ builds/mingw32/Makefile.mingw32 | 30 +++++++++++++++++++++++-------
+ 1 file changed, 23 insertions(+), 7 deletions(-)
+
+commit 5ac19647d9c097a7657d7532f9dfecb16f471e9c
+Merge: 08622a7 9ca6898
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Mon Jul 8 04:12:06 2013 -0700
+
+ Merge pull request #610 from hintjens/master
+
+ Problem: new spec test cases don't all work
+
+commit 9ca6898f24d3c5b4b550f7bd5c8882d2aaf4fcc7
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Jul 7 12:49:24 2013 +0200
+
+ Got new test cases working with libzmq
+
+ * disabled the specific tests that do not work (yet) on libzmq
+ * cleaned up one source (test_spec_rep.c) but the others need similar work
+ * added sleep in test_spec_rep to allow connects time to happen; this would
+ not be needed if we connected out to the REP peers instead in from them,
+ but I didn't want to change the logic of the test code.
+
+ .gitignore | 5 +++
+ tests/test_spec_dealer.cpp | 41 ++++++++----------
+ tests/test_spec_pushpull.cpp | 3 +-
+ tests/test_spec_req.cpp | 97 +++++++++++++++++++++---------------------
+ tests/test_spec_router.cpp | 3 +-
+ tests/testutil.hpp | 16 +++----
+ 6 files changed, 80 insertions(+), 85 deletions(-)
+
+commit 08622a7788f6e14cb26eb15e19f90939a0bd7696
+Merge: 5038ef7 dfba19c
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Jul 5 15:36:14 2013 -0700
+
+ Merge pull request #609 from ckamm/tests
+
+ Make pipeline/reqrep tests try tcp:// endpoints.
+
+commit dfba19c4b652fb064138f0b3c47b1f27cc8464a8
+Author: Christian Kamm <kamm@incasoftware.de>
+Date: Fri Jul 5 17:58:01 2013 +0200
+
+ Make pipeline/reqrep tests try tcp:// endpoints.
+
+ The inproc:// endpoints sometimes use different code paths so
+ testing with regular tcp:// endpoints as well can show different
+ issues.
+
+ tests/test_spec_dealer.cpp | 98 ++++++++++++++++++-------------
+ tests/test_spec_pushpull.cpp | 132 ++++++++++++++++++++++++++++++------------
+ tests/test_spec_rep.cpp | 58 ++++++++++++-------
+ tests/test_spec_req.cpp | 78 +++++++++++++++----------
+ tests/test_spec_router.cpp | 77 ++++++++++++++++--------
+ tests/testutil.hpp | 11 ++++
+ 6 files changed, 300 insertions(+), 154 deletions(-)
+
+commit 5038ef74b5bc0aa972cce80e085fcaaa64eaa536
+Merge: e093bd9 8fd163c
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Jul 5 08:18:41 2013 -0700
+
+ Merge pull request #606 from ckamm/master
+
+ Add tests for Request-Reply and Pipeline pattern sockets.
+
+commit 8fd163cf5c82eaa483a00ca31a8e0b433a696657
+Author: Christian Kamm <kamm@incasoftware.de>
+Date: Fri Jul 5 15:20:42 2013 +0200
+
+ Add tests for PUSH/PULL sockets.
+
+ tests/Makefile.am | 4 +-
+ tests/test_spec_pushpull.cpp | 250 ++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 253 insertions(+), 1 deletion(-)
+
+commit e093bd99234b37bb479889a90bcf467a1cb3fdd4
+Merge: 78e4791 7b7f7e4
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Jul 3 15:43:09 2013 -0700
+
+ Merge pull request #607 from cjuniet/master
+
+ [LIBZMQ-544] Fix compilation errors with Clang
+
+commit 7b7f7e4ebdcba8a52cdd76e4cb911ec7c6e7dbf9
+Author: Christophe Juniet <c.juniet@gmail.com>
+Date: Wed Jul 3 22:30:48 2013 +0200
+
+ Fix compilation warnings on unsigned comparisons.
+
+ Fix two unsigned comparisons to zero or more being always true. Clang
+ won't compile this with -Werror.
+
+ src/options.cpp | 4 ++--
+ src/z85_codec.hpp | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+commit 798b394087d27201e3d4a16594ea867bf5eecf08
+Author: Christian Kamm <kamm@incasoftware.de>
+Date: Tue Jul 2 15:04:31 2013 +0200
+
+ Add tests for Request-Reply pattern sockets.
+
+ * See http://rfc.zeromq.org/spec:28/REQREP
+ * Not all testable statements are covered.
+ * At this point, there are several failures:
+ - test_spec_req: The REQ socket does not correctly discard messages
+ from peers that are not currently being talked to.
+ - test_spec_dealer/router: On disconnect, the queues seem to not be
+ emptied. The DEALER can still receive a message the disconnected
+ peer sent, the ROUTER can still send to the identity of the dis-
+ connected peer.
+
+ tests/Makefile.am | 12 ++-
+ tests/test_spec_dealer.cpp | 248 ++++++++++++++++++++++++++++++++++++++++++++
+ tests/test_spec_rep.cpp | 144 +++++++++++++++++++++++++
+ tests/test_spec_req.cpp | 230 ++++++++++++++++++++++++++++++++++++++++
+ tests/test_spec_router.cpp | 180 ++++++++++++++++++++++++++++++++
+ tests/testutil.hpp | 80 +++++++++++++-
+ 6 files changed, 891 insertions(+), 3 deletions(-)
+
+commit 78e47912d2c5dd2795bf45479c0c2552e3f41d14
+Merge: 5a30022 9986106
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Jul 1 04:41:46 2013 -0700
+
+ Merge pull request #605 from ricnewton/master
+
+ Fix tab/space formatting issue
+
+commit 998610602e6c1494131680ca89030663dc62ab0c
+Author: Richard Newton <richard_newton@waters.com>
+Date: Mon Jul 1 12:10:57 2013 +0100
+
+ Fix tab/space formatting issue
+
+ tests/test_monitor.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit 5a30022045eed8eb3b10acb8bae73bcd2b1af2b0
+Merge: a3e16c1 f6e972d
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Mon Jul 1 04:08:25 2013 -0700
+
+ Merge pull request #603 from ricnewton/master
+
+ Add monitor event for when monitoring is stopped so we can unblock any sockets waiting on monitor socket.
+
+commit a3e16c18b19102e6a96f9362cbf1fd7429ba8bee
+Merge: 1cfee8d 01dd6eb
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Mon Jul 1 04:07:44 2013 -0700
+
+ Merge pull request #604 from ricnewton/cmake_fix
+
+ Fix cmake build
+
+commit 01dd6eb1103da9b38c25209ac25295aa82e8386a
+Author: Richard Newton <richard_newton@waters.com>
+Date: Mon Jul 1 11:52:39 2013 +0100
+
+ Fix cmake build
+ Fix build on windows, uint isn't a standard type, unsigned int is.
+
+ CMakeLists.txt | 1 +
+ src/z85_codec.hpp | 12 ++++++------
+ 2 files changed, 7 insertions(+), 6 deletions(-)
+
+commit f6e972d54619935835604e7bb4dd2f86564c2eab
+Author: Richard Newton <richard_newton@waters.com>
+Date: Mon Jul 1 10:31:57 2013 +0000
+
+ Fix montior tests to handle the monitor stopped event correctly
+
+ tests/test_monitor.cpp | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+commit d4d23caf326409a18cb6677dd7225f9d6550b269
+Author: Richard Newton <richard_newton@waters.com>
+Date: Mon Jul 1 11:00:46 2013 +0100
+
+ Add new socket monitor event for when socket monitoring is stopped.
+
+ include/zmq.h | 4 +++-
+ src/socket_base.cpp | 6 ++++++
+ 2 files changed, 9 insertions(+), 1 deletion(-)
+
+commit 1cfee8d1e79264e783b1ce2e48120eb8bc4ffc5b
+Merge: 2a4aef9 4671108
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Jul 1 02:14:07 2013 -0700
+
+ Merge pull request #601 from leewoosung/hotfixes/patched
+
+ [LIBZMQ-541] pub socket sending fail issue
+
+commit 2a4aef9223bb8c6b101a882f2d9182666852cd07
+Merge: 58b1082 783bb89
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Jul 1 02:06:29 2013 -0700
+
+ Merge pull request #602 from hurtonm/master
+
+ Implement socket type checking
+
+commit 783bb890a9c7184b8c8acfe7aad6a75fdd60001a
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Mon Jul 1 10:04:54 2013 +0200
+
+ Check socket types during mechanism handshake
+
+ src/curve_client.cpp | 9 ---------
+ src/curve_client.hpp | 3 ---
+ src/curve_server.cpp | 9 ---------
+ src/curve_server.hpp | 3 ---
+ src/mechanism.cpp | 48 +++++++++++++++++++++++++++++++++++++++++++----
+ src/mechanism.hpp | 4 ++++
+ src/null_mechanism.cpp | 9 ---------
+ src/null_mechanism.hpp | 4 ----
+ src/plain_mechanism.cpp | 9 ---------
+ src/plain_mechanism.hpp | 5 -----
+ tests/test_raw_sock.cpp | 2 +-
+ tests/test_stream.cpp | 4 ++--
+ 12 files changed, 51 insertions(+), 58 deletions(-)
+
+commit 4671108e571b442e5565c399c42d5e7c8f48bde8
+Author: ganesh.vr <ganesh.vr@samsung.com>
+Date: Mon Jul 1 15:57:06 2013 +0900
+
+ LIBZMQ-541 issue fix
+
+ src/dist.cpp | 13 ++++++++++---
+ 1 file changed, 10 insertions(+), 3 deletions(-)
+
+commit 58b1082467ffd7af3294052d921bd097136a4399
+Merge: 11947b1 afe9afa
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sat Jun 29 23:56:04 2013 -0700
+
+ Merge pull request #600 from hurtonm/master
+
+ Set socket buffers before establishing TCP connection
+
+commit afe9afa2a54f092327af62ce23a50547ab94e513
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Sun Jun 30 06:41:36 2013 +0200
+
+ Set socket buffers before establishing TCP connection
+
+ The window scale option carried in SYN segment is computed from socket's
+ receive buffer size. So we need to set this buffer size before calling
+ connect or bind.
+
+ src/stream_engine.cpp | 19 -------------------
+ src/tcp.cpp | 22 ++++++++++++++++++++++
+ src/tcp.hpp | 6 ++++++
+ src/tcp_connecter.cpp | 6 ++++++
+ src/tcp_listener.cpp | 6 ++++++
+ 5 files changed, 40 insertions(+), 19 deletions(-)
+
+commit 11947b1ccb8002ee715b791ded6a7f2d14bfbfe9
+Merge: a71d64a c9bdb89
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Sat Jun 29 09:36:50 2013 -0700
+
+ Merge pull request #597 from hintjens/master
+
+ Problem: working with binary keys is painful
+
+commit a71d64ab95880bd01f9d49abe8025e3e1a9c6243
+Merge: 7460d00 aef2171
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Sat Jun 29 09:34:47 2013 -0700
+
+ Merge pull request #599 from hurtonm/master
+
+ Minor code refactoring
+
+commit aef2171e8390864d484186265ba8f7237d0d368c
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Sat Jun 29 17:24:30 2013 +0200
+
+ Make last_endpoint attribute of socket object
+
+ src/options.cpp | 8 --------
+ src/options.hpp | 3 ---
+ src/socket_base.cpp | 20 +++++++++++++++-----
+ src/socket_base.hpp | 3 +++
+ 4 files changed, 18 insertions(+), 16 deletions(-)
+
+commit c9bdb893f8fd9705a79ecdeabb2e7e1a39f35816
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Sat Jun 29 11:24:46 2013 +0200
+
+ Use generic session class whenever possible
+
+ src/dealer.cpp | 12 ------------
+ src/dealer.hpp | 15 ---------------
+ src/pair.cpp | 12 ------------
+ src/pair.hpp | 15 ---------------
+ src/pub.cpp | 12 ------------
+ src/pub.hpp | 15 ---------------
+ src/pull.cpp | 12 ------------
+ src/pull.hpp | 15 ---------------
+ src/push.cpp | 12 ------------
+ src/push.hpp | 15 ---------------
+ src/rep.cpp | 12 ------------
+ src/rep.hpp | 15 ---------------
+ src/req.cpp | 8 ++++----
+ src/req.hpp | 2 +-
+ src/router.cpp | 12 ------------
+ src/router.hpp | 15 ---------------
+ src/session_base.cpp | 43 +------------------------------------------
+ src/stream.cpp | 12 ------------
+ src/stream.hpp | 15 ---------------
+ src/sub.cpp | 12 ------------
+ src/sub.hpp | 15 ---------------
+ src/xpub.cpp | 12 ------------
+ src/xpub.hpp | 15 ---------------
+ src/xsub.cpp | 12 ------------
+ src/xsub.hpp | 15 ---------------
+ 25 files changed, 6 insertions(+), 344 deletions(-)
+
+commit 7460d00bacadf8df1c173daca28ebc3ec197543c
+Merge: 1beec5e fd7e9b8
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sat Jun 29 02:36:30 2013 -0700
+
+ Merge pull request #598 from hurtonm/master
+
+ Use generic session class whenever possible
+
+commit fd7e9b8c4637679a9fe2a142771f7f977120df4a
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Sat Jun 29 11:24:46 2013 +0200
+
+ Use generic session class whenever possible
+
+ src/dealer.cpp | 12 ------------
+ src/dealer.hpp | 15 ---------------
+ src/pair.cpp | 12 ------------
+ src/pair.hpp | 15 ---------------
+ src/pub.cpp | 12 ------------
+ src/pub.hpp | 15 ---------------
+ src/pull.cpp | 12 ------------
+ src/pull.hpp | 15 ---------------
+ src/push.cpp | 12 ------------
+ src/push.hpp | 15 ---------------
+ src/rep.cpp | 12 ------------
+ src/rep.hpp | 15 ---------------
+ src/req.cpp | 8 ++++----
+ src/req.hpp | 2 +-
+ src/router.cpp | 12 ------------
+ src/router.hpp | 15 ---------------
+ src/session_base.cpp | 43 +------------------------------------------
+ src/stream.cpp | 12 ------------
+ src/stream.hpp | 15 ---------------
+ src/sub.cpp | 12 ------------
+ src/sub.hpp | 15 ---------------
+ src/xpub.cpp | 12 ------------
+ src/xpub.hpp | 15 ---------------
+ src/xsub.cpp | 12 ------------
+ src/xsub.hpp | 15 ---------------
+ 25 files changed, 6 insertions(+), 344 deletions(-)
+
+commit 70417701089e5918452996d7cbe48c89e35a39e0
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Jun 28 22:10:22 2013 +0200
+
+ Added Z85 support
+
+ The use of binary for CURVE keys is painful; you cannot easily copy
+ these in e.g. email, or use them directly in source code. There are
+ various encoding possibilities. Base16 and Base64 are not optimal.
+ Ascii85 is not safe for source (it generates quotes and escapes).
+
+ So, I've designed a new Base85 encoding, Z85, which is safe to use
+ in code and elsewhere, and I've modified libzmq to use this where
+ it also uses binary keys (in get/setsockopt).
+
+ Very simply, if you use a 32-byte value, it's Base256 (binary),
+ and if you use a 40-byte value, it's Base85 (Z85).
+
+ I've put the Z85 codec into z85_codec.hpp, it's not elegant C++
+ but it is minimal and it works. Feel free to rewrap as a real class
+ if this annoys you.
+
+ Makefile.am | 6 +--
+ configure.ac | 12 +++--
+ doc/zmq_curve.txt | 36 +++++++++++---
+ doc/zmq_getsockopt.txt | 58 +++++++++++++++++++---
+ doc/zmq_setsockopt.txt | 32 +++++++-----
+ src/Makefile.am | 1 +
+ src/options.cpp | 39 ++++++++++++++-
+ src/options.hpp | 5 +-
+ src/z85_codec.hpp | 108 +++++++++++++++++++++++++++++++++++++++++
+ tests/test_security_curve.cpp | 55 +++++++--------------
+ tools/Makefile.am | 1 +
+ tools/curve_keygen.c | 40 +++++++++++----
+ tools/z85_codec.h | 108 +++++++++++++++++++++++++++++++++++++++++
+ 13 files changed, 418 insertions(+), 83 deletions(-)
+
+commit 1beec5e960646eead85df5a91e1e9b986af0ce28
+Merge: ba1ae7d 76df045
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Fri Jun 28 05:05:54 2013 -0700
+
+ Merge pull request #596 from hintjens/master
+
+ Problem: mechanisms are lagging behind specs
+
+commit 76df0459503de64fe5fabb916420faeed2ca667c
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Jun 28 12:04:01 2013 +0200
+
+ Return EINVAL when trying to use CURVE without libsodium
+
+ src/options.cpp | 27 +++++++--------------------
+ 1 file changed, 7 insertions(+), 20 deletions(-)
+
+commit 357a9c45fbfb195a23ad42365153c279c49ea8d9
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Fri Jun 28 11:24:14 2013 +0200
+
+ Simplify ZMQ_STREAM socket implementation, part II
+
+ src/stream.cpp | 57 ++++++++++++++++++++------------------------------------
+ src/stream.hpp | 3 ---
+ 2 files changed, 20 insertions(+), 40 deletions(-)
+
+commit 7832addd202a20f65e218d74df6621147c7b8eb9
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Jun 28 11:42:54 2013 +0200
+
+ Updated security mechanisms to use variable-length commands
+
+ RFC23, RFC24, RFC26 now use variable-length command names that
+ end in null octet (valid C strings) instead of fixed-length
+ space padded strings.
+
+ src/curve_client.cpp | 32 +++++------
+ src/curve_server.cpp | 34 +++++------
+ src/mechanism.cpp | 2 +-
+ src/null_mechanism.cpp | 10 ++--
+ src/plain_mechanism.cpp | 12 ++--
+ tests/Makefile.am | 2 +-
+ tests/test_raw_sock.cpp | 19 +++---
+ tests/test_security.cpp | 128 +++++++++++------------------------------
+ tests/test_security_curve.cpp | 105 ++++++++-------------------------
+ tests/test_stream.cpp | 19 +++---
+ tests/testutil.hpp | 32 +++++++++++
+ 11 files changed, 153 insertions(+), 242 deletions(-)
+
+commit ba1ae7d639aa07bec60687bb70ff99c1a1f753d5
+Merge: fe2753d 7b27c12
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Jun 28 02:28:23 2013 -0700
+
+ Merge pull request #595 from hurtonm/master
+
+ Another ZMQ_STREAM simplification
+
+commit 7b27c125dc3025fe16b1f259695f7bbaa78ee9f0
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Fri Jun 28 11:24:14 2013 +0200
+
+ Simplify ZMQ_STREAM socket implementation, part II
+
+ src/stream.cpp | 57 ++++++++++++++++++++------------------------------------
+ src/stream.hpp | 3 ---
+ 2 files changed, 20 insertions(+), 40 deletions(-)
+
+commit dd14d4e01b5188d89fa45d0c8189cf550b22d1ae
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Jun 28 10:16:50 2013 +0200
+
+ Minor whitespace fixes in man page
+
+ doc/zmq_setsockopt.txt | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+commit c4ae74f8161b3f68f5933993bc89acc9209d4ced
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Jun 28 09:41:05 2013 +0200
+
+ Fixed zmq_errno function definition
+
+ src/zmq.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit fe2753da0af6df9931f164aedd04d9d37ebb7f66
+Merge: d8f1376 a1bb5e8
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Jun 28 01:15:02 2013 -0700
+
+ Merge pull request #594 from hurtonm/master
+
+ Simplify ZMQ_STREAM socket implementation
+
+commit a1bb5e83ffd837e9d074bf727152d62583e7a516
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Fri Jun 28 09:08:54 2013 +0200
+
+ Simplify ZMQ_STREAM socket implementation
+
+ src/stream.cpp | 87 +++++++++++++-------------------------------------------
+ src/stream.hpp | 18 ++----------
+ 2 files changed, 22 insertions(+), 83 deletions(-)
+
+commit d8f13760083bd5ae302dd8c38af9c4cd6ac4b1d3
+Merge: 4a4d222 ad77937
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Thu Jun 27 14:09:04 2013 -0700
+
+ Merge pull request #593 from hintjens/master
+
+ Problem: ROUTER+RAW was not a clean API
+
+commit ad7793795692e93595f01e12773467fb9270e9ec
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Jun 27 20:47:34 2013 +0200
+
+ Added ZMQ_STREAM socket type
+
+ - designed for TCP clients and servers
+ - added HTTP client / server example in tests/test_stream.cpp
+ - same as ZMQ_ROUTER + ZMQ_ROUTER_RAW + ZMQ_ROUTER_MANDATORY
+ - includes b893ce set ZMQ_IDENTITY on outgoing connect
+ - deprecates ZMQ_ROUTER_RAW
+
+ .gitignore | 2 +
+ doc/zmq_msg_send.txt | 2 +
+ doc/zmq_send.txt | 2 +
+ doc/zmq_sendmsg.txt | 2 +
+ doc/zmq_setsockopt.txt | 2 +
+ doc/zmq_socket.txt | 42 +++++-
+ include/zmq.h | 1 +
+ src/Makefile.am | 2 +
+ src/mechanism.cpp | 4 +-
+ src/router.cpp | 7 +-
+ src/session_base.cpp | 5 +
+ src/socket_base.cpp | 4 +
+ src/stream.cpp | 335 ++++++++++++++++++++++++++++++++++++++++++++++++
+ src/stream.hpp | 127 ++++++++++++++++++
+ tests/Makefile.am | 9 +-
+ tests/test_stream.cpp | 228 ++++++++++++++++++++++++++++++++
+ 16 files changed, 763 insertions(+), 11 deletions(-)
+
+commit 4a4d222ec45c10da66c9514713d3959c31b44709
+Merge: e9d11c6 b893ce2
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Jun 23 23:29:44 2013 -0700
+
+ Merge pull request #592 from gavinmcniff/master
+
+ Store identity for raw socket
+
+commit b893ce250301b408d040c75933993cd85560b1ce
+Author: Gavin <gavin@mcniff.ie>
+Date: Sun Jun 23 18:16:33 2013 +0100
+
+ Store identity for raw socket
+
+ Identity stored during connect procedure. Can be read using
+ zmq_getsockopt and used as the identity frame when sending messages.
+ This allows the implementation of a raw socket client.
+
+ src/router.cpp | 3 +++
+ 1 file changed, 3 insertions(+)
+
+commit e9d11c6611f76ad5aebddeaf7ca73a04d6b7d65d
+Merge: ec943ac b12be41
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Sun Jun 23 01:07:59 2013 -0700
+
+ Merge pull request #591 from hurtonm/master
+
+ Rename parse_properties to parse_metadata
+
+commit b12be41736ee4bc1e2137a8553f8183f9b60514d
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Sun Jun 23 08:52:27 2013 +0200
+
+ Rename parse_properties to parse_metadata
+
+ src/curve_client.cpp | 4 ++--
+ src/curve_server.cpp | 4 ++--
+ src/mechanism.cpp | 4 ++--
+ src/mechanism.hpp | 10 ++++++----
+ src/null_mechanism.cpp | 2 +-
+ src/plain_mechanism.cpp | 4 ++--
+ 6 files changed, 15 insertions(+), 13 deletions(-)
+
+commit ec943ac5de7a7572b84b75f41c0ba6ae2bccebb7
+Merge: 19cf076 99d4974
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Sat Jun 22 14:19:02 2013 -0700
+
+ Merge pull request #590 from hurtonm/master
+
+ Refactor how properties are parsed
+
+commit 99d4974580bb6c77c0eccf5f92afe81f761e801d
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Sat Jun 22 19:02:08 2013 +0200
+
+ Refactor how properties are parsed
+
+ src/curve_client.cpp | 43 +++++------------------------------
+ src/curve_client.hpp | 3 ++-
+ src/curve_server.cpp | 43 +++++------------------------------
+ src/curve_server.hpp | 4 +++-
+ src/mechanism.cpp | 50 +++++++++++++++++++++++++++++++++++++++++
+ src/mechanism.hpp | 14 ++++++++++++
+ src/null_mechanism.cpp | 57 +++++++++++++----------------------------------
+ src/null_mechanism.hpp | 4 ++++
+ src/plain_mechanism.cpp | 43 +++++------------------------------
+ src/plain_mechanism.hpp | 7 ++++--
+ 10 files changed, 112 insertions(+), 156 deletions(-)
+
+commit 19cf076f8c79ec511a0859d0a50b92c65a747615
+Merge: 73e1952 13df8e6
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Sat Jun 22 08:28:03 2013 -0700
+
+ Merge pull request #589 from ianbarber/master
+
+ Add test for CURVE mechanism
+
+commit 13df8e6546d85d5308657d6475bd3a867b181e70
+Merge: 211bf2b 73e1952
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Sat Jun 22 16:19:26 2013 +0100
+
+ Merge branch 'master' of git://github.com/zeromq/libzmq
+
+commit 211bf2b08e312a7f9ae1e165085f79788854df0c
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Sat Jun 22 16:17:25 2013 +0100
+
+ Added security curve test
+
+ Test is skipped if no libsodium.
+ Added warning if libsodium not configured
+
+ configure.ac | 2 +-
+ tests/Makefile.am | 2 +
+ tests/test_security_curve.cpp | 224 +++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 227 insertions(+), 1 deletion(-)
+
+commit 73e195279ae201f99b38c4afcba86c5663c0eea4
+Merge: 2bf5124 084e879
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sat Jun 22 07:25:26 2013 -0700
+
+ Merge pull request #588 from hurtonm/master
+
+ Small code cleanup
+
+commit 084e8792de2115e08a5d6bb84d176e4fe8302066
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Sat Jun 22 13:40:32 2013 +0200
+
+ Small cleanup in pipe.cpp
+
+ src/pipe.cpp | 20 ++++++++------------
+ src/pipe.hpp | 2 +-
+ 2 files changed, 9 insertions(+), 13 deletions(-)
+
+commit 2bf51247feeb02276eddb325883a993e740bfb7f
+Merge: 8bb79b5 fa0f0e2
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Sat Jun 22 07:14:28 2013 -0700
+
+ Merge pull request #587 from hurtonm/master
+
+ Make ZAP optional for CURVE mechanism
+
+commit fa0f0e21b82808383e549d872a52a1b7de7e2f37
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Sat Jun 22 16:05:34 2013 +0200
+
+ Make ZAP optional for PLAIN mechanism
+
+ src/plain_mechanism.cpp | 141 ++++++++++++++++++++++++-----------------------
+ src/plain_mechanism.hpp | 6 ++
+ 2 files changed, 78 insertions(+), 69 deletions(-)
+
+commit 8bb79b5eb1fabfd5e430fc09a29a35c661feb053
+Merge: acaaaa5 5975e00
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sat Jun 22 06:42:26 2013 -0700
+
+ Merge pull request #586 from hurtonm/master
+
+ Make ZAP optional for CURVE mechanism
+
+commit 5975e00fd1bedfcdd99664baf52fffcc7982120a
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Sat Jun 22 15:33:44 2013 +0200
+
+ Make ZAP optional for CURVE mechanism
+
+ src/curve_server.cpp | 42 ++++++++++++++++--------------------------
+ src/curve_server.hpp | 5 ++++-
+ 2 files changed, 20 insertions(+), 27 deletions(-)
+
+commit acaaaa53517cbe6f5f20b424e41a65a8240bbc5e
+Merge: 675bd46 fadfcac
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Sat Jun 22 05:19:01 2013 -0700
+
+ Merge pull request #585 from hintjens/master
+
+ Problem: allows CURVE security even if libzmq was built without libsodium
+
+commit fadfcac1dec8e3b36bf1498b0d38f818e8d233e7
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sat Jun 22 13:50:22 2013 +0200
+
+ Fixed compile error, needed unistd.h
+
+ tests/test_monitor.cpp | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+commit 1ea06883c0694486324ed9a7adc2fba4334987f7
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sat Jun 22 13:39:20 2013 +0200
+
+ Fixed spelling in comments
+
+ src/lb.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit fb43d5a0fef8349b49a573a9fc82aea4f62c95f7
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sat Jun 22 13:39:02 2013 +0200
+
+ Whitespace fix to man page
+
+ doc/zmq_setsockopt.txt | 1 +
+ 1 file changed, 1 insertion(+)
+
+commit f4848ddb32612be96eba308c3e7e3361c4c33f98
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sat Jun 22 13:38:14 2013 +0200
+
+ Prints message and exits if app tries to use CURVE without libsodium
+
+ src/options.cpp | 16 ++++++++++++++++
+ 1 file changed, 16 insertions(+)
+
+commit 675bd4640bf3646b4d8420984681948e7556d33f
+Merge: 9eb2521 1b86324
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sat Jun 22 04:18:27 2013 -0700
+
+ Merge pull request #584 from hurtonm/master
+
+ Fix test_disconnect_inproc to work on ILP64 systems
+
+commit 1b86324396fcbe77455645d2a39f5c5b696beaed
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Sat Jun 22 13:00:33 2013 +0200
+
+ Fix test_disconnect_inproc to work on ILP64 systems
+
+ tests/test_disconnect_inproc.cpp | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+commit 9eb2521537ed1fec2f7be0740b0817802e19c1a9
+Merge: 91bc740 694543e
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sat Jun 22 03:25:44 2013 -0700
+
+ Merge pull request #583 from ianbarber/master
+
+ Small stream engine issue and test_monitor tidy up
+
+commit 694543e3a20f2e6763b12c8930d6351da2c7be45
+Merge: f4c51db 91bc740
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Sat Jun 22 10:59:16 2013 +0100
+
+ Merge branch 'master' of git://github.com/zeromq/libzmq
+
+commit f4c51db842f78182a4b0392c96cd706251c770e9
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Sat Jun 22 10:58:16 2013 +0100
+
+ Fix small streamengine issue w/ term and handshake
+
+ Also tidy up monitor test a little.
+
+ src/stream_engine.cpp | 6 ++++++
+ tests/test_monitor.cpp | 23 +++++++++++++----------
+ 2 files changed, 19 insertions(+), 10 deletions(-)
+
+commit 91bc74089ff0655966c6adf566b67796ab12b5ab
+Merge: c9638fc 8af208f
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sat Jun 22 02:57:34 2013 -0700
+
+ Merge pull request #582 from hurtonm/master
+
+ Implement CurveZMQ message encryption and authentication
+
+commit 8af208fab7388c1ee37daaf4403d73a887eeb71f
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Sat Jun 22 11:48:33 2013 +0200
+
+ Implement ZMTP/3.0 CURVE mechanism
+
+ src/stream_engine.cpp | 57 +++++++++++++++++++++++++++++++++++++++++++++++--
+ src/stream_engine.hpp | 4 ++++
+ 2 files changed, 59 insertions(+), 2 deletions(-)
+
+commit e4a211870c43d9a8c96ad16c8b751b37a3cfa53d
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Sat Jun 22 11:46:40 2013 +0200
+
+ Implement CurveZMQ message encryption and authentication
+
+ src/curve_client.cpp | 107 ++++++++++++++++++++++++++++++++++++++++++++++++++
+ src/curve_client.hpp | 2 +
+ src/curve_server.cpp | 107 ++++++++++++++++++++++++++++++++++++++++++++++++++
+ src/curve_server.hpp | 2 +
+ src/mechanism.hpp | 4 ++
+ 5 files changed, 222 insertions(+)
+
+commit c9638fceb4886f13a6aeb7db7bdc521ab923a132
+Merge: c5078ea 8c0ded5
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Sat Jun 22 02:12:39 2013 -0700
+
+ Merge pull request #581 from hintjens/master
+
+ Problem: code isn't setting mechanism to CURVE properly
+
+commit 8c0ded5076d9f5afe7c272d0dcd17316af7c66d8
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sat Jun 22 11:05:01 2013 +0200
+
+ Properly set mechanism to CURVE when setting a curve option
+
+ src/options.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+commit c5078ea1b8123f74bcd9361bc52c650c7855eea5
+Merge: 92b02b9 20a7978
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Sat Jun 22 01:08:35 2013 -0700
+
+ Merge pull request #580 from hurtonm/master
+
+ Stop ZMTP handshake when an unexpected message comes
+
+commit 20a7978d679c653eb58e67753f66feb19e55c001
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Sat Jun 22 08:11:55 2013 +0200
+
+ Stop ZMTP handshake when an unexpected message comes
+
+ src/curve_client.cpp | 3 ++-
+ src/curve_server.cpp | 2 +-
+ src/plain_mechanism.cpp | 3 ++-
+ src/stream_engine.cpp | 2 --
+ 4 files changed, 5 insertions(+), 5 deletions(-)
+
+commit 92b02b98cd3d08378033eac6cb9ea347b20e8fbd
+Merge: 1fe7820 cabf4e6
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Jun 21 09:00:18 2013 -0700
+
+ Merge pull request #579 from ianbarber/master
+
+ Clean up socket_type_string
+
+commit cabf4e658f2e4ad4d18377b53566d3a4a353c274
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Fri Jun 21 16:56:45 2013 +0100
+
+ Comments to clarify the socket name function
+
+ src/mechanism.hpp | 2 ++
+ src/stream_engine.hpp | 2 --
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+commit 1fe7820629f5f8bf5441ddf810901060984da797
+Merge: c5a9fa5 10f69c1
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Thu Jun 20 11:09:20 2013 -0700
+
+ Merge pull request #577 from hintjens/master
+
+ API for CURVE configuration
+
+commit c5a9fa5b5e56ede6c794e8ca6b2bd0cab27f665d
+Merge: 65c84ab 3b355fe
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Jun 20 09:47:22 2013 -0700
+
+ Merge pull request #578 from gonzus/master
+
+ Changes to sanity tag in ctx
+
+commit 3b355fec9ac5825ccd5b241aa3e4fbdbbfb989a9
+Author: Gonzalo Diethelm <gonzalo.diethelm@diethelm.org>
+Date: Thu Jun 20 12:43:32 2013 -0400
+
+ Introduced private constants for the context sanity tag values.
+ Ignored more MSVC intermmediate files.
+
+ .gitignore | 2 +-
+ src/ctx.cpp | 9 ++++++---
+ 2 files changed, 7 insertions(+), 4 deletions(-)
+
+commit 10f69c1500af39e7405b8a07b16be11c01827d70
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Jun 20 18:30:30 2013 +0200
+
+ Clarified man pages on mixed security
+
+ doc/zmq_curve.txt | 13 ++++++++-----
+ doc/zmq_setsockopt.txt | 6 ++++--
+ 2 files changed, 12 insertions(+), 7 deletions(-)
+
+commit d9bb16725ebe52faa3655ddd39cf2b8d0c82d0a3
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Jun 20 18:09:12 2013 +0200
+
+ Added options for CURVE security
+
+ - ZMQ_CURVE_PUBLICKEY for clients and servers
+ - ZMQ_CURVE_SECRETKEY for clients
+ - ZMQ_CURVE_SERVERKEY for clients
+ - ZMQ_CURVE_SERVER for servers
+ - added tools/curve_keygen.c as example
+ - updated man pages
+
+ .gitignore | 2 ++
+ doc/zmq.txt | 6 ++--
+ doc/zmq_curve.txt | 41 ++++++++++++++++++++++------
+ doc/zmq_setsockopt.txt | 71 +++++++++++++++++++++++++++++++++++++++++++-----
+ include/zmq.h | 9 +++---
+ src/curve_client.cpp | 11 ++------
+ src/curve_server.cpp | 3 +-
+ src/options.cpp | 57 ++++++++++++++++++++++++++++++++++++++
+ src/options.hpp | 15 +++++-----
+ tools/curve_keygen.c | 47 ++++++++++++++++++++++++++++++++
+ 10 files changed, 222 insertions(+), 40 deletions(-)
+
+commit 65c84abdb538de24de4cfa9dac7b4db789a0787e
+Merge: 9273022 37b99c0
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Jun 20 05:27:49 2013 -0700
+
+ Merge pull request #576 from hurtonm/zmtp_curve
+
+ Implement ZMTP/3.0 CURVE handshake
+
+commit 37b99c0b4b706437e4298de7440c681b1b6ff218
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Tue Jun 18 23:38:24 2013 +0200
+
+ Implement ZMTP/3.0 CURVE handshake
+
+ CMakeLists.txt | 2 +
+ src/Makefile.am | 4 +
+ src/curve_client.cpp | 344 +++++++++++++++++++++++++++++++
+ src/curve_client.hpp | 109 ++++++++++
+ src/curve_server.cpp | 547 ++++++++++++++++++++++++++++++++++++++++++++++++++
+ src/curve_server.hpp | 113 +++++++++++
+ src/options.hpp | 9 +
+ 7 files changed, 1128 insertions(+)
+
+commit 927302226096c6cbbc2fec28d1e293588f35887d
+Merge: 1195092 9bd8d9a
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Jun 17 06:38:33 2013 -0700
+
+ Merge pull request #575 from murphybytes/master
+
+ Missing files in cmake generated build.
+
+commit 9bd8d9a7269c0a04704e4dda978d1486a759b1b9
+Author: John Murphy <murphybytes@gmail.com>
+Date: Sun Jun 16 18:42:51 2013 -0500
+
+ added missing files required to build
+
+ CMakeLists.txt | 3 +++
+ 1 file changed, 3 insertions(+)
+
+commit 1195092c61befa2fceb9d16780a4570ec3f9f4a7
+Merge: 5c54bc3 3832792
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Sat Jun 15 01:27:38 2013 -0700
+
+ Merge pull request #574 from pijyoi/master
+
+ fix memory leak in ipc_listener wildcard
+
+commit 38327927ceda89422ae32f9223f40a0532f60b57
+Author: xinchuan <nixchuan@gmail.com>
+Date: Sat Jun 15 16:11:50 2013 +0800
+
+ fix memory leak in tempnam() usage
+
+ src/ipc_listener.cpp | 19 ++++++++++++-------
+ 1 file changed, 12 insertions(+), 7 deletions(-)
+
+commit 5c54bc358e8d6fb1f4bc5bfc4ef64c26b84b2a4f
+Merge: 6b8569d 627190c
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Jun 10 03:34:23 2013 -0700
+
+ Merge pull request #573 from shripchenko/master
+
+ another iteration on ZMQ_PROBE_ROUTER
+
+commit 627190c8bee128032d74ce27e218e28323b535fd
+Author: shripchenko <shripchenko@intermedia.net>
+Date: Mon Jun 10 02:31:00 2013 -0700
+
+ another iteration on ZMQ_PROBE_ROUTER
+ now it properly works for ROUTER
+
+ src/dealer.cpp | 4 ++--
+ src/router.cpp | 29 +++++++++++++----------------
+ tests/test_probe_router.cpp | 4 +---
+ 3 files changed, 16 insertions(+), 21 deletions(-)
+
+commit 6b8569d78abb16f764cf366bbe62cfbc61d1c226
+Merge: 210fcbb 6ff51ee
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Fri Jun 7 07:33:25 2013 -0700
+
+ Merge pull request #572 from hintjens/master
+
+ Updated ZAP PLAIN request to follow latest draft
+
+commit 6ff51ee909fd3389f038ac5b1767a4a88716f3a6
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Jun 7 15:50:36 2013 +0200
+
+ Updated ZAP request for changed protocol draft
+
+ - username and password sent as two string frames
+ - fixed test case to match
+
+ src/plain_mechanism.cpp | 21 ++++++++++---------
+ tests/test_security.cpp | 51 +++++++++++++++++++----------------------------
+ 2 files changed, 32 insertions(+), 40 deletions(-)
+
+commit 656ff5b208bbb06335b7b32453d054d7f668636e
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Jun 7 13:28:47 2013 +0200
+
+ Small fixes to documentation
+
+ - REQ and REP sockets don't have HWM issues
+ - ZMQ_DONTWAIT applies to DEALER and PUSH only
+
+ doc/zmq_msg_send.txt | 7 ++++---
+ doc/zmq_send.txt | 7 ++++---
+ doc/zmq_sendmsg.txt | 7 ++++---
+ doc/zmq_socket.txt | 20 ++++----------------
+ 4 files changed, 16 insertions(+), 25 deletions(-)
+
+commit 210fcbbbeb927a63271374a60ed7923b2db158d0
+Merge: 7a43c02 2928c91
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Thu Jun 6 04:41:55 2013 -0700
+
+ Merge pull request #571 from hurtonm/master
+
+ Add ZAP support
+
+commit 2928c91a6dba5ba19f5e481ead40c00100169aed
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Thu Jun 6 13:13:10 2013 +0200
+
+ Implement ZAP and integrate it with PLAIN mechanism
+
+ src/i_engine.hpp | 2 +
+ src/mechanism.hpp | 3 +
+ src/pgm_receiver.hpp | 1 +
+ src/pgm_sender.hpp | 1 +
+ src/plain_mechanism.cpp | 152 ++++++++++++++++++++++++++++++++++++++++++++---
+ src/plain_mechanism.hpp | 9 ++-
+ src/session_base.cpp | 143 +++++++++++++++++++++++++++++++++++++-------
+ src/session_base.hpp | 15 +++++
+ src/stream_engine.cpp | 48 ++++++++-------
+ src/stream_engine.hpp | 8 +--
+ tests/test_security.cpp | 131 ++++++++++++++++++++++++++++++++++++++++
+ 11 files changed, 458 insertions(+), 55 deletions(-)
+
+commit 4e47084dd4ca9244158c2d55b2e6e315ee23dfc4
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Thu Jun 6 11:00:41 2013 +0200
+
+ Minor cleanups
+
+ src/pipe.cpp | 2 +-
+ src/plain_mechanism.cpp | 17 ++++++++---------
+ src/session_base.cpp | 8 ++++----
+ src/session_base.hpp | 4 ++--
+ 4 files changed, 15 insertions(+), 16 deletions(-)
+
+commit c3e40736ded9c96981ddd2e399cd1b43c9f5980f
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Tue May 28 16:49:24 2013 +0200
+
+ Rename terminated->pipe_terminated
+
+ src/dealer.cpp | 6 +++---
+ src/dealer.hpp | 2 +-
+ src/dist.cpp | 2 +-
+ src/dist.hpp | 2 +-
+ src/fq.cpp | 2 +-
+ src/fq.hpp | 2 +-
+ src/lb.cpp | 2 +-
+ src/lb.hpp | 2 +-
+ src/pair.cpp | 2 +-
+ src/pair.hpp | 2 +-
+ src/pipe.cpp | 2 +-
+ src/pipe.hpp | 2 +-
+ src/pull.cpp | 4 ++--
+ src/pull.hpp | 2 +-
+ src/push.cpp | 4 ++--
+ src/push.hpp | 2 +-
+ src/router.cpp | 4 ++--
+ src/router.hpp | 2 +-
+ src/session_base.cpp | 2 +-
+ src/session_base.hpp | 2 +-
+ src/socket_base.cpp | 4 ++--
+ src/socket_base.hpp | 4 ++--
+ src/xpub.cpp | 4 ++--
+ src/xpub.hpp | 2 +-
+ src/xsub.cpp | 6 +++---
+ src/xsub.hpp | 2 +-
+ 26 files changed, 36 insertions(+), 36 deletions(-)
+
+commit 7a43c02aaf331e3821fdf15841798ca5512d9e65
+Merge: d5f6036 a9679da
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Thu Jun 6 01:18:37 2013 -0700
+
+ Merge pull request #570 from hintjens/master
+
+ Packaging of probe function
+
+commit a9679da764a279b368603b9160c0f81a419c2160
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Jun 5 15:55:15 2013 +0200
+
+ Packaging on ZMQ_PROBE_ROUTER
+
+ - renamed to ZMQ_PROBE_ROUTER
+
+ .gitignore | 2 +-
+ doc/zmq_setsockopt.txt | 14 ++++----
+ include/zmq.h | 2 +-
+ src/dealer.cpp | 14 ++++----
+ src/dealer.hpp | 4 +--
+ src/router.cpp | 16 ++++-----
+ src/router.hpp | 4 +--
+ tests/Makefile.am | 4 +--
+ tests/test_probe_router.cpp | 77 +++++++++++++++++++++++++++++++++++++++++++
+ tests/test_router_probe.cpp | 75 -----------------------------------------
+ 10 files changed, 105 insertions(+), 107 deletions(-)
+
+commit 2344131db3800e95a05e3ed11ca0e31aed468166
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Jun 5 15:25:52 2013 +0200
+
+ Packaging of ZMQ_PROBE
+
+ - Cleaned up man page a little
+ - Wrote test case tests/test_router_probe.cpp
+
+ .gitignore | 1 +
+ doc/zmq_setsockopt.txt | 26 ++++++++-------
+ tests/Makefile.am | 2 ++
+ tests/test_router_probe.cpp | 75 +++++++++++++++++++++++++++++++++++++++++++
+ 4 files changed, 92 insertions(+), 12 deletions(-)
+
+commit dbd58f8e151681dfe210af93be3e2b72c10dc40f
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Jun 5 12:42:25 2013 +0200
+
+ Fixed out-of-date reference
+
+ doc/zmq_socket.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 9c980e17dd6f83bc01f9b4442fe90d53e9562850
+Author: shripchenko <shripchenko@intermedia.net>
+Date: Fri May 24 07:09:53 2013 -0700
+
+ changed option name. +documentation changes
+
+ doc/zmq_setsockopt.txt | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+commit 97324398a7d647c3a2cdba7597db2b8057c60c30
+Author: shripchenko <shripchenko@intermedia.net>
+Date: Thu May 23 01:49:40 2013 -0700
+
+ refactored ZMQ_ROUTER_ANNOUNCE_SELF code. renamed it to ZMQ_PROBE_NEW_PEERS.
+ implement it for DEALER tocket.
+ +documentation
+
+ doc/zmq_setsockopt.txt | 10 ++++------
+ src/dealer.cpp | 6 +++---
+ src/router.cpp | 7 +++++--
+ 3 files changed, 12 insertions(+), 11 deletions(-)
+
+commit d5f603690f48c219c35419726f796a9ceb4de369
+Merge: d1f011d 42ab0e8
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sat Jun 1 01:08:48 2013 -0700
+
+ Merge pull request #569 from jpoliv/master
+
+ Make "./configure --with-system-pgm" detect the OpenPGM 5.2 system library.
+
+commit 42ab0e82176f98aa80bed1e874dd36b72bc314b4
+Author: Jose Pedro Oliveira <jpo@di.uminho.pt>
+Date: Sat Jun 1 03:39:40 2013 +0100
+
+ Make
+ ./configure --with-system-pgm
+ detect the OpenPGM 5.2 system library.
+
+ Note that OpenPGM installs a versioned pkgconfig file
+ (openpgm-5.2.pc, openpgm-5.1.pc).
+
+ configure.ac | 16 ++++++++++++----
+ 1 file changed, 12 insertions(+), 4 deletions(-)
+
+commit d1f011d7e5087649b51e0e6dde9c8e8832e7ea86
+Merge: 6caa173 43d0497
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri May 31 16:14:02 2013 -0700
+
+ Merge pull request #568 from jmgao/patch-2
+
+ Fold constant expression into constant.
+
+commit 43d049741f86a2385d7743d6065336d971c73118
+Author: Josh Gao <jgao@mobileiron.com>
+Date: Fri May 31 13:22:51 2013 -0700
+
+ Fix mistaken use of xor in "2^31 - 1".
+
+ src/mechanism.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 6caa17373b766a002e32906c6cacea0f743114a2
+Merge: 240eff3 9a0b2c8
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed May 29 14:13:13 2013 -0700
+
+ Merge pull request #567 from ianbarber/master
+
+ Fixed memory leak in stream engine
+
+commit 9a0b2c897039b6fa35287e065b3803104b622ac2
+Author: Ian Barber <ianbarber@google.com>
+Date: Wed May 29 21:58:20 2013 +0100
+
+ Pieter's change to fix memory leak on mechanism
+
+ src/stream_engine.cpp | 2 ++
+ 1 file changed, 2 insertions(+)
+
+commit 240eff384aa924e366c1709f41b9afa94d0d7890
+Merge: 9d63ebf f805e4d
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed May 29 09:03:54 2013 -0700
+
+ Merge pull request #563 from shripchenko/master
+
+ Refactoring of 'ZMQ_ROUTER_ANNOUNCE_SELF'
+
+commit 9d63ebf6d624d374bedfe0d9050d145665a0c92c
+Merge: f781eb7 4e4803e
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue May 28 04:51:47 2013 -0700
+
+ Merge pull request #564 from hurtonm/master
+
+ Rename pipe states so they are more mnemonic
+
+commit 4e4803e07faad51b17fe05bddad300e863ed1afa
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Tue May 28 13:18:19 2013 +0200
+
+ Rename pipe states to make it more mnemonic
+
+ src/pipe.cpp | 76 ++++++++++++++++++++++++++++++----------------------------
+ src/pipe.hpp | 30 ++++++++++++-----------
+ 2 files changed, 56 insertions(+), 50 deletions(-)
+
+commit f805e4dd03d012e644b4153866c70e99490b0349
+Author: shripchenko <shripchenko@intermedia.net>
+Date: Fri May 24 07:09:53 2013 -0700
+
+ changed option name. +documentation changes
+
+ doc/zmq_setsockopt.txt | 10 ++++++----
+ include/zmq.h | 2 +-
+ src/dealer.cpp | 2 +-
+ src/router.cpp | 2 +-
+ 4 files changed, 9 insertions(+), 7 deletions(-)
+
+commit aec989fb5dcdbd9043057c94035621dbac8b8e33
+Author: shripchenko <shripchenko@intermedia.net>
+Date: Thu May 23 02:02:18 2013 -0700
+
+ small refactoring
+
+ src/dealer.cpp | 6 +++---
+ src/router.cpp | 7 ++-----
+ 2 files changed, 5 insertions(+), 8 deletions(-)
+
+commit 51750a7d2a0ddceb1c51096cac7cd79a442bce42
+Author: shripchenko <shripchenko@intermedia.net>
+Date: Thu May 23 01:49:40 2013 -0700
+
+ refactored ZMQ_ROUTER_ANNOUNCE_SELF code. renamed it to ZMQ_PROBE_NEW_PEERS.
+ implement it for DEALER tocket.
+ +documentation
+
+ doc/zmq_setsockopt.txt | 15 +++++++++++++++
+ include/zmq.h | 2 +-
+ src/dealer.cpp | 41 ++++++++++++++++++++++++++++++++++++++++-
+ src/dealer.hpp | 4 ++++
+ src/router.cpp | 35 ++++++++++++++++++++++-------------
+ src/router.hpp | 8 ++++----
+ 6 files changed, 86 insertions(+), 19 deletions(-)
+
+commit f781eb7e7bb53c8fa7bd5f9ff1116c7abadc2076
+Merge: 13643b2 fbd1729
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Wed May 22 07:05:20 2013 -0700
+
+ Merge pull request #562 from hintjens/master
+
+ Removed tracing on router option setting
+
+commit fbd1729cbda254442c48c272f827c1f7bbaad551
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed May 22 00:17:03 2013 +0200
+
+ Removed tracing for Travis builds
+
+ src/router.cpp | 6 ------
+ 1 file changed, 6 deletions(-)
+
+commit 13643b2aec307fb7d799fe0371e88918f9875b40
+Merge: d113495 910b469
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue May 21 14:32:05 2013 -0700
+
+ Merge pull request #561 from shripchenko/master
+
+ Add ROUTER socket option to introduce self(send an empty message) to new peers, to allow ROUTER<->ROUTER auto-discovery problem.
+
+commit 910b46922419c0622a5917ea02f6af820b14c578
+Merge: ed3a115 ec7f711
+Author: shripchenko <shripchenko@intermedia.net>
+Date: Tue May 21 10:26:11 2013 -0700
+
+ Merge branch 'master' of https://github.com/shripchenko/libzmq
+
+commit ed3a115da9111766d010f45db615503def10dfed
+Author: shripchenko <shripchenko@intermedia.net>
+Date: Tue May 21 10:20:24 2013 -0700
+
+ Add ROUTER socket option to introduce self(send an empty message) to new peers, to allow ROUTER<->ROUTER auto-discovery problem.
+
+ include/zmq.h | 1 +
+ src/router.cpp | 19 ++++++++++++++++++-
+ src/router.hpp | 3 +++
+ 3 files changed, 22 insertions(+), 1 deletion(-)
+
+commit ec7f711c5883299eb4062fd98adb239ba1c06320
+Author: root <root@ast-pbx-mt-3.intermedia.net>
+Date: Tue May 21 10:20:24 2013 -0700
+
+ Add ROUTER socket option to introduce self(send an empty message) to new peers, to allow ROUTER<->ROUTER auto-discovery problem.
+
+ include/zmq.h | 1 +
+ src/router.cpp | 19 ++++++++++++++++++-
+ src/router.hpp | 3 +++
+ 3 files changed, 22 insertions(+), 1 deletion(-)
+
+commit c7c865da75c8ba2d7db2455e4a9ce273f54e197f
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue May 21 18:52:44 2013 +0200
+
+ Whitespace fixes
+
+ tests/test_connect_delay.cpp | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+commit d11349550092bc50cfe3984cddc73a4db15b4d24
+Merge: 536ea4f 4112693
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue May 21 09:03:51 2013 -0700
+
+ Merge pull request #560 from hintjens/master
+
+ Working on Travis builds
+
+commit 4112693051909cbfee5d9ab8a5c7f895f65f547b
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue May 21 15:15:16 2013 +0200
+
+ Cleaned up router option code
+ - made consistent with options.cpp code
+ - added trace print for ongoing issue with Travis CI builds
+
+ src/router.cpp | 51 +++++++++++++++++++++++++++++++++------------------
+ 1 file changed, 33 insertions(+), 18 deletions(-)
+
+commit 536ea4fc24f08f2821449ea2f8b05fc87ce58647
+Merge: e9e44c6 bf96cb4
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Tue May 21 00:39:58 2013 -0700
+
+ Merge pull request #559 from hintjens/master
+
+ Adding support for Travis CI
+
+commit bf96cb44e24faf2ae3c3983263c0693d156b369b
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue May 21 09:32:13 2013 +0200
+
+ Fixed name of Travis file
+
+ .travis.yaml | 2 --
+ .travis.yml | 2 ++
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+commit 59a164d2b5beafce60971b5a35902e69581e0aa2
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue May 21 09:20:39 2013 +0200
+
+ Added support for Travis CI
+
+ .travis.yaml | 2 ++
+ 1 file changed, 2 insertions(+)
+
+commit e9e44c6b09e4bada7ec89b45bf116722d784dbdf
+Merge: 5d2a8b1 31ee92f
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Sun May 19 02:05:57 2013 -0700
+
+ Merge pull request #558 from hintjens/master
+
+ stdint.h isn't available on all platforms
+
+commit 31ee92f2fda594be8be57652a4fd5f83720f0ee8
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun May 19 10:01:33 2013 +0100
+
+ stdint.h is not available on all platforms
+
+ include/zmq.h | 16 +++++++++++++++-
+ src/mechanism.hpp | 3 +--
+ 2 files changed, 16 insertions(+), 3 deletions(-)
+
+commit 73562112b831c61c95688d7ce3957ab2193b475d
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sat May 18 11:53:20 2013 +0100
+
+ Whitespace fixes
+
+ src/plain_mechanism.cpp | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
+
+commit fa5c0e18e304946cdad4fa747f52af141a561934
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sat May 18 11:53:10 2013 +0100
+
+ Trivial fix to man page
+
+ doc/zmq_curve.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 5d2a8b18e5fabe748b7dc3a00ef5420a6915dc27
+Merge: 342e576 f06abca
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Fri May 17 09:46:53 2013 -0700
+
+ Merge pull request #557 from hintjens/master
+
+ Added as_server to options
+
+commit f06abca04683d0e50e298cb5617b5afdbed562ee
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri May 17 17:26:54 2013 +0100
+
+ Disable failing test for now
+
+ tests/test_security.cpp | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+commit f909b9c7222a8265cfeb8538900add46abd0f2f7
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri May 17 17:46:30 2013 +0200
+
+ plain_mechanism now uses options.as_server
+ - we need to switch to PLAIN according to options.mechanism
+ - we need to catch case when both peers are as-server (or neither is)
+ - and to use username/password from options, for client
+
+ src/ipc_connecter.cpp | 2 +-
+ src/ipc_listener.cpp | 2 +-
+ src/options.cpp | 10 ++--
+ src/options.hpp | 3 +-
+ src/plain_mechanism.cpp | 123 +++++++++++++++++++++--------------------------
+ src/plain_mechanism.hpp | 2 +-
+ src/stream_engine.cpp | 10 ++--
+ src/stream_engine.hpp | 4 +-
+ src/tcp_connecter.cpp | 2 +-
+ src/tcp_listener.cpp | 2 +-
+ tests/test_security.cpp | 84 +++++++++++++++++++++++++-------
+ 11 files changed, 140 insertions(+), 104 deletions(-)
+
+commit da1e9a178a0651431d20ec440b5a366ea7153ba4
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu May 16 20:29:55 2013 +0200
+
+ Cleaned up test pingpong code
+
+ tests/testutil.hpp | 48 ++++++++++++++++++++++++++----------------------
+ 1 file changed, 26 insertions(+), 22 deletions(-)
+
+commit 342e576ec83653a51fb788cf68aec095ed1794f5
+Merge: fbcbb06 182a224
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri May 17 09:20:16 2013 -0700
+
+ Merge pull request #556 from hurtonm/master
+
+ Use socket options to select security mechanism
+
+commit 182a224bb0607c59a5951034e994fdaf72a96450
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Fri May 17 15:49:26 2013 +0200
+
+ Use socket options to select security mechanism
+
+ src/plain_mechanism.cpp | 11 +++++------
+ src/stream_engine.cpp | 8 ++++++--
+ 2 files changed, 11 insertions(+), 8 deletions(-)
+
+commit fbcbb06b466865a87264a2b7263d41ce57200dbf
+Merge: 593010f e1f797b
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed May 15 08:56:06 2013 -0700
+
+ Merge pull request #555 from hintjens/master
+
+ Added options for PLAIN security
+
+commit e1f797b0482d7887bd44238bdec28194b0c83628
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed May 15 17:54:03 2013 +0200
+
+ Added configuration for PLAIN security
+
+ * ZMQ_PLAIN_SERVER, ZMQ_PLAIN_USERNAME, ZMQ_PLAIN_PASSWORD options
+ * Man page changes to zmq_setsockopt and zmq_getsockopt
+ * Man pages for ZMQ_NULL, ZMQ_PLAIN, and ZMQ_CURVE
+ * Test program test_security
+
+ .gitignore | 1 +
+ doc/Makefile.am | 5 +-
+ doc/zmq.txt | 17 ++
+ doc/zmq_curve.txt | 40 +++
+ doc/zmq_getsockopt.txt | 58 ++++-
+ doc/zmq_null.txt | 27 ++
+ doc/zmq_plain.txt | 37 +++
+ doc/zmq_setsockopt.txt | 76 +++++-
+ include/zmq.h | 12 +
+ src/options.cpp | 631 ++++++++++++++++++++++++-----------------------
+ src/options.hpp | 9 +-
+ src/zmq.cpp | 4 +-
+ tests/Makefile.am | 2 +
+ tests/test_security.cpp | 117 +++++++++
+ 14 files changed, 710 insertions(+), 326 deletions(-)
+
+commit 8ea779c8f72e72ee1a62a5703d32ddc79972761a
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed May 15 14:11:15 2013 +0200
+
+ Fixed sizeof usage in man pages
+
+ doc/zmq_msg_recv.txt | 2 +-
+ doc/zmq_recvmsg.txt | 2 +-
+ doc/zmq_setsockopt.txt | 4 ++--
+ 3 files changed, 4 insertions(+), 4 deletions(-)
+
+commit 593010fbeb965a1b945d16c7e887c8b0065b2499
+Merge: 131b0a7 4eecda8
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue May 14 14:02:52 2013 -0700
+
+ Merge pull request #554 from hurtonm/master
+
+ Implement ZMTP/3.0 PLAIN mechanism
+
+commit 4eecda8af371b8c6afd43d499c86ae79aa788a05
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Tue May 14 10:41:37 2013 +0200
+
+ Implement ZMTP/3.0 PLAIN mechanism
+
+ This implements protocol handshake.
+ We still need to design and implement 1) API changes so a user
+ can set username and password, and 2) a mechanism for engine
+ to authenticate users.
+
+ src/Makefile.am | 2 +
+ src/ipc_connecter.cpp | 3 +-
+ src/ipc_listener.cpp | 3 +-
+ src/plain_mechanism.cpp | 359 +++++++++++++++++++++++++++++++++++++++++++++++
+ src/plain_mechanism.hpp | 74 ++++++++++
+ src/stream_engine.cpp | 15 +-
+ src/stream_engine.hpp | 6 +-
+ src/tcp_connecter.cpp | 3 +-
+ src/tcp_listener.cpp | 3 +-
+ 9 files changed, 460 insertions(+), 8 deletions(-)
+
+commit d47295db708cb19a46070bc5f88d76d117abc339
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Mon May 13 22:34:27 2013 +0200
+
+ Abstract security mechanism
+
+ src/Makefile.am | 4 ++
+ src/mechanism.cpp | 73 +++++++++++++++++++
+ src/mechanism.hpp | 73 +++++++++++++++++++
+ src/null_mechanism.cpp | 152 +++++++++++++++++++++++++++++++++++++++
+ src/null_mechanism.hpp | 51 +++++++++++++
+ src/stream_engine.cpp | 185 ++++++++++++------------------------------------
+ src/stream_engine.hpp | 11 +--
+ 7 files changed, 406 insertions(+), 143 deletions(-)
+
+commit 131b0a7148eaf7abda8a234aa60028136b178c74
+Merge: 3ef3b94 e918fd4
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Wed May 8 11:51:02 2013 -0700
+
+ Merge pull request #553 from hintjens/master
+
+ Some changes to building and packaging
+
+commit e918fd4d694c795e32327bf6383b3d4b9c97bb17
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue May 7 14:47:07 2013 +0200
+
+ Use correct libsodium call for detection
+
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit ff268b7c8a364a29cfb7e90dd943bef46502fe50
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue May 7 14:44:55 2013 +0200
+
+ Fixed packaging for Windows - was missing errno sources
+
+ builds/msvc/Makefile.am | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+commit fa346fddd39369fe93478ecf5ac87f54ec4adb72
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sat Apr 27 17:08:32 2013 +0200
+
+ Added configure check for libsodium
+
+ configure.ac | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+commit 3ef3b9405c9994533eba9dd39be2b9f85cc7cdd8
+Merge: df01235 a7032e9
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Apr 28 09:37:23 2013 -0700
+
+ Merge pull request #552 from hurtonm/master
+
+ Implement ZMTP/3.0 NULL mechanism
+
+commit a7032e9ca8a75fea4c599c51dd9fce5e9ca7c9f3
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Sun Apr 28 10:40:52 2013 +0200
+
+ Update test_raw_sock to work with ZMTP/3.0
+
+ tests/test_raw_sock.cpp | 57 ++++++++++++++++++++++++++++++++++-------------
+ 1 file changed, 41 insertions(+), 16 deletions(-)
+
+commit cd4d8bb15a18831e1f4d45f2c5bee11d0c30b436
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Sun Apr 28 10:15:25 2013 +0200
+
+ Implement ZMTP/3.0 NULL mechanism
+
+ src/stream_engine.cpp | 203 +++++++++++++++++++++++++++++++++++++++++++++++--
+ src/stream_engine.hpp | 33 ++++++--
+ 2 files changed, 224 insertions(+), 12 deletions(-)
+
+commit df012358712d4ec150a264edd0d80d4c9339cb9d
+Merge: 522765b cb2ee7a
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Sat Apr 27 06:27:24 2013 -0700
+
+ Merge pull request #551 from hintjens/master
+
+ zmq_msg_close clarification in man pages
+
+commit cb2ee7a5c21d50289ffc82a5417c6e39999e25e7
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sat Apr 27 14:52:19 2013 +0200
+
+ Fixed up test_iov case
+
+ .gitignore | 1 +
+ tests/Makefile.am | 3 ++-
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+commit 7e129a405ce42724df42cfbd2102e5938b3595cd
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sat Apr 27 12:48:29 2013 +0200
+
+ Clarified zmq_msg_close not needed after zmq_msg_send
+
+ doc/zmq_msg_close.txt | 3 ++-
+ doc/zmq_msg_send.txt | 3 ++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+commit 522765be1ee7a32e687a3777c969a7a310fe1d09
+Merge: 0bf5a31 56ead84
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Apr 25 14:28:11 2013 -0700
+
+ Merge pull request #550 from JonDyte/iovec
+
+ Experimental function zmq_recviov doesnt work correctly in a couple of c...
+
+commit 56ead8449092ef2f6ea056f1d070dd7c73af29c5
+Author: Jon Dyte <jon@totient.co.uk>
+Date: Thu Apr 25 21:58:26 2013 +0100
+
+ Experimental function zmq_recviov doesnt work correctly in a couple of cases
+ 1) VSM - you cannot hand out the 'data' address as it was not allocated on the heap
+ 2) for other messages the 'data' address cannot be handed out either, as it not the address
+ originally returned by malloc and hence cannot be passed to 'free'.
+ see msg.cpp
+ u.lmsg.content = (content_t*) malloc (sizeof (content_t) + size_);
+ ....
+ u.lmsg.content->data = u.lmsg.content + 1;
+
+ So the function is changed to always malloc a data buffer and copy the data into it.
+ There is a possible optimisation using memmove for the non-VSM case but that is not done yet.
+
+ src/zmq.cpp | 23 +++++------
+ tests/Makefile.am | 3 +-
+ tests/test_iov.cpp | 111 ++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 125 insertions(+), 12 deletions(-)
+
+commit 0bf5a31494604f6d1769b458bf410a2fdd0425c1
+Merge: 9703dd8 b5e5e10
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Tue Apr 23 17:20:04 2013 -0700
+
+ Merge pull request #549 from methodmissing/sigpipe-declare-err
+
+ Fix return code redeclaration for platforms with SO_NOSIGPIPE
+
+commit b5e5e101263d6ab7ccb14eaa3944e9a4a3aab3e1
+Author: Lourens Naudé <lourens@methodmissing.com>
+Date: Tue Apr 23 22:58:28 2013 +0100
+
+ Fix return code redeclaration for platforms with SO_NOSIGPIPE
+
+ src/stream_engine.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 9703dd806a4bf70377edce9c6916109efd9c1df7
+Merge: 0880d5b 710f38f
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Tue Apr 23 05:28:25 2013 -0700
+
+ Merge pull request #548 from hintjens/master
+
+ Fixed issue LIBZMQ-526
+
+commit 710f38f1cca6e2fc4d886541073325c09e074c33
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Apr 22 15:12:53 2013 +0200
+
+ Fixed syntax error
+
+ src/tcp_connecter.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit f4dbccd4fb230c6f911c518619cf97b84fa20dbb
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Apr 22 14:50:56 2013 +0200
+
+ Fix for LIBZMQ-526
+
+ src/tcp_connecter.cpp | 23 ++++++++++++++++-------
+ 1 file changed, 16 insertions(+), 7 deletions(-)
+
+commit 0880d5b8ed976305e98a4748af2f1c7926dedf46
+Merge: d0c58d2 f0cf409
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Thu Apr 18 08:30:50 2013 -0700
+
+ Merge pull request #547 from hintjens/master
+
+ Fixed issue LIBZMQ-525
+
+commit f0cf4095b5055eb41e9cd8f841542944ddf7e771
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Apr 18 17:23:57 2013 +0200
+
+ Fixed issue #525 - multipart upstreaming from xsub to xpub
+
+ src/xpub.cpp | 36 +++++++++++++++++++++---------------
+ src/xpub.hpp | 4 ++--
+ src/xsub.cpp | 2 +-
+ 3 files changed, 24 insertions(+), 18 deletions(-)
+
+commit d0c58d24093264ace762b2a846b8996e21f9b507
+Merge: f4a07b3 9df7c70
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Mon Apr 15 11:01:37 2013 -0700
+
+ Merge pull request #546 from hintjens/master
+
+ Throughput perf test was borked, fixed it
+
+commit 9df7c70abad3b572b8201dca666a055bd3fadf57
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Apr 15 17:21:58 2013 +0200
+
+ Cleaned up copyright statements in perftest tools
+
+ perf/inproc_lat.cpp | 4 +---
+ perf/local_lat.cpp | 4 +---
+ perf/remote_lat.cpp | 4 +---
+ 3 files changed, 3 insertions(+), 9 deletions(-)
+
+commit c980820d29d483da05e203858bd1a38b718f334f
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Apr 15 17:18:03 2013 +0200
+
+ I'm reverting the various changes to the throughput test programs since as far
+ as I can see, these didn't work any more. At the very least, the command line
+ API was broken and forced the user to enter new, exotic arguments. Patches
+ should not break existing APIs. But also, the internals of these programs had
+ become weird.
+
+ If we want to build more complex performance tests, that's fine, but we should
+ make new programs, not break the old ones. We need minimal, safe performance
+ tests in 0MQ.
+
+ Also, the code was quite horrid. So it's gone. If anyone wants to bring it back
+ please make the code neat, and build new APIs instead of breaking the old ones.
+
+ Cheers
+ Pieter
+
+ perf/local_thr.cpp | 283 +++++++----------------------------------
+ perf/remote_thr.cpp | 348 ++++++---------------------------------------------
+ 2 files changed, 86 insertions(+), 545 deletions(-)
+
+commit 67e02ca8bc78208befd10c6b45bba50e2d6e93ed
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Apr 11 18:53:02 2013 +0200
+
+ Use of named authors on man pages is no longer a good idea since it puts off
+ contributors and doesn't reflect the real process. I've taken out all named
+ authors and referred to the contribution policy. Hopefully this will improve
+ the contributions to the man pages.
+
+ doc/zmq.txt | 4 ++--
+ doc/zmq_bind.txt | 4 ++--
+ doc/zmq_close.txt | 4 ++--
+ doc/zmq_connect.txt | 4 ++--
+ doc/zmq_ctx_destroy.txt | 3 ++-
+ doc/zmq_ctx_get.txt | 3 ++-
+ doc/zmq_ctx_new.txt | 3 ++-
+ doc/zmq_ctx_set.txt | 3 ++-
+ doc/zmq_ctx_term.txt | 3 ++-
+ doc/zmq_disconnect.txt | 4 ++--
+ doc/zmq_errno.txt | 4 ++--
+ doc/zmq_getsockopt.txt | 4 ++--
+ doc/zmq_init.txt | 4 ++--
+ doc/zmq_inproc.txt | 4 ++--
+ doc/zmq_ipc.txt | 8 ++------
+ doc/zmq_msg_close.txt | 4 ++--
+ doc/zmq_msg_copy.txt | 4 ++--
+ doc/zmq_msg_data.txt | 4 ++--
+ doc/zmq_msg_get.txt | 4 ++--
+ doc/zmq_msg_init.txt | 4 ++--
+ doc/zmq_msg_init_data.txt | 4 ++--
+ doc/zmq_msg_init_size.txt | 4 ++--
+ doc/zmq_msg_more.txt | 4 ++--
+ doc/zmq_msg_move.txt | 4 ++--
+ doc/zmq_msg_recv.txt | 5 ++---
+ doc/zmq_msg_send.txt | 5 ++---
+ doc/zmq_msg_set.txt | 3 ++-
+ doc/zmq_msg_size.txt | 4 ++--
+ doc/zmq_pgm.txt | 5 +++--
+ doc/zmq_poll.txt | 4 ++--
+ doc/zmq_proxy.txt | 3 ++-
+ doc/zmq_recv.txt | 5 ++---
+ doc/zmq_recvmsg.txt | 5 ++---
+ doc/zmq_send.txt | 4 ++--
+ doc/zmq_sendmsg.txt | 5 ++---
+ doc/zmq_setsockopt.txt | 6 ++++--
+ doc/zmq_socket.txt | 6 ++++--
+ doc/zmq_socket_monitor.txt | 4 ++--
+ doc/zmq_strerror.txt | 5 +++--
+ doc/zmq_tcp.txt | 4 ++--
+ doc/zmq_term.txt | 4 ++--
+ doc/zmq_unbind.txt | 4 ++--
+ doc/zmq_version.txt | 5 +++--
+ 43 files changed, 93 insertions(+), 88 deletions(-)
+
+commit f4a07b3951979a3cb3dc00f499211dfea4e29bc6
+Merge: c5721f9 e52c436
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Apr 14 14:27:32 2013 -0700
+
+ Merge pull request #545 from hurtonm/master
+
+ Interoperate with higher versions of ZMTP protocol
+
+commit e52c43625281f077dda2d584a16692150fd44486
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Sun Apr 14 22:47:17 2013 +0200
+
+ Interoperate with higher versions of ZMTP protocol
+
+ src/stream_engine.cpp | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+commit c5721f99883d27bd52bf85092df8ff2cca93f3b5
+Merge: d2b5f1f d079190
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sat Apr 13 02:55:02 2013 -0700
+
+ Merge pull request #544 from steve-o/libzmq-446
+
+ [#LIBZMQ-446] Silence error on setting PGM_TOS on REL 4.
+
+commit d079190efa9de7e4a9eb61b005b18a0b54671d72
+Author: Steven McCoy <steven.mccoy@miru.hk>
+Date: Fri Apr 12 23:55:04 2013 -0400
+
+ [#LIBZMQ-446] Silence error on setting PGM_TOS due to some platforms raising an error at runtime. Noted are RHEL 4.
+
+ src/pgm_socket.cpp | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+commit d2b5f1f49ecc78635c8239c6e066f878fb91624a
+Merge: a3713cb a432ea1
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Apr 12 13:22:41 2013 -0700
+
+ Merge pull request #543 from steve-o/vc110_fix
+
+ MSVC local_thr & remote_thr dependency fix
+
+commit a432ea14d220eb24a494571994b2b8591cf6b296
+Author: Steven McCoy <steven.mccoy@miru.hk>
+Date: Fri Apr 12 11:59:24 2013 -0400
+
+ Add vc80 project dependency on platform.hpp for local & remote throughput tests.
+
+ builds/msvc/c_local_thr/c_local_thr.vcproj | 2 ++
+ builds/msvc/c_remote_thr/c_remote_thr.vcproj | 2 ++
+ 2 files changed, 4 insertions(+)
+
+commit cd31f67a806839e68ce407b417cd389fe9e961a9
+Author: Steven McCoy <steven.mccoy@miru.hk>
+Date: Fri Apr 12 11:55:27 2013 -0400
+
+ Add platform.hpp as project dependency to vc100 and vc110 projects for local & remote throughput tests.
+
+ builds/msvc/c_local_thr/c_local_thr.vcxproj | 20 ++++++++++++++++++++
+ builds/msvc/c_local_thr/c_local_thr11.vcxproj | 22 +++++++++++++++++++++-
+ builds/msvc/c_remote_thr/c_remote_thr.vcxproj | 20 ++++++++++++++++++++
+ builds/msvc/c_remote_thr/c_remote_thr11.vcxproj | 22 +++++++++++++++++++++-
+ 4 files changed, 82 insertions(+), 2 deletions(-)
+
+commit a3713cb750b27de7e046ebe3db2f7891a179cfcc
+Merge: fd42be9 9d79ac2
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Apr 12 07:02:04 2013 -0700
+
+ Merge pull request #542 from hurtonm/master
+
+ Use state functions for message flow
+
+commit 9d79ac283061c1531c1ab2878a2765afdaba9d77
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Fri Apr 12 11:59:49 2013 +0200
+
+ Use state functions for message flow
+
+ The patch makes the code somewhat simpler and prepares it for
+ more complex initialization handshakes.
+
+ src/stream_engine.cpp | 100 +++++++++++++++++++++++++------------------------
+ src/stream_engine.hpp | 24 +++++-------
+ 2 files changed, 62 insertions(+), 62 deletions(-)
+
+commit fd42be9dbab047d0ed35572ead3be755177a60d2
+Merge: 91f1e13 7942db7
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Apr 11 09:57:54 2013 -0700
+
+ Merge pull request #541 from hurtonm/rework_message_flow
+
+ Refactor code so that messages go through engines
+
+commit 7942db7606c76f71b77863f8f883047ec69ffc5f
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Mon Mar 18 02:00:00 2013 +0100
+
+ Refactor code so that messages go through engines
+
+ src/Makefile.am | 2 -
+ src/decoder.hpp | 94 +++++-------------
+ src/encoder.hpp | 62 ++++++------
+ src/i_decoder.hpp | 15 +--
+ src/i_encoder.hpp | 15 ++-
+ src/i_msg_sink.hpp | 43 ---------
+ src/i_msg_source.hpp | 44 ---------
+ src/pgm_receiver.cpp | 137 ++++++++++++++------------
+ src/pgm_receiver.hpp | 11 ++-
+ src/pgm_sender.cpp | 34 +++++--
+ src/pgm_sender.hpp | 8 ++
+ src/raw_decoder.cpp | 66 +++----------
+ src/raw_decoder.hpp | 25 +++--
+ src/raw_encoder.cpp | 53 +---------
+ src/raw_encoder.hpp | 10 +-
+ src/req.cpp | 10 +-
+ src/req.hpp | 1 -
+ src/session_base.cpp | 30 ------
+ src/session_base.hpp | 25 ++---
+ src/stream_engine.cpp | 258 +++++++++++++++++++++++++++++++------------------
+ src/stream_engine.hpp | 37 +++++--
+ src/v1_decoder.cpp | 73 ++++++--------
+ src/v1_decoder.hpp | 12 +--
+ src/v1_encoder.cpp | 51 ++--------
+ src/v1_encoder.hpp | 10 +-
+ src/v2_decoder.cpp | 82 ++++++----------
+ src/v2_decoder.hpp | 15 ++-
+ src/v2_encoder.cpp | 53 ++--------
+ src/v2_encoder.hpp | 13 +--
+ src/wire.hpp | 8 +-
+ 30 files changed, 527 insertions(+), 770 deletions(-)
+
+commit 91f1e13125497683f9c8b604ff70617c540a3946
+Merge: c396144 6d19e40
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Thu Apr 11 03:10:38 2013 -0700
+
+ Merge pull request #540 from hintjens/master
+
+ Small clarification about connect and ROUTER
+
+commit 6d19e400f1c824696d402591d12a8bed13df00f2
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Apr 11 09:48:41 2013 +0200
+
+ Added clarification about connect on ROUTER
+
+ doc/zmq_connect.txt | 12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+commit c3961442163a57c1a6bf17d2ef2a1b2f1c0f4f27
+Merge: 106d962 2aec837
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Apr 8 06:33:29 2013 -0700
+
+ Merge pull request #539 from TTimo/master
+
+ Adds a needed Windows system library dependency
+
+commit 2aec837218c4b9d2cdea7f33005ce4c3ad57f6c5
+Author: Timothee "TTimo" Besset <ttimo@ttimo.net>
+Date: Sun Apr 7 12:44:48 2013 -0500
+
+ InitializeSecurityDescriptor needs Advapi32.lib
+
+ builds/msvc/libzmq/libzmq11.vcxproj | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+commit 106d962311386cba98e708b3c57b2265405c5367
+Author: Timothee "TTimo" Besset <ttimo@ttimo.net>
+Date: Sat Apr 6 19:39:06 2013 -0500
+
+ restore fixed MSVC 2010 projects, fork new MSVC 2012 projects
+
+ builds/msvc/c_local_lat/c_local_lat.vcxproj | 6 +-
+ builds/msvc/c_local_lat/c_local_lat11.vcxproj | 91 ++++++
+ builds/msvc/c_local_thr/c_local_thr.vcxproj | 6 +-
+ builds/msvc/c_local_thr/c_local_thr11.vcxproj | 91 ++++++
+ builds/msvc/c_remote_lat/c_remote_lat.vcxproj | 6 +-
+ builds/msvc/c_remote_lat/c_remote_lat11.vcxproj | 91 ++++++
+ builds/msvc/c_remote_thr/c_remote_thr.vcxproj | 6 +-
+ builds/msvc/c_remote_thr/c_remote_thr11.vcxproj | 91 ++++++
+ builds/msvc/inproc_lat/inproc_lat.vcxproj | 6 +-
+ builds/msvc/inproc_lat/inproc_lat11.vcxproj | 110 +++++++
+ builds/msvc/inproc_thr/inproc_thr.vcxproj | 6 +-
+ builds/msvc/inproc_thr/inproc_thr11.vcxproj | 110 +++++++
+ builds/msvc/libzmq/libzmq.vcxproj | 10 +-
+ builds/msvc/libzmq/libzmq11.vcxproj | 346 +++++++++++++++++++++++
+ builds/msvc/msvc11.sln | 150 ++++++++++
+ 15 files changed, 1087 insertions(+), 39 deletions(-)
+
+commit b5ace90e8ea8ba0b6df0c762a11bdee3b8c2a13a
+Merge: 1e7db60 44df35c
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Apr 1 03:09:42 2013 -0700
+
+ Merge pull request #538 from TTimo/master
+
+ MSVC fixes
+
+commit 44df35cb1e5bf7f64a01a48bf19e37112c071ad6
+Author: Timothee "TTimo" Besset <ttimo@ttimo.net>
+Date: Sun Mar 31 18:18:05 2013 -0500
+
+ Use Multithreaded DLL Runtime, Debug/Release accordingly - need consistency for the czmq configurations
+
+ builds/msvc/libzmq/libzmq.vcxproj | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+commit 5973b4c665c4a02d4bd5fce2370bd5cfaa821266
+Author: Timothee "TTimo" Besset <ttimo@ttimo.net>
+Date: Sun Mar 31 09:10:56 2013 -0500
+
+ Windows friendly replacement for gettimeofday
+
+ perf/local_thr.cpp | 44 ++++++++++++++++++++++++++++++++++++++------
+ perf/remote_thr.cpp | 42 +++++++++++++++++++++++++++++++++++-------
+ 2 files changed, 73 insertions(+), 13 deletions(-)
+
+commit 574fe35b3261edc50956d44d09a1413597af061d
+Author: Timothee "TTimo" Besset <ttimo@ttimo.net>
+Date: Sun Mar 31 09:09:50 2013 -0500
+
+ Fix MSVC project files.
+
+ builds/msvc/c_local_lat/c_local_lat.vcxproj | 4 ++++
+ builds/msvc/c_local_thr/c_local_thr.vcxproj | 4 ++++
+ builds/msvc/c_remote_lat/c_remote_lat.vcxproj | 4 ++++
+ builds/msvc/c_remote_thr/c_remote_thr.vcxproj | 4 ++++
+ builds/msvc/inproc_lat/inproc_lat.vcxproj | 6 ++++-
+ builds/msvc/inproc_thr/inproc_thr.vcxproj | 6 ++++-
+ builds/msvc/libzmq/libzmq.vcxproj | 12 ++++++++--
+ builds/msvc/libzmq/libzmq.vcxproj.filters | 12 +++++-----
+ builds/msvc/msvc10.sln | 32 +++++++++++++++++++++++--
+ 9 files changed, 72 insertions(+), 12 deletions(-)
+
+commit 1e7db60e9ad5a17faa6d307105ceff5aec4974fc
+Merge: 01fef41 f8e7d46
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Mar 24 16:08:45 2013 -0700
+
+ Merge pull request #537 from TTimo/master
+
+ mingw32 fixes
+
+commit f8e7d462a6c988c0a06c31ae14297fafe3bfba8a
+Author: Timothee Besset <ttimo@ttimo.net>
+Date: Sun Mar 24 23:32:21 2013 +0100
+
+ mingw32 fixes
+
+ builds/mingw32/Makefile.mingw32 | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit 01fef415753d00acca7200b60835fe4027adcdf6
+Merge: 09a00de 257debf
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Sun Mar 24 07:49:25 2013 -0700
+
+ Merge pull request #536 from hintjens/master
+
+ Fixed test_last_endpoint (#80)
+
+commit 257debf65903783fc54792ed90ee6439cda87cff
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Mar 24 15:12:34 2013 +0100
+
+ Removed IPC endpoint from test; not portable, and fragile (#80)
+
+ tests/test_last_endpoint.cpp | 1 -
+ 1 file changed, 1 deletion(-)
+
+commit 09a00de80384826bb1fb0d50dcae2417595ee27a
+Merge: 5ba7445 8c96deb
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Thu Mar 21 05:07:46 2013 -0700
+
+ Merge pull request #534 from hintjens/master
+
+ Reverted cleanups of copyrghts
+
+commit 5ba7445b7aac823688f83f06526e8a5a4e7c0020
+Merge: 39214b3 3286bf5
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Mar 20 10:34:48 2013 -0700
+
+ Merge pull request #535 from ken-tilera/master
+
+ Optimize atomics implementaiton for the Tile architecture
+
+commit 3286bf5ab66c5ea00237af642967a25043581353
+Author: Ken Steele <ken@tilera.com>
+Date: Wed Mar 20 12:54:38 2013 -0400
+
+ On the Tile architecture, use atomic instructions for atomic ptr and counter.
+
+ For atomic_counter and atomic_ptr classes, detect the Tile architecture
+ using #if defined __tile__ matching ARM and Solaris and then use the
+ Tile atomic instructions. Without this change, the default Mutex
+ implementation is used, which is slower.
+
+ AUTHORS | 1 +
+ src/atomic_counter.hpp | 10 ++++++++++
+ src/atomic_ptr.hpp | 8 ++++++++
+ 3 files changed, 19 insertions(+)
+
+commit 8c96deb900cde8759ade482ef6c660d7fc35a03c
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Mar 20 11:59:23 2013 +0100
+
+ Added corporate copyrights
+
+ AUTHORS | 13 +++++++++++--
+ 1 file changed, 11 insertions(+), 2 deletions(-)
+
+commit 39214b3e40cca54c020368378e9fd8135f54f1eb
+Merge: 3b132e3 03c2841
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Mar 18 02:46:45 2013 -0700
+
+ Merge pull request #533 from mika-fischer/workaround-for-496
+
+ Work around for LIBZMQ-496
+
+commit 03c28411d892da23ae1a17728a368e38b9a072ad
+Author: Mika Fischer <fischer@videmo.de>
+Date: Tue Feb 19 11:01:13 2013 +0100
+
+ Work around for LIBZMQ-496
+
+ The problem is that other threads might still be in mailbox::send() when
+ it is destroyed. So as a workaround, we just acquire the mutex in the
+ destructor. Therefore the running send will finish before the mailbox is
+ destroyed.
+
+ See also the fix for LIBZMQ-281 in zeromq2-x.
+
+ Signed-off-by: Mika Fischer <mika.fischer@zoopnet.de>
+
+ src/mailbox.cpp | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+commit 3b132e337ee7c99db5d1dc3c1447de496b2f2f04
+Merge: 9ea20b8 8181840
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Mar 18 01:05:38 2013 -0700
+
+ Merge pull request #532 from hurtonm/pgm_build_fix
+
+ Update PGM with recent changes
+
+commit 81818401e83ac31e5746e7a4b6490468b99566f7
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Mon Mar 18 02:05:51 2013 +0100
+
+ Update PGM with recent changes
+
+ src/pgm_receiver.cpp | 5 +++--
+ src/pgm_receiver.hpp | 6 +++---
+ src/pgm_sender.hpp | 4 ++--
+ 3 files changed, 8 insertions(+), 7 deletions(-)
+
+commit 16f8ea3e95f3e7897ed9d1a7536e7acccaaf54f0
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Mar 17 11:30:49 2013 +0100
+
+ Clarified HWM=0 means infinite
+
+ doc/zmq_getsockopt.txt | 6 ++++--
+ doc/zmq_setsockopt.txt | 6 ++++--
+ 2 files changed, 8 insertions(+), 4 deletions(-)
+
+commit 9ea20b82cc7fffd233d4db854fed4013711ce639
+Merge: c7cb5ab c69e797
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Mar 13 12:45:37 2013 -0700
+
+ Merge pull request #531 from murrekatt/master
+
+ Fixed CMake building after encoder/decoder changes
+
+commit c69e79706e88d8946ea58b173ac041a214f9c780
+Author: Tommy Back <tommy.jh.back@gmail.com>
+Date: Wed Mar 13 20:27:49 2013 +0100
+
+ Fix to building libzmq with CMake as sub-project (git submodule).
+
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 601eedb7f3624e1e8c334ce396b64fff91b8a3e8
+Author: Tommy Back <tommy.jh.back@gmail.com>
+Date: Wed Mar 13 20:10:00 2013 +0100
+
+ Updated CMake building to work after encoder/decoder changes.
+
+ CMakeLists.txt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit c7cb5ab7c0c1d72fe54799cef4ac4f26fa224cc3
+Merge: 1810f10 f1738b9
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Tue Mar 12 14:00:20 2013 -0700
+
+ Merge pull request #530 from hintjens/master
+
+ Fixed copyrights in sources
+
+commit f1738b9b9219ffa78bb57fdedc703590abaf5ac2
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Mar 12 17:04:51 2013 +0100
+
+ More copyright cleanups
+
+ tests/test_connect_delay.cpp | 4 ++--
+ tests/test_connect_resolve.cpp | 3 +--
+ tests/test_ctx_options.cpp | 3 +--
+ tests/test_disconnect_inproc.cpp | 19 +++++++++++++++++++
+ tests/test_hwm.cpp | 4 +---
+ tests/test_invalid_rep.cpp | 4 +---
+ tests/test_last_endpoint.cpp | 4 +---
+ tests/test_monitor.cpp | 4 +---
+ tests/test_msg_flags.cpp | 4 +---
+ tests/test_pair_inproc.cpp | 3 +--
+ tests/test_pair_ipc.cpp | 3 +--
+ tests/test_pair_tcp.cpp | 4 +---
+ tests/test_raw_sock.cpp | 3 +--
+ tests/test_reqrep_device.cpp | 4 +---
+ tests/test_reqrep_inproc.cpp | 3 +--
+ tests/test_reqrep_ipc.cpp | 3 +--
+ tests/test_reqrep_tcp.cpp | 4 +---
+ tests/test_router_mandatory.cpp | 3 +--
+ tests/test_shutdown_stress.cpp | 4 +---
+ tests/test_sub_forward.cpp | 4 +---
+ tests/test_term_endpoint.cpp | 4 +---
+ tests/test_timeo.cpp | 4 +---
+ tests/testutil.hpp | 4 +---
+ 23 files changed, 42 insertions(+), 57 deletions(-)
+
+commit 0e77d65f128251cd63dada27ce95849b3b815d29
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Mar 12 16:15:54 2013 +0100
+
+ Removed pointless comment
+
+ src/dealer.cpp | 6 ------
+ src/router.cpp | 7 -------
+ 2 files changed, 13 deletions(-)
+
+commit 8358d4e8328895456399f8c2ee8a0f273fa3f8dc
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Mar 12 16:11:19 2013 +0100
+
+ Renamed ZMQ_DELAY_ATTACH_ON_CONNECT_COULD_THIS_BE_ANY_LONGER to ZMQ_IMMEDIATE
+
+ doc/zmq_setsockopt.txt | 15 +++++++++------
+ include/zmq.h | 10 +++++-----
+ src/options.cpp | 10 +++++-----
+ src/options.hpp | 2 +-
+ src/session_base.cpp | 2 +-
+ src/socket_base.cpp | 4 ++--
+ 6 files changed, 23 insertions(+), 20 deletions(-)
+
+commit 12c7db8c42ac04d3aaed6674ae43af91c39d29bf
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Mar 12 15:56:10 2013 +0100
+
+ Code name clean up
+
+ src/stream_engine.cpp | 20 ++++++++++----------
+ src/stream_engine.hpp | 21 ++++++++-------------
+ 2 files changed, 18 insertions(+), 23 deletions(-)
+
+commit d826c53b9b163e33952abb515718bb04526b8940
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Mar 12 15:38:48 2013 +0100
+
+ Bumped ZMTP revision to 2
+
+ * Starting draft ZMTP/2.1 protocol (revision 2)
+ * Basis for adding security to the wire protocol
+ * Maintains backward compatibility
+
+ src/stream_engine.cpp | 24 ++++++++++++------------
+ src/stream_engine.hpp | 7 +++++++
+ src/v2_protocol.hpp | 1 -
+ tests/test_raw_sock.cpp | 6 +++---
+ 4 files changed, 22 insertions(+), 16 deletions(-)
+
+commit 785ef41f678399f2d1835492b3d593ca7b54a498
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Mar 12 15:26:07 2013 +0100
+
+ Refactored codecs to match ZMTP version numbers
+
+ src/Makefile.am | 10 +--
+ src/decoder.cpp | 164 -----------------------------------------------
+ src/decoder.hpp | 31 ---------
+ src/encoder.cpp | 99 ----------------------------
+ src/encoder.hpp | 24 -------
+ src/stream_engine.cpp | 55 ++++++++--------
+ src/tcp_connecter.cpp | 2 +-
+ src/v1_decoder.cpp | 141 ++++++++++++++++++++--------------------
+ src/v1_decoder.hpp | 21 ++----
+ src/v1_encoder.cpp | 60 ++++++++---------
+ src/v1_encoder.hpp | 15 ++---
+ src/v1_protocol.hpp | 42 ------------
+ src/v2_decoder.cpp | 160 +++++++++++++++++++++++++++++++++++++++++++++
+ src/v2_decoder.hpp | 60 +++++++++++++++++
+ src/v2_encoder.cpp | 100 +++++++++++++++++++++++++++++
+ src/v2_encoder.hpp | 56 ++++++++++++++++
+ src/v2_protocol.hpp | 39 +++++++++++
+ src/xsub.cpp | 8 +--
+ tests/test_raw_sock.cpp | 2 +-
+ 19 files changed, 570 insertions(+), 519 deletions(-)
+
+commit f0f16505e5c3468b9cc598abd797f0aa650447a6
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Mar 12 13:17:00 2013 +0100
+
+ Removed corporate advertisements from source file headers
+
+ Copyrights had become ads for Sustrik's corporate sponsors, going against the original
+ agreement to share copyrights with the community (that agreement was: one line stating
+ iMatix copyright + one reference to AUTHORS file). The proliferation of corporate ads
+ is also unfair to the many individual authors. I've removed ALL corporate title from
+ the source files so the copyright statements can now be centralized in AUTHORS and
+ source files can be properly updated on an annual basis.
+
+ include/zmq.h | 5 +----
+ include/zmq_utils.h | 3 +--
+ src/address.cpp | 3 +--
+ src/address.hpp | 3 +--
+ src/array.hpp | 4 +---
+ src/atomic_counter.hpp | 4 +---
+ src/atomic_ptr.hpp | 4 +---
+ src/blob.hpp | 3 +--
+ src/clock.cpp | 3 +--
+ src/clock.hpp | 3 +--
+ src/command.hpp | 4 +---
+ src/config.hpp | 4 +---
+ src/ctx.cpp | 4 +---
+ src/ctx.hpp | 4 +---
+ src/dealer.cpp | 4 +---
+ src/dealer.hpp | 3 +--
+ src/decoder.cpp | 4 +---
+ src/decoder.hpp | 4 +---
+ src/devpoll.cpp | 4 +---
+ src/devpoll.hpp | 4 +---
+ src/dist.cpp | 4 +---
+ src/dist.hpp | 3 +--
+ src/encoder.cpp | 5 +----
+ src/encoder.hpp | 4 +---
+ src/epoll.cpp | 4 +---
+ src/epoll.hpp | 4 +---
+ src/err.cpp | 4 +---
+ src/err.hpp | 4 +---
+ src/fd.hpp | 3 +--
+ src/fq.cpp | 5 +----
+ src/fq.hpp | 4 +---
+ src/i_decoder.hpp | 3 +--
+ src/i_encoder.hpp | 3 +--
+ src/i_engine.hpp | 4 +---
+ src/i_msg_sink.hpp | 3 +--
+ src/i_msg_source.hpp | 3 +--
+ src/i_poll_events.hpp | 4 +---
+ src/io_object.cpp | 4 +---
+ src/io_object.hpp | 4 +---
+ src/io_thread.cpp | 4 +---
+ src/io_thread.hpp | 4 +---
+ src/ip.cpp | 4 +---
+ src/ip.hpp | 4 +---
+ src/ipc_address.cpp | 3 +--
+ src/ipc_address.hpp | 3 +--
+ src/ipc_connecter.cpp | 3 +--
+ src/ipc_connecter.hpp | 3 +--
+ src/ipc_listener.cpp | 3 +--
+ src/ipc_listener.hpp | 3 +--
+ src/kqueue.cpp | 4 +---
+ src/kqueue.hpp | 4 +---
+ src/lb.cpp | 5 +----
+ src/lb.hpp | 4 +---
+ src/likely.hpp | 3 +--
+ src/mailbox.cpp | 4 +---
+ src/mailbox.hpp | 4 +---
+ src/msg.cpp | 6 ++----
+ src/msg.hpp | 5 +----
+ src/mtrie.cpp | 4 +---
+ src/mtrie.hpp | 4 +---
+ src/mutex.hpp | 4 +---
+ src/object.cpp | 4 +---
+ src/object.hpp | 4 +---
+ src/options.cpp | 5 +----
+ src/options.hpp | 5 +----
+ src/own.cpp | 3 +--
+ src/own.hpp | 3 +--
+ src/pair.cpp | 4 +---
+ src/pair.hpp | 4 +---
+ src/pgm_receiver.cpp | 5 +----
+ src/pgm_receiver.hpp | 5 +----
+ src/pgm_sender.cpp | 5 +----
+ src/pgm_sender.hpp | 5 +----
+ src/pgm_socket.cpp | 5 +----
+ src/pgm_socket.hpp | 5 +----
+ src/pipe.cpp | 5 +----
+ src/pipe.hpp | 5 +----
+ src/poll.cpp | 4 +---
+ src/poll.hpp | 4 +---
+ src/poller.hpp | 4 +---
+ src/poller_base.cpp | 3 +--
+ src/poller_base.hpp | 3 +--
+ src/precompiled.cpp | 3 +--
+ src/precompiled.hpp | 3 +--
+ src/proxy.cpp | 3 +--
+ src/proxy.hpp | 3 +--
+ src/pub.cpp | 4 +---
+ src/pub.hpp | 4 +---
+ src/pull.cpp | 4 +---
+ src/pull.hpp | 4 +---
+ src/push.cpp | 4 +---
+ src/push.hpp | 4 +---
+ src/random.cpp | 3 +--
+ src/random.hpp | 3 +--
+ src/raw_decoder.cpp | 4 +---
+ src/raw_decoder.hpp | 4 +---
+ src/raw_encoder.cpp | 5 +----
+ src/raw_encoder.hpp | 4 +---
+ src/reaper.cpp | 3 +--
+ src/reaper.hpp | 3 +--
+ src/rep.cpp | 4 +---
+ src/rep.hpp | 4 +---
+ src/req.cpp | 5 +----
+ src/req.hpp | 5 +----
+ src/router.cpp | 5 +----
+ src/router.hpp | 5 +----
+ src/select.cpp | 4 +---
+ src/select.hpp | 4 +---
+ src/session_base.cpp | 5 +----
+ src/session_base.hpp | 5 +----
+ src/signaler.cpp | 3 +--
+ src/signaler.hpp | 3 +--
+ src/socket_base.cpp | 5 +----
+ src/socket_base.hpp | 5 +----
+ src/stdint.hpp | 3 +--
+ src/stream_engine.cpp | 4 +---
+ src/stream_engine.hpp | 4 +---
+ src/sub.cpp | 4 +---
+ src/sub.hpp | 4 +---
+ src/tcp.cpp | 4 +---
+ src/tcp.hpp | 4 +---
+ src/tcp_address.cpp | 4 +---
+ src/tcp_address.hpp | 4 +---
+ src/tcp_connecter.cpp | 4 +---
+ src/tcp_connecter.hpp | 4 +---
+ src/tcp_listener.cpp | 4 +---
+ src/tcp_listener.hpp | 4 +---
+ src/thread.cpp | 4 +---
+ src/thread.hpp | 4 +---
+ src/trie.cpp | 5 +----
+ src/trie.hpp | 5 +----
+ src/v1_decoder.cpp | 4 +---
+ src/v1_decoder.hpp | 4 +---
+ src/v1_encoder.cpp | 5 +----
+ src/v1_encoder.hpp | 4 +---
+ src/v1_protocol.hpp | 3 +--
+ src/windows.hpp | 4 +---
+ src/wire.hpp | 3 +--
+ src/xpub.cpp | 4 +---
+ src/xpub.hpp | 3 +--
+ src/xsub.cpp | 4 +---
+ src/xsub.hpp | 3 +--
+ src/ypipe.hpp | 4 +---
+ src/yqueue.hpp | 4 +---
+ src/zmq.cpp | 4 +---
+ src/zmq_utils.cpp | 4 +---
+ 146 files changed, 147 insertions(+), 427 deletions(-)
+
+commit cb69986d743df388944d7dc5ea4bb12f7c49d2ed
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Mar 8 14:22:58 2013 +0100
+
+ Comment change
+
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 898ad19851ba81b4175696028bd5427a38c86614
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Feb 26 12:43:52 2013 +0100
+
+ It's its not it's
+
+ doc/zmq_pgm.txt | 4 ++--
+ doc/zmq_socket_monitor.txt | 22 +++++++++++-----------
+ 2 files changed, 13 insertions(+), 13 deletions(-)
+
+commit 1810f1025f633a7d3c6edafb4ac4650b7c06de69
+Merge: ba2dda4 d78d497
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Mar 8 10:03:19 2013 -0800
+
+ Merge pull request #529 from guidog/master
+
+ Adapted zmq_socket_monitor man page to new API.
+
+commit d78d4972ae3eed299ce9245a734c95b94c161af1
+Author: Guido Goldstein <github@a-nugget.de>
+Date: Fri Mar 8 16:58:04 2013 +0100
+
+ Adapted man page to API.
+
+ doc/zmq_socket_monitor.txt | 229 +++++++++++++++++++-------------------------
+ 1 file changed, 100 insertions(+), 129 deletions(-)
+
+commit ba2dda407d73d009851cb19f7fa831d6576f4a76
+Merge: 656258c b0b8ab2
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Mar 8 05:21:25 2013 -0800
+
+ Merge pull request #528 from guidog/master
+
+ Changed message structure for event notifications
+
+commit b0b8ab27c5a3734aa2e9103a61e1a850e14d7dd3
+Author: Guido Goldstein <github@a-nugget.de>
+Date: Fri Mar 8 13:48:18 2013 +0100
+
+ Changed message structure for event notifications.
+
+ include/zmq.h | 6 ++--
+ src/socket_base.cpp | 67 +++++++++++++++--------------------------
+ src/socket_base.hpp | 5 +---
+ src/zmq.cpp | 10 -------
+ tests/test_monitor.cpp | 78 ++++++++++++++++++++++++++----------------------
+ 5 files changed, 70 insertions(+), 96 deletions(-)
+
+commit 656258c1d4ec3f3d71f4ea85783d95576aff2bf5
+Merge: 068909f 21eeb03
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Mar 8 02:24:46 2013 -0800
+
+ Merge pull request #527 from guidog/master
+
+ Simplified zmq_event_t structure.
+
+commit 21eeb03b6cab29e5f4cb60b195272314f6375678
+Author: Guido Goldstein <github@a-nugget.de>
+Date: Fri Mar 8 10:34:25 2013 +0100
+
+ Simplified the zmq_event_t structure for easier access and better usability towards language bindings.
+
+ include/zmq.h | 48 ++++----------------------------------
+ src/socket_base.cpp | 60 ++++++++++++++++++++++++------------------------
+ src/zmq.cpp | 37 +++--------------------------
+ tests/test_monitor.cpp | 39 ++++++++++++-------------------
+ 4 files changed, 52 insertions(+), 132 deletions(-)
+
+commit 068909f4445381f597337bd0f51786f45ba0df35
+Merge: be11608 7e37cc8
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Tue Mar 5 08:00:59 2013 -0800
+
+ Merge pull request #526 from breese/master
+
+ Fixed Linux compilation problem
+
+commit 7e37cc8ed471ef06554ea88e20dbf5315dcc2bb9
+Author: Bjorn Reese <breese@sourceforge.net>
+Date: Tue Mar 5 11:52:47 2013 +0100
+
+ Linux build fails due to undeclared variable
+
+ perf/remote_thr.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit be1160832e91f757a65ff37c3450e4f26ce3daff
+Merge: f420f0a 679869d
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Mar 3 01:14:00 2013 -0800
+
+ Merge pull request #525 from pijyoi/master
+
+ remote_thr.cpp: port pthreads usage to win32 api
+
+commit 679869d98144adf70e738fa269f4d4c89e2f08a3
+Author: KIU Shueng Chuan <nixchuan@gmail.com>
+Date: Sun Mar 3 15:39:44 2013 +0800
+
+ add simple Makefile to build with mingw32
+
+ builds/mingw32/Makefile.mingw32 | 31 +++++++++++++++++++++++++++++++
+ builds/mingw32/platform.hpp | 32 ++++++++++++++++++++++++++++++++
+ 2 files changed, 63 insertions(+)
+
+commit 3176509e6029ec269e340d266b99059f97b5c065
+Author: KIU Shueng Chuan <nixchuan@gmail.com>
+Date: Sun Mar 3 15:28:00 2013 +0800
+
+ include source directory version of zmq.h and zmq_utils.h
+
+ this follows what {local,remote}_lat.cpp and inproc_{thr,lat}.cpp do.
+
+ perf/local_thr.cpp | 4 ++--
+ perf/remote_thr.cpp | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+commit 402f9fd243dfd150e7dc567ce6e045d3a7d14b50
+Author: KIU Shueng Chuan <nixchuan@gmail.com>
+Date: Sun Mar 3 15:18:54 2013 +0800
+
+ remote_thr.cpp: port pthreads usage to win32 api
+
+ perf/remote_thr.cpp | 74 ++++++++++++++++++++++++++++++++++-----------------
+ 1 file changed, 49 insertions(+), 25 deletions(-)
+
+commit f420f0aff78c1734d335f9304bbca658ba30d7ec
+Merge: 22d9d95 1e52a45
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Thu Feb 28 14:14:31 2013 -0800
+
+ Merge pull request #524 from dlittleton/master
+
+ Windows: Fix rounding error in now_us. [Jira LIBZMQ-514]
+
+commit 1e52a451d68bd274635d7338f114ff708bc0294f
+Author: Duane Littleton <dlittleton@vocollect.com>
+Date: Wed Feb 27 13:53:07 2013 -0500
+
+ Windows: Fix rounding error when calculating now_us
+
+ Improve accuracy of time calculations and avoid division by zero when
+ ticksPerSecond.QuadPart < 1000000.
+
+ src/clock.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 22d9d95dd26bf3e39119e10d652ffbc97c46ca6d
+Merge: deb9773 a22714d
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Feb 26 12:33:26 2013 -0800
+
+ Merge pull request #523 from ambitslix/perf
+
+ Improvements and fixes for performance of PUSH/PULL in local_thr and rem...
+
+commit a22714dd79021279ce64e7795be7f25ede8c1f83
+Author: Attila Mark <gougolith@gmail.com>
+Date: Tue Feb 26 12:10:27 2013 -0800
+
+ Improvements and fixes for performance of PUSH/PULL in local_thr and remote_thr.
+
+ - option to set number of zmq threads on the command line for local_thr
+ - option to set number of zmq_threads and workers in remote_thr
+ - option to set SND/RCV buffer sizes on command line
+ - option to set whether to PUSH/PULL on command line
+ - option to set to use zmq_recv or zmq_msg for transfer on command line
+ - better timing function
+ - corrected and improved throughput reporting
+ - HWM and DELAY socket options
+
+ AUTHORS | 1 +
+ perf/local_thr.cpp | 253 +++++++++++++++++++++++++++++++++++--------
+ perf/remote_thr.cpp | 299 +++++++++++++++++++++++++++++++++++++++++++--------
+ 3 files changed, 466 insertions(+), 87 deletions(-)
+
+commit deb977345c85939551551c73fe710fc1f9252100
+Merge: fb45685 066f3d2
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Mon Feb 25 05:30:11 2013 -0800
+
+ Merge pull request #522 from hintjens/master
+
+ Fixed overflow in results calculation
+
+commit 066f3d2c9bf3126f91a4339be1f9862fea25cb77
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Feb 25 14:13:15 2013 +0100
+
+ Fixed overflow in local_thr results calculation
+
+ perf/local_thr.cpp | 36 ++++++++++++------------------------
+ 1 file changed, 12 insertions(+), 24 deletions(-)
+
+commit fb45685aa82689f6024c5eb91a65adb5059f3acf
+Merge: 0434366 0ecc96b
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Sun Feb 24 09:04:26 2013 -0800
+
+ Merge pull request #521 from SRombauts/master
+
+ Static Library Linking for Windows
+
+commit 0ecc96bf33b66413bff1db1ae72bec67a6522824
+Author: Sebastien Rombauts <sebastien.rombauts@gmail.com>
+Date: Sun Feb 24 16:10:17 2013 +0100
+
+ Adding missing new ZeroMQ_Static.props and Static.props files
+
+ + ignore StaticRelease & StaticDebug intermediate files
+
+ .gitignore | 4 ++--
+ builds/msvc/properties/Static.props | 15 +++++++++++++++
+ builds/msvc/properties/ZeroMQ_Static.props | 23 +++++++++++++++++++++++
+ 3 files changed, 40 insertions(+), 2 deletions(-)
+
+commit b3bcd8e323773c3ede84ec1fe7ab7e4df045e063
+Author: Sebastien Rombauts <sebastien.rombauts@gmail.com>
+Date: Sun Feb 24 15:44:14 2013 +0100
+
+ Static Library Linking for Windows
+
+ - New ZMQ_STATIC flag to enable "libzmq.lib" Windows static library (or "libzmq_d.lib" in Debug mode).
+ - ZMQ_STATIC needs also to be defined by projects using static linking against "libzmq.lib"
+ - New StaticDebug & StaticRelease configurations for libzmq Win32 projects under MSVC 2008 & 2010
+ - Tested with Visual Studio 2008 Express under Windows 7, and Visual Studio 2010 Express under Windows 8.
+
+ builds/msvc/Makefile.am | 4 +-
+ builds/msvc/libzmq/libzmq.vcproj | 1776 +++++++++++++++++++----------------
+ builds/msvc/libzmq/libzmq.vcxproj | 40 +-
+ builds/msvc/msvc.sln | 6 +
+ builds/msvc/msvc10.sln | 6 +
+ builds/msvc/properties/ZeroMQ.props | 1 -
+ include/zmq.h | 4 +-
+ include/zmq_utils.h | 4 +-
+ 8 files changed, 1013 insertions(+), 828 deletions(-)
+
+commit 0434366088ac519c9a4a8bc1f5b37b6b7662d927
+Merge: 25dc715 d175676
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Feb 22 00:27:56 2013 -0800
+
+ Merge pull request #520 from xantares/master
+
+ Fixed module path with cmake < 2.8.3
+
+commit d17567626a54a60fea6ec8bd29ba8548c90ac7eb
+Author: Michel Zou <xantares09@hotmail.com>
+Date: Fri Feb 22 09:01:41 2013 +0100
+
+ Fixed module path with cmake < 2.8.3
+
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 25dc715b7bf7c0fa0cbd274c5b500d8380e321ba
+Merge: 897023c a61535a
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Wed Feb 20 11:45:14 2013 -0800
+
+ Merge pull request #519 from SRombauts/master
+
+ Corrected linking error in MSVC 2010 build + perf/projects compilation
+
+commit 897023c3c1cecacdbd32f3215f45ee68410d61ee
+Merge: ccf2b9b a85c9f4
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Wed Feb 20 11:44:22 2013 -0800
+
+ Merge pull request #518 from hintjens/master
+
+ Fixed MAXMSGSIZE setsockopt, which I'd broken
+
+commit a61535a23a6388c13239882129d6876acf7ade91
+Author: Sébastien Rombauts <sebastien.rombauts@gmail.com>
+Date: Wed Feb 20 16:08:18 2013 +0100
+
+ VS2008 & VS2010: adding the pre-build command to copy platform.hpp in perf/ directory to the two appropriate projects, for each MSVC version
+
+ builds/msvc/inproc_lat/inproc_lat.vcproj | 350 +++++++++++++++--------------
+ builds/msvc/inproc_lat/inproc_lat.vcxproj | 22 +-
+ builds/msvc/inproc_thr/inproc_thr.vcproj | 350 +++++++++++++++--------------
+ builds/msvc/inproc_thr/inproc_thr.vcxproj | 22 +-
+ builds/msvc/libzmq/libzmq.vcxproj | 20 +-
+ 5 files changed, 411 insertions(+), 353 deletions(-)
+
+commit a85c9f45d14a52f66c414e743fd609d9a7324685
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Feb 20 14:05:55 2013 +0100
+
+ MAXMSGSIZE broke when I cleaned up this code - fixed
+
+ src/options.cpp | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+commit 157bf4523ef00dce8fe89d0806da4f0b01c55aa8
+Author: Sébastien Rombauts <sebastien.rombauts@gmail.com>
+Date: Tue Feb 19 22:16:40 2013 +0100
+
+ VS2010: adding another pre-build command to copy platform.hpp in perf/ directory
+
+ builds/msvc/libzmq/libzmq.vcxproj | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+commit 23db53d0aa720e2f26c67ecd94eeacfbdffc4cda
+Author: Sébastien Rombauts <sebastien.rombauts@gmail.com>
+Date: Tue Feb 19 22:01:50 2013 +0100
+
+ Corrected linking error in MSVC 2010 build
+
+ - raw_encoder.cpp and raw_decoder.cpp where missing in Visual Studio 2010 project
+
+ builds/msvc/libzmq/libzmq.vcxproj | 4 ++++
+ builds/msvc/libzmq/libzmq.vcxproj.filters | 12 ++++++++++++
+ 2 files changed, 16 insertions(+)
+
+commit ccf2b9b46665f37a579f5f04f7b80848e97944a6
+Merge: a5ef501 57f84d6
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Feb 19 10:31:26 2013 -0800
+
+ Merge pull request #517 from SRombauts/master
+
+ Windows CE support : using standard _WIN32_WCE flag instead of WINCE
+
+commit 57f84d68111b1005e9f216b94070e837a3b65407
+Author: Sébastien Rombauts <sebastien.rombauts@gmail.com>
+Date: Tue Feb 19 18:57:12 2013 +0100
+
+ Windows CE support : some more #if !defined _WIN32_WCE
+
+ - Windows CE does not manage security attributes (no SetSecurityDescriptorDacl(), SetEvent (NULL, xxx) ...)
+ - Windows CE does not inheritance of sockets for child process (SetHandleInformation ((HANDLE) *w_, HANDLE_FLAG_INHERIT...)
+ - see comments about story "Porting ZeroMQ to Windows Mobile" on webpage http://www.zeromq.org/story:5
+
+ src/signaler.cpp | 14 +++++++++++++-
+ src/tcp_listener.cpp | 4 ++++
+ 2 files changed, 17 insertions(+), 1 deletion(-)
+
+commit 05bb0ead54815d0b8262a9e0063e37f289bc307a
+Author: Sébastien Rombauts <sebastien.rombauts@gmail.com>
+Date: Tue Feb 19 18:55:01 2013 +0100
+
+ Windows CE support : uncommenting #define EACCES needed
+
+ - tested for Windows CE 5.0 under Visual Studio 2008 Pro
+ - tested for Windows XP under Visual Studio 2008 Pro
+
+ builds/msvc/errno.hpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 41d79bc19eb4b53c6e6c7ea0477a1607ff0b59a7
+Author: Sébastien Rombauts <sebastien.rombauts@gmail.com>
+Date: Tue Feb 19 16:49:23 2013 +0100
+
+ Windows CE support : using standard _WIN32_WCE flag instead of WINCE
+
+ - when compiling for Windows CE, a C++ project must define the preprocessor definitions: UNDER_CE=$(CEVersion),_WIN32_WCE=$(CEVersion)
+ - choosing the "_WIN32_CE" form for uniformization with "_WIN32" and "_WIN32_WINNT" already used in libzmq (boost is using both forms)
+ - see http://msdn.microsoft.com/en-us/library/ee479161(v=winembedded.60).aspx
+
+ builds/msvc/errno.cpp | 2 +-
+ include/zmq.h | 2 +-
+ src/clock.cpp | 2 +-
+ src/err.cpp | 2 +-
+ src/err.hpp | 2 +-
+ src/socket_base.cpp | 2 +-
+ src/thread.cpp | 2 +-
+ src/windows.hpp | 2 +-
+ 8 files changed, 8 insertions(+), 8 deletions(-)
+
+commit a5ef50141c24c3f658595865d69cbeb132a492ab
+Merge: a8dfcb3 927000f
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Feb 19 05:33:42 2013 -0800
+
+ Merge pull request #516 from SRombauts/master
+
+ Corrected some more linking errors in MSVC build
+
+commit 927000fe2ff7182f55ebd400b959ef3d62d8aa17
+Author: Sébastien Rombauts <sebastien.rombauts@gmail.com>
+Date: Tue Feb 19 14:18:50 2013 +0100
+
+ Fixed 7 MSVC2008 Compiler Warning (level 3) C4800: 'const int' : forcing value to bool 'true' or 'false' (performance warning)
+
+ - added explicit test "(xxx != 0)" to get a "bool" value out of the "int" expression
+ - see the MSDN recommandation http://msdn.microsoft.com/en-us/library/b6801kcy(v=vs.90).aspx
+
+ src/ctx.cpp | 2 +-
+ src/options.cpp | 4 ++--
+ src/router.cpp | 4 ++--
+ src/socket_base.cpp | 2 +-
+ src/xpub.cpp | 2 +-
+ 5 files changed, 7 insertions(+), 7 deletions(-)
+
+commit 42be4d13a7f96089e97d58a9d35ea38baa850fac
+Author: Sébastien Rombauts <sebastien.rombauts@gmail.com>
+Date: Tue Feb 19 13:46:52 2013 +0100
+
+ Corrected more linking error in MSVC build
+
+ - raw_encoder.cpp and raw_decoder.cpp in missing in MSVC project
+
+ builds/msvc/libzmq/libzmq.vcproj | 16 ++++++++++++++++
+ 1 file changed, 16 insertions(+)
+
+commit a8dfcb3c7de53b8b2ec7a5495532e83dd44ee16d
+Merge: 08be168 e628421
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Mon Feb 18 12:19:11 2013 -0800
+
+ Merge pull request #515 from hintjens/master
+
+ Updated NEWS for 3.2.2 stable
+
+commit e628421ed5a7f2a9e2bc92ecfa513d24d8e45cb1
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Feb 18 21:14:14 2013 +0100
+
+ Updated NEWS for 3.2.2 stable
+
+ NEWS | 23 +++++++++++++++++++++++
+ 1 file changed, 23 insertions(+)
+
+commit 08be168dd0011ab259f8f34b0817027bb1ac645c
+Merge: 7094a70 8c71ac4
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Feb 15 08:44:30 2013 -0800
+
+ Merge pull request #514 from pijyoi/fixcs
+
+ release critical section on failure to create signaler fdpair
+
+commit 8c71ac47e83dc4ae116ab4abb5e4a76e8249d888
+Author: KIU Shueng Chuan <nixchuan@gmail.com>
+Date: Fri Feb 15 10:45:43 2013 +0800
+
+ release critical section on failure to create signaler fdpair
+
+ src/signaler.cpp | 48 +++++++++++++++++++++++++++++++++++++-----------
+ 1 file changed, 37 insertions(+), 11 deletions(-)
+
+commit 7094a706123a73c95492dd3a5f4ebc2566eb44f2
+Merge: 9a6b875 51cfcb1
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Sun Feb 10 01:23:13 2013 -0800
+
+ Merge pull request #513 from hintjens/master
+
+ Fixed test_connect_resolve
+
+commit 51cfcb117a488d8411b34dff483312c4e0fa405b
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Feb 10 08:39:27 2013 +0100
+
+ Some DNSs will resolve ANY domain name so I made more reliable errors.
+
+ tests/test_connect_resolve.cpp | 12 +++++++++---
+ 1 file changed, 9 insertions(+), 3 deletions(-)
+
+commit 9a6b875f2181ef46baf65d3baf33135bb67f2864
+Merge: 6b2304a 1a13554
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Thu Feb 7 04:23:56 2013 -0800
+
+ Merge pull request #512 from montoyaedu/master
+
+ broken tests compilation. Makefile.am
+
+commit 1a13554fe0fc94bd1fc5619e270c3abc50cd5b63
+Author: montoyaedu <montoya.edu@gmail.com>
+Date: Thu Feb 7 12:27:33 2013 +0100
+
+ solved broken tests compilation
+
+ tests/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 6b2304ad9749819a7325feae12aa141a5cd1e443
+Merge: f27eb67 ec04ccb
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Feb 5 15:13:12 2013 -0800
+
+ Merge pull request #511 from mjasperse/patch-2
+
+ Corrected linking error in MSVC build
+
+commit ec04ccba79d70abfe7355e6584f5ff79a94793a7
+Author: mjasperse <m.jasperse@gmail.com>
+Date: Wed Feb 6 10:09:07 2013 +1100
+
+ Corrected linking error in MSVC build
+
+ MSVC build fails with linking errors for unresolved symbols SetSecurityDescriptorDacl and InitializeSecurityDescriptor in signaler.obj
+ Adding the relevant link library (Advapi32.lib) to VCLinkerTool fixes this (tested MSVC2010 on XP and Win7)
+
+ builds/msvc/libzmq/libzmq.vcproj | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+commit f27eb67e1abb0484c41050e454404cce30647b63
+Merge: a3ae0d4 2c1a3c5
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Feb 1 00:54:36 2013 -0800
+
+ Merge pull request #510 from miniway/master
+
+ LIBZMQ-497 there could be unsent bytes in encoder
+
+commit 2c1a3c55f73a504b82c32b75790c59426cde76e9
+Author: Min(Dongmin Yu) <miniway@gmail.com>
+Date: Fri Feb 1 17:32:28 2013 +0900
+
+ LIBZMQ-497 there could be unsent bytes in encoder
+
+ When we send a large message, the message can be splitted into two chunks.
+ One is in the encoder buffer and the other is the zero-copy pointer.
+ The session could get the term before the last chunk is sent.
+
+ src/encoder.hpp | 5 +++++
+ src/i_encoder.hpp | 1 +
+ src/stream_engine.cpp | 12 ++++++++++++
+ src/stream_engine.hpp | 1 +
+ 4 files changed, 19 insertions(+)
+
+commit a3ae0d4c16c892a4e6c96d626a7c8b7068450336
+Merge: b60689e 8ab3c4a
+Author: Chuck Remes <git@chuckremes.com>
+Date: Thu Jan 31 13:40:02 2013 -0800
+
+ Merge pull request #509 from hintjens/master
+
+ Added IPv6 option to context
+
+commit 8ab3c4a1bfbde44f45bd97eb40cbd27236239d10
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Jan 31 21:52:30 2013 +0100
+
+ Fixed issue #500
+
+ .gitignore | 3 +++
+ doc/zmq_ctx_get.txt | 6 ++++-
+ doc/zmq_ctx_set.txt | 11 +++++++++
+ src/ctx.cpp | 20 ++++++++++++----
+ src/ctx.hpp | 3 +++
+ src/options.hpp | 1 -
+ src/socket_base.cpp | 1 +
+ tests/Makefile.am | 6 ++---
+ tests/test_ctx_options.cpp | 56 ++++++++++++++++++++++++++++++++++++++++++++
+ 9 files changed, 97 insertions(+), 10 deletions(-)
+
+commit b60689e59df90068396c52acbccf9986b6a55514
+Merge: 049931f 309740e
+Author: Chuck Remes <git@chuckremes.com>
+Date: Thu Jan 31 11:54:42 2013 -0800
+
+ Merge pull request #508 from hintjens/master
+
+ IPv6 related changes and cleanups to test cases
+
+commit 309740e1972565fdcbfe886439977a4603a7d10e
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Jan 31 20:47:45 2013 +0100
+
+ Fixed issue #499
+
+ doc/zmq_getsockopt.txt | 21 ++++++++++---
+ doc/zmq_setsockopt.txt | 24 +++++++++++----
+ src/options.cpp | 29 +++++++++---------
+ src/options.hpp | 6 ++--
+ src/socket_base.cpp | 2 +-
+ src/tcp_address.cpp | 77 +++++++++++++++++++++---------------------------
+ src/tcp_address.hpp | 15 ++++------
+ src/tcp_listener.cpp | 7 +++--
+ 8 files changed, 98 insertions(+), 83 deletions(-)
+
+commit 963c6a8e2f15e077c40c461ede7b5cf777a30dd4
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Jan 31 19:46:22 2013 +0100
+
+ Lots of cleanups to self-tests
+ * Removed or truncated sleeps so the tests run faster
+ * Removed dependencies on zmq_utils
+ * Rewrote a few tests that were confusing
+ * Minor code cleanups
+
+ tests/test_connect_delay.cpp | 195 +++++++++++++++++---------------------
+ tests/test_connect_resolve.cpp | 2 -
+ tests/test_disconnect_inproc.cpp | 23 ++---
+ tests/test_hwm.cpp | 7 +-
+ tests/test_invalid_rep.cpp | 2 -
+ tests/test_monitor.cpp | 152 ++++++++++++++---------------
+ tests/test_msg_flags.cpp | 12 +--
+ tests/test_pair_inproc.cpp | 2 -
+ tests/test_pair_ipc.cpp | 2 -
+ tests/test_pair_tcp.cpp | 2 -
+ tests/test_raw_sock.cpp | 8 +-
+ tests/test_reqrep_device.cpp | 10 +-
+ tests/test_reqrep_inproc.cpp | 2 -
+ tests/test_reqrep_ipc.cpp | 2 -
+ tests/test_reqrep_tcp.cpp | 2 -
+ tests/test_router_mandatory.cpp | 1 -
+ tests/test_shutdown_stress.cpp | 2 -
+ tests/test_sub_forward.cpp | 24 +++--
+ tests/test_term_endpoint.cpp | 28 +++---
+ tests/test_timeo.cpp | 107 ++++++++-------------
+ tests/testutil.hpp | 4 +-
+ 21 files changed, 248 insertions(+), 341 deletions(-)
+
+commit c39cb0bde14c53009f745ce0e5669156cc76a8a7
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Jan 31 16:26:28 2013 +0100
+
+ Rewrote completely, was bogusly testing EAGAIN
+
+ tests/test_router_mandatory.cpp | 89 +++++++++++++++------------------------
+ 1 file changed, 35 insertions(+), 54 deletions(-)
+
+commit 3a558fcc4b8bfa72c649834b76d2fc7e9c93c74e
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Jan 31 15:00:17 2013 +0100
+
+ Rewrote raw test completely
+
+ tests/test_raw_sock.cpp | 286 +++++++++++++++--------------------------------
+ 1 file changed, 88 insertions(+), 198 deletions(-)
+
+commit 8c9289342a1702d557b412487342e2f9a8bbf265
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Jan 31 09:10:49 2013 +0100
+
+ Fixed use of deprecated zmq_init/term
+
+ tests/test_connect_resolve.cpp | 4 ++--
+ tests/test_hwm.cpp | 4 ++--
+ tests/test_invalid_rep.cpp | 7 +++++--
+ tests/test_last_endpoint.cpp | 11 ++++++++++-
+ tests/test_monitor.cpp | 4 ++--
+ tests/test_msg_flags.cpp | 10 ++++++++--
+ tests/test_pair_inproc.cpp | 4 ++--
+ tests/test_pair_ipc.cpp | 4 ++--
+ tests/test_pair_tcp.cpp | 4 ++--
+ tests/test_raw_sock.cpp | 1 -
+ tests/test_reqrep_device.cpp | 4 ++--
+ tests/test_reqrep_inproc.cpp | 4 ++--
+ tests/test_reqrep_ipc.cpp | 4 ++--
+ tests/test_reqrep_tcp.cpp | 4 ++--
+ tests/test_router_mandatory.cpp | 4 ++--
+ tests/test_shutdown_stress.cpp | 6 +++---
+ tests/test_sub_forward.cpp | 4 ++--
+ tests/test_term_endpoint.cpp | 10 ++++------
+ tests/test_timeo.cpp | 4 ++--
+ 19 files changed, 56 insertions(+), 41 deletions(-)
+
+commit 5f009e5234fc7a4e79f5add942098abd71a58ee2
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Jan 30 23:53:23 2013 +0100
+
+ Various cleanups to test programs
+
+ tests/test_connect_delay.cpp | 6 ++----
+ tests/test_disconnect_inproc.cpp | 11 ++---------
+ tests/test_last_endpoint.cpp | 9 ++++-----
+ tests/test_raw_sock.cpp | 36 +++++++++++++++++-------------------
+ 4 files changed, 25 insertions(+), 37 deletions(-)
+
+commit 18a14aedead54354aac1a886a0e65c0fcd7afead
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Jan 30 23:53:09 2013 +0100
+
+ Added ZMQ_IPV6 option, cleaned up setsockopt code, it was nasty
+
+ include/zmq.h | 3 +-
+ src/options.cpp | 427 +++++++++++++++++++++++--------------------------------
+ 2 files changed, 181 insertions(+), 249 deletions(-)
+
+commit aa21e090e19496bedc2b87bae1cb8f6bc4356885
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Jan 18 11:38:49 2013 +0100
+
+ Updated .gitignore
+
+ .gitignore | 1 +
+ 1 file changed, 1 insertion(+)
+
+commit 049931fc1eeb3e680c6b251a33ed983f8f6585cb
+Merge: 470d06b f1e77f2
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Jan 30 08:04:31 2013 -0800
+
+ Merge pull request #507 from bjoto/master
+
+ LIBZMQ-498 - Remove heap allocations in zmq_poll for small poll item sets
+
+commit f1e77f2246726e5e0303eef79f15cd44c4c4a383
+Author: Bjorn Topel <bjorn.topel@gmail.com>
+Date: Wed Jan 30 16:46:45 2013 +0100
+
+ Removed heap allocation for in zmq_poll for small item sets
+
+ Until now, zmq_poll always allocates the poll items on the heap.
+ Now, small item sets, up to ZMQ_POLLITEMS_DFLT, are stack allocated
+ and only larger sets are allocated on the heap.
+
+ include/zmq.h | 2 ++
+ src/zmq.cpp | 20 ++++++++++++++------
+ 2 files changed, 16 insertions(+), 6 deletions(-)
+
+commit 470d06bb9ef3bb33920a9f6240340ec668e6fb1a
+Merge: e8cbfac e464a91
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Jan 27 15:18:11 2013 -0800
+
+ Merge pull request #506 from arsenm/master
+
+ Fix using wrong name for windows.h check with cmake
+
+commit e464a91086386de9bd65e0d9c3c55a38dff056a6
+Author: Matt Arsenault <arsenm2@rpi.edu>
+Date: Sun Jan 27 18:09:32 2013 -0500
+
+ Fix using wrong name for windows.h check in cmake
+
+ CMakeLists.txt | 2 +-
+ builds/cmake/platform.hpp.in | 5 +----
+ 2 files changed, 2 insertions(+), 5 deletions(-)
+
+commit e8cbfac9663169ffe1ab0deb47db2a8796a78172
+Merge: abc8907 ba3e18f
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Jan 23 11:55:48 2013 -0800
+
+ Merge pull request #503 from chazmcgarvey/define-dummy-eproto
+
+ define a dummy EPROTO for platforms that don't use it
+
+commit abc8907e440f0ccb4f1a8758892bf79d93a9847f
+Merge: 93618e7 f01bab6
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Jan 23 11:55:17 2013 -0800
+
+ Merge pull request #505 from arsenm/master
+
+ Fix perf-tools build on Linux with cmake
+
+commit 93618e7d02b83171c5db7672dfa795978194dd1e
+Merge: 7bc3e53 0a1bd45
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Jan 23 11:55:02 2013 -0800
+
+ Merge pull request #504 from o172/master
+
+ Adds tests/test_disconnect_inproc to .gitignore
+
+commit f01bab6633c170315f2a7d1aee71a46e122a4b0b
+Author: Matt Arsenault <arsenm2@rpi.edu>
+Date: Wed Jan 23 14:31:02 2013 -0500
+
+ Fix cmake not linking librt to perf-tools
+
+ CMakeLists.txt | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+commit 0a1bd457210da2cff41ad36aefdedee2f6ed0757
+Author: o172(xenovo) <git@o172.net>
+Date: Wed Jan 23 19:20:52 2013 +0000
+
+ Added tests/test_disconnect_inproc to .gitignore
+
+ .gitignore | 1 +
+ 1 file changed, 1 insertion(+)
+
+commit 7bc3e53b53fa43da46ff9f56113793abc7ad592e
+Merge: eeaa2c8 d850272
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Jan 21 21:18:08 2013 -0800
+
+ Merge pull request #502 from ianbarber/master
+
+ Add bounds check on upstream XSUB messages
+
+commit ba3e18f700659202247e38a7f48ea16d32bd8e79
+Author: Charles McGarvey <chazmcgarvey@brokenzipper.com>
+Date: Mon Jan 21 17:14:26 2013 -0700
+
+ define a dummy EPROTO for platforms that don't use it
+
+ This accomplishes the same thing as 2e2ef7fd in a potentially cleaner way.
+
+ src/err.hpp | 5 +++++
+ src/ipc_listener.cpp | 7 +------
+ src/tcp_listener.cpp | 7 +------
+ 3 files changed, 7 insertions(+), 12 deletions(-)
+
+commit d850272417dd7a3be4c5e0f429118f0005a0285b
+Author: Ian Barber <ianbarber@google.com>
+Date: Mon Jan 21 16:11:27 2013 -0800
+
+ Add size check on XSUB message sends
+
+ Ensures 0 length messages aren't being checked for subscribtion status on whatever data happens to be following the data pointer.
+
+ src/xsub.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit eeaa2c8e426b797be412f09c1a4071db1f6b2d01
+Merge: 3a63218 2e2ef7f
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Jan 21 14:47:35 2013 -0800
+
+ Merge pull request #501 from chazmcgarvey/conditional-eproto
+
+ do not use EPROTO on platforms that do not have it
+
+commit 2e2ef7fd330cd009c20b349a85d54e220d714f48
+Author: Charles McGarvey <chazmcgarvey@brokenzipper.com>
+Date: Mon Jan 21 15:00:55 2013 -0700
+
+ do not use EPROTO on platforms that do not have it
+
+ src/ipc_listener.cpp | 7 ++++++-
+ src/tcp_listener.cpp | 7 ++++++-
+ 2 files changed, 12 insertions(+), 2 deletions(-)
+
+commit 3a632185a625c9025393a624559624d2de078f60
+Merge: 29a1d8e 7918175
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Jan 20 03:43:49 2013 -0800
+
+ Merge pull request #500 from haf/fixes/asciidoc-title
+
+ Shortening the =-chars to make asciidoc work
+
+commit 791817571702f8d84379184bcbbe7b81b0c613dd
+Author: Henrik <henrik@haf.se>
+Date: Sat Jan 19 18:02:24 2013 +0100
+
+ Shortening the =-chars to make asciidoc work
+
+ doc/zmq_ctx_term.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 29a1d8ec6032e2ca9636ca112ed4ec033058772d
+Merge: f467011 21c97f0
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Jan 17 23:49:52 2013 -0800
+
+ Merge pull request #499 from minrk/ac_header
+
+ Minor autoconf tweaks
+
+commit f467011dbc718b251890a22cb6439cfc8b3d4424
+Merge: 21fc2a9 edd43e1
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Jan 17 23:49:32 2013 -0800
+
+ Merge pull request #498 from minrk/zmq_ctx_term
+
+ deprecate zmq_ctx_destroy in favor of zmq_ctx_term
+
+commit 21c97f0cc27ae8de2887fe0bad22e3fef60a3e26
+Author: MinRK <benjaminrk@gmail.com>
+Date: Thu Jan 17 16:00:38 2013 -0800
+
+ AM_CONFIG_HEADER -> AC_CONFIG_HEADERS
+
+ AM_CONFIG_HEADER raises an 'obsolete error' with automake 1.13.
+
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 64c019e24d14bdefd91faaa345174bc36c4e738e
+Author: MinRK <benjaminrk@gmail.com>
+Date: Thu Jan 17 15:59:11 2013 -0800
+
+ move configure.in -> configure.ac
+
+ autotools warns that configure.in
+ should actually be named configure.ac
+
+ configure.ac | 428 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ configure.in | 428 ----------------------------------------------------------
+ 2 files changed, 428 insertions(+), 428 deletions(-)
+
+commit edd43e1ca45b86b649cbcbdada801b04d2895001
+Author: MinRK <benjaminrk@gmail.com>
+Date: Thu Jan 17 14:36:38 2013 -0800
+
+ deprecate zmq_ctx_destroy in favor of zmq_ctx_term
+
+ in order to avoid logical collisions with pre-existing notions of context destruction in bindings (czmq, pyzmq).
+
+ builds/redhat/zeromq.spec.in | 1 +
+ doc/Makefile.am | 2 +-
+ doc/zmq.txt | 2 +-
+ doc/zmq_ctx_destroy.txt | 4 +--
+ doc/zmq_ctx_new.txt | 2 +-
+ doc/zmq_ctx_term.txt | 66 ++++++++++++++++++++++++++++++++++++++
+ doc/zmq_term.txt | 2 +-
+ include/zmq.h | 3 +-
+ src/zmq.cpp | 9 ++++--
+ tests/test_connect_delay.cpp | 10 +++---
+ tests/test_disconnect_inproc.cpp | 2 +-
+ 11 files changed, 88 insertions(+), 15 deletions(-)
+
+commit 21fc2a9946f65df7e03e852760b02833dd655018
+Merge: c2fbb72 bbc5bef
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Mon Jan 14 19:54:38 2013 -0800
+
+ Merge pull request #497 from hintjens/master
+
+ Clarified how icp:// works with zmq_bind
+
+commit bbc5befc66f187a769982b57b64712dbcc317250
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Jan 14 17:49:19 2013 +0100
+
+ Clarified zmq_bind on icp://
+
+ doc/zmq_ipc.txt | 15 ++++++++++++---
+ 1 file changed, 12 insertions(+), 3 deletions(-)
+
+commit c2fbb722a4de76dd894702da893517d6c5f5ab98
+Merge: 7d475ad 35f18ae
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sat Jan 12 08:33:33 2013 -0800
+
+ Merge pull request #496 from amuraru/master
+
+ Fixed el5/el6 deps in RPM spec file / newline fix
+
+commit 35f18aef74bf016e00ba60b84af267054a38968f
+Author: Adrian Muraru <amuraru@adobe.com>
+Date: Fri Jan 11 22:51:08 2013 +0200
+
+ Fixed newline in test_disconnect_inproc
+
+ tests/test_disconnect_inproc.cpp | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+commit fb0beb6f2942cfadb2a22fde97b809f26103741d
+Author: Adrian Muraru <amuraru@adobe.com>
+Date: Fri Jan 11 22:50:31 2013 +0200
+
+ Fixed el5/el6 deps in RPM spec file
+
+ builds/redhat/zeromq.spec.in | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+commit 7d475add7e798dca20f445453de43b88ef3eb0ac
+Merge: c1f76e4 d997d88
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Tue Jan 8 06:22:27 2013 -0800
+
+ Merge pull request #495 from hintjens/master
+
+ Whitespace and comment cleanups
+
+commit d997d88096f8588c0d80712a7fd2c212d36241d6
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Jan 8 09:18:38 2013 +0100
+
+ Revert "Old change to move ports off 5555 (was conflicting with other stuff)"
+
+ This reverts commit da0efaa81771aba497a961d70f2166f500a52afd.
+
+ tests/test_connect_delay.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit aff14067135f66aa9ce7816e08bac3a9b661b3e2
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Jan 8 09:18:23 2013 +0100
+
+ Revert "Test cases were failing on bind"
+
+ This reverts commit 8ba097f3da8d1a752755a52b1d3ec967c23f0643.
+
+ tests/test_raw_sock.cpp | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+commit a4bedc52552b6e4f8a903c3781b7e9897b310741
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Jan 8 09:16:50 2013 +0100
+
+ Whitespace and comment fixes
+
+ src/xpub.cpp | 17 ++++++++---------
+ src/xsub.cpp | 20 +++++++++++---------
+ 2 files changed, 19 insertions(+), 18 deletions(-)
+
+commit da0efaa81771aba497a961d70f2166f500a52afd
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Jan 8 09:09:27 2013 +0100
+
+ Old change to move ports off 5555 (was conflicting with other stuff)
+
+ tests/test_connect_delay.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit b0f0d3fcb49de6f1ebb9227ae664b9f426ece290
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Dec 23 17:59:34 2012 +0100
+
+ Clarification on zmq_msg_more
+
+ doc/zmq_msg_more.txt | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+commit 12a648db0773960e8b374a3b0ed57de36c62174a
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Dec 23 17:57:35 2012 +0100
+
+ Specified that it's safe to call zmq_msg_more after zmq_msg_close
+
+ doc/zmq_msg_more.txt | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+commit ef186fe15bfc7344fca015bc212eb2e98d8d3ed7
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Dec 23 17:47:44 2012 +0100
+
+ Spelling fixes
+
+ src/stream_engine.cpp | 11 +++++------
+ 1 file changed, 5 insertions(+), 6 deletions(-)
+
+commit af934f85caf5ec1e56514270c81ec57a92e106d9
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Dec 23 17:47:32 2012 +0100
+
+ Removed use of deprecated API methods
+
+ doc/zmq_msg_get.txt | 2 +-
+ doc/zmq_msg_more.txt | 2 +-
+ doc/zmq_recv.txt | 2 --
+ doc/zmq_recvmsg.txt | 1 -
+ doc/zmq_send.txt | 2 --
+ doc/zmq_sendmsg.txt | 2 --
+ doc/zmq_socket_monitor.txt | 6 +++---
+ 7 files changed, 5 insertions(+), 12 deletions(-)
+
+commit 8ba097f3da8d1a752755a52b1d3ec967c23f0643
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Nov 23 17:25:46 2012 +0900
+
+ Test cases were failing on bind
+
+ tests/test_connect_delay.cpp | 2 +-
+ tests/test_raw_sock.cpp | 8 ++++----
+ 2 files changed, 5 insertions(+), 5 deletions(-)
+
+commit c1f76e433f2180544e834587ae884adc60f02d97
+Merge: 98a91e8 d32e392
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Jan 8 00:05:07 2013 -0800
+
+ Merge pull request #494 from jgm-radez/master
+
+ allow XSUB/XPUB to send/recv messages unrelated to sub/unsub
+
+commit d32e3922785f170ce24159ab5e4b44badc473ec1
+Author: John Muehlhausen <jgm@jgm.org>
+Date: Mon Jan 7 22:24:24 2013 -0600
+
+ allow XSUB/XPUB to send/recv messages unrelated to sub/unsub (LIBZMQ-490)
+
+ zmq::xpub_t::xread_activated() – change to process messages without 0
+ or 1 prefix, but without affecting subscriptions
+
+ zmq::xsub_t::xsend() – change to send rather than discard messages
+ without 0 or 1 prefix, but without affecting subscriptions
+
+ Update documentation
+
+ doc/zmq_socket.txt | 6 ++++--
+ src/xpub.cpp | 3 +++
+ src/xsub.cpp | 11 ++++-------
+ 3 files changed, 11 insertions(+), 9 deletions(-)
+
+commit 98a91e852e87ae70dd320bd73d217c42c7eb950a
+Merge: 949d157 45f504d
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Wed Jan 2 12:51:43 2013 -0800
+
+ Merge pull request #493 from arsenm/master
+
+ Fix minor problem with cmake bulid
+
+commit 45f504d3e24930eea540c4a0a76a64094c56fbda
+Author: Matt Arsenault <arsenm2@rpi.edu>
+Date: Wed Jan 2 15:50:04 2013 -0500
+
+ Fix looking for rc sources in toplevel binary directory
+
+ CMakeLists.txt | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+commit 949d1578977ef11a46dfa1a991a2cc2affc0d9cc
+Merge: c7009d2 6ce4644
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Jan 2 00:32:15 2013 -0800
+
+ Merge pull request #492 from arsenm/master
+
+ Make CMake build usable for other systems
+
+commit 6ce464414bb453a40abadaa9d79389e5e3282fda
+Author: Matt Arsenault <whatmannerofburgeristhis@gmail.com>
+Date: Tue Jan 1 04:26:04 2013 -0500
+
+ Fix typos
+
+ src/socket_base.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit f770954d309c0778f1fe65a38b8e54c1063c8474
+Author: Matt Arsenault <arsenm2@rpi.edu>
+Date: Tue Jan 1 05:42:46 2013 -0500
+
+ Fix a couple more warnings
+
+ src/object.cpp | 1 +
+ src/options.cpp | 7 +++++--
+ src/signaler.cpp | 4 ++--
+ 3 files changed, 8 insertions(+), 4 deletions(-)
+
+commit 6ecb796e77dd5d48b65d7e78c40be6ee95696f96
+Author: Matt Arsenault <whatmannerofburgeristhis@gmail.com>
+Date: Tue Jan 1 17:16:50 2013 -0500
+
+ Fix warnings with MinGW
+
+ src/ip.cpp | 3 +++
+ src/signaler.cpp | 6 ++++--
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+commit 1ffc5d11dce5bbea970b9d9354e70d4e40346d38
+Author: Matt Arsenault <whatmannerofburgeristhis@gmail.com>
+Date: Tue Jan 1 04:24:51 2013 -0500
+
+ Fix some of the -Wshadows
+
+ src/options.cpp | 6 +++---
+ src/socket_base.cpp | 26 +++++++++++++-------------
+ 2 files changed, 16 insertions(+), 16 deletions(-)
+
+commit 14d3245e02f27857a80dba6ad6b7babed564a3d9
+Author: Matt Arsenault <whatmannerofburgeristhis@gmail.com>
+Date: Tue Jan 1 04:01:24 2013 -0500
+
+ Fix -Wmismatched-tags
+
+ src/i_decoder.hpp | 3 ++-
+ src/i_msg_sink.hpp | 3 ++-
+ src/i_msg_source.hpp | 3 ++-
+ 3 files changed, 6 insertions(+), 3 deletions(-)
+
+commit edb5a05add41de964170a1b72ae8038d30a00e17
+Author: Matt Arsenault <whatmannerofburgeristhis@gmail.com>
+Date: Tue Jan 1 03:56:34 2013 -0500
+
+ Fix -Wmissing-field-initializers
+
+ src/tcp_listener.cpp | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+commit 3ebab09ce4da3cd7e40355e5bd91a5e5a66d826b
+Author: Matt Arsenault <whatmannerofburgeristhis@gmail.com>
+Date: Tue Jan 1 03:26:31 2013 -0500
+
+ Fix unused argument warnings
+
+ CMakeLists.txt | 12 +++++++++---
+ src/decoder.hpp | 2 +-
+ src/zmq.cpp | 4 ++--
+ 3 files changed, 12 insertions(+), 6 deletions(-)
+
+commit e88dc494007e43a548c22e23b952e56832e60906
+Author: Matt Arsenault <whatmannerofburgeristhis@gmail.com>
+Date: Tue Jan 1 06:53:56 2013 -0500
+
+ Fix random 3 space tabs
+
+ CMakeLists.txt | 116 +++++++++++++++++++++++++++-----------------------------
+ 1 file changed, 55 insertions(+), 61 deletions(-)
+
+commit 59cafecd9696817e0faa2ba00404aef75b3c1187
+Author: Matt Arsenault <whatmannerofburgeristhis@gmail.com>
+Date: Tue Jan 1 21:04:19 2013 -0500
+
+ Fix MinGW32 build
+
+ Fix link errors when using -m32 with MinGW
+
+ CMakeLists.txt | 93 +++++++++++++++++++++++++-----------------
+ builds/cmake/platform.hpp.in | 4 ++
+ 2 files changed, 59 insertions(+), 38 deletions(-)
+
+commit 3c7d4840a1ff54b4a0de8be08481dbdf9b3c257a
+Author: Matt Arsenault <whatmannerofburgeristhis@gmail.com>
+Date: Tue Jan 1 02:25:15 2013 -0500
+
+ Fix NSIS installer errors, MinGW build.
+
+ The CPack NSIS installer was in a state where it would always give a
+ useless error. I think it was using stuff intended for running cpack
+ separately from cmake.
+
+ CMakeLists.txt | 89 ++++++++++++++++----------------------
+ cmake/Modules/FindAsciiDoc.cmake | 7 ++-
+ 2 files changed, 44 insertions(+), 52 deletions(-)
+
+commit a1d6a222ede4faec7cb27c5f0b67c1f7a0321e5d
+Author: Matt Arsenault <arsenm2@rpi.edu>
+Date: Mon Dec 31 18:23:25 2012 -0500
+
+ Generated header is not in ../src/
+
+ perf/inproc_lat.cpp | 2 +-
+ perf/inproc_thr.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+commit 4704159f7317b73dc779819f132516f8d273f0db
+Author: Matt Arsenault <arsenm2@rpi.edu>
+Date: Tue Jan 1 05:22:05 2013 -0500
+
+ Fix cmake build with sun studio
+
+ CMakeLists.txt | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+commit 74763e2c8ee5eccf2bea0ca64e7f784be4307404
+Author: Matt Arsenault <arsenm2@rpi.edu>
+Date: Tue Jan 1 05:34:44 2013 -0500
+
+ Don't use the toplevel cmake paths so the build works as a subproject
+
+ CMakeLists.txt | 101 ++++++++++++++++++++++++------------
+ cmake/Modules/TestZMQVersion.cmake | 47 ++++++-----------
+ 2 files changed, 82 insertions(+), 66 deletions(-)
+
+commit f3901b35d46c91ebd6a8f8b7b2110c15b54b90da
+Author: Matt Arsenault <arsenm2@rpi.edu>
+Date: Tue Jan 1 05:06:09 2013 -0500
+
+ Comments about ICC build failure with 12.x were crazy
+
+ Fix warnings with ICC.
+
+ CMakeLists.txt | 9 --
+ builds/cmake/platform.hpp.in | 3 -
+ cmake/Modules/AutoconfHelper.cmake | 298 ------------------------------------
+ src/stream_engine.hpp | 2 +-
+ 4 files changed, 1 insertion(+), 311 deletions(-)
+
+commit 0362c310a58f3304653592bf8c38f0d068e51c16
+Author: Matt Arsenault <whatmannerofburgeristhis@gmail.com>
+Date: Mon Dec 31 17:52:32 2012 -0500
+
+ First pass at getting cmake build to work with non-Windows systems.
+
+ Make doc building option dependent on asciidoc being installed
+ Fix MSVC build requiring cygwin.
+ Don't use try_run to get the version
+
+ CMakeLists.txt | 939 +++++++++++++++++++++-----------
+ builds/cmake/platform.hpp.in | 90 +++
+ cmake/Modules/AutoconfHelper.cmake | 298 ++++++++++
+ cmake/Modules/FindAsciiDoc.cmake | 19 +
+ cmake/Modules/TestZMQVersion.cmake | 2 +-
+ cmake/Modules/ZMQSourceRunChecks.cmake | 129 +++++
+ cmake/Modules/zmq_version.cpp | 31 --
+ src/libzmq.pc.cmake.in | 10 +
+ 8 files changed, 1164 insertions(+), 354 deletions(-)
+
+commit 73c370dd1772e09be476ec8dcbe097fb5de939e9
+Author: Matt Arsenault <whatmannerofburgeristhis@gmail.com>
+Date: Sun Dec 30 17:58:27 2012 -0500
+
+ Fix inconsistently using #if or #ifdef instead of #if defined
+
+ src/ip.cpp | 4 ++--
+ src/zmq.cpp | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+commit c7009d274ecfe49eee8ae064a9d148dda98c3196
+Merge: 1eee9ce 151a806
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Jan 1 08:32:12 2013 -0800
+
+ Merge pull request #491 from pijyoi/issue84
+
+ fix for LIBZMQ-84: Address already in use (signaler.cpp)
+
+commit 1eee9ce035585096e9ce33fc1a149b6cf147d5b5
+Merge: 8dda553 322808b
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sat Dec 29 02:26:06 2012 -0800
+
+ Merge pull request #490 from pijyoi/master
+
+ eliminate dead code moved into zmq_utils.cpp
+
+commit 151a80619bf3f9c4696788f79cd2c934ed26246d
+Author: KIU Shueng Chuan <nixchuan@gmail.com>
+Date: Sat Dec 29 18:05:15 2012 +0800
+
+ set SO_LINGER on first signaler socket to close in order to avoid
+ TIME_WAIT state.
+
+ src/signaler.cpp | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+commit 322808be9c9077bcd0acc921df6ceacc57a3c029
+Author: KIU Shueng Chuan <nixchuan@gmail.com>
+Date: Sat Dec 29 13:21:50 2012 +0800
+
+ eliminate code moved into zmq_utils.cpp
+
+ src/zmq.cpp | 29 -----------------------------
+ 1 file changed, 29 deletions(-)
+
+commit 8dda553ac4cad4504e7f9007dc0e8e471aec89a1
+Merge: ce24557 942c654
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Dec 27 05:46:20 2012 -0800
+
+ Merge pull request #489 from pijyoi/master
+
+ win32: fix Event handle leak
+
+commit 942c654d1cb556a91b4cca00bd4f0e50d5010a04
+Author: KIU Shueng Chuan <nixchuan@gmail.com>
+Date: Thu Dec 27 21:31:12 2012 +0800
+
+ win32: close zmq-signaler-port-sync event object to avoid handle leak
+
+ src/signaler.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+commit ce24557b11cc26b10cb217f1c7556101f64b7095
+Merge: 4febe88 2e9d4d4
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Dec 11 22:34:52 2012 -0800
+
+ Merge pull request #488 from steve-o/openpgm-next
+
+ Pull upstream OpenPGM 5.2.122 for multi-platform minor fixes.
+
+commit 2e9d4d413206f5ae307e5017c3744d267254feef
+Author: Steven McCoy <steven.mccoy@miru.hk>
+Date: Tue Dec 11 21:41:10 2012 -0500
+
+ Pull upstream OpenPGM 5.2.122 for multi-platform minor fixes.
+
+ CMakeLists.txt | 5 +++--
+ configure.in | 2 +-
+ foreign/openpgm/libpgm-5.1.118~dfsg.tar.gz | Bin 1046589 -> 0 bytes
+ foreign/openpgm/libpgm-5.2.122~dfsg.tar.gz | Bin 0 -> 951536 bytes
+ 4 files changed, 4 insertions(+), 3 deletions(-)
+
+commit 4febe88b2be300f8712a2e9ec57c351ccc39a102
+Merge: 2a7b219 a0cecc7
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Dec 11 08:09:08 2012 -0800
+
+ Merge pull request #487 from miniway/master
+
+ returns -1 with EAGAIN when mandatory is set and pipe is full
+
+commit a0cecc718d3d95279dcc7b0d9b6c1d09fb4cfd97
+Author: Min(Dongmin Yu) <miniway@gmail.com>
+Date: Tue Dec 11 19:41:36 2012 +0900
+
+ returns -1 with EAGAIN when mandatory is set and pipe is full
+
+ src/router.cpp | 12 ++++++------
+ tests/test_router_mandatory.cpp | 9 ++++-----
+ 2 files changed, 10 insertions(+), 11 deletions(-)
+
+commit 2a7b219f073d3bccb062379d3fc4ef933c8bab56
+Merge: 8da6b7a 394d755
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Dec 9 01:25:51 2012 -0800
+
+ Merge pull request #486 from miniway/master
+
+ return EHOSTUNREACH at full only when mandatory is set
+
+commit 394d755cf303ad6c263e877ebcda97108ad8666e
+Author: Min(Dongmin Yu) <miniway@gmail.com>
+Date: Sun Dec 9 16:52:45 2012 +0900
+
+ return EHOSTUNREACH at full only when mandatory is set
+
+ src/router.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 8da6b7a6fdb176aa184584001325920a04674be7
+Merge: 95d36f4 9382941
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Fri Dec 7 23:19:20 2012 -0800
+
+ Merge pull request #485 from miniway/master
+
+ returns EHOSTUNREACH when a peer is full if ZMQ_ROUTER_MANDATORY is set
+
+commit 9382941adc664f98535fd962d1262ff50fce3b71
+Author: Min(Dongmin Yu) <miniway@gmail.com>
+Date: Sat Dec 8 10:20:42 2012 +0900
+
+ returns EHOSTUNREACH when a peer is full if ZMQ_ROUTER_MANDATORY is set
+
+ src/router.cpp | 9 ++++++--
+ tests/test_router_mandatory.cpp | 46 ++++++++++++++++++++++++++++++++++++++-
+ 2 files changed, 52 insertions(+), 3 deletions(-)
+
+commit 95d36f42eea67b1752e819c9c49b19c74d6b938e
+Merge: ebd1bf9 6706efb
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Fri Dec 7 01:54:56 2012 -0800
+
+ Merge pull request #484 from pijyoi/master
+
+ fix wrong boolean operator in router_raw test code
+
+commit 6706efba2857b5b352a19a7f5ac575d7e3369ed7
+Author: KIU Shueng Chuan <nixchuan@gmail.com>
+Date: Fri Dec 7 17:45:05 2012 +0800
+
+ fix wrong boolean operator
+
+ tests/test_raw_sock.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit ebd1bf9bcf41fb812e452101b97eef55503b2b67
+Merge: b2f6741 21345ff
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Tue Dec 4 14:05:48 2012 -0800
+
+ Merge pull request #482 from sradomski/master
+
+ Close pipes for inproc sockets on zmq_disconnect
+
+commit 21345ffa5076aa587611e7099678f9cacdc9f160
+Author: Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de>
+Date: Tue Dec 4 17:40:43 2012 +0100
+
+ Break early when pipe to be removed was found
+
+ src/socket_base.cpp | 8 +++-----
+ 1 file changed, 3 insertions(+), 5 deletions(-)
+
+commit f9770e93efb75827410b13a20b83bcf08b13819d
+Author: Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de>
+Date: Tue Dec 4 17:31:46 2012 +0100
+
+ Fixed iterator when erasing from inprocs multimap
+
+ src/socket_base.cpp | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+commit 624dd1e5b5258d581149c173f3e95aff1e03a73f
+Author: Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de>
+Date: Tue Dec 4 17:10:32 2012 +0100
+
+ Removal of terminated pipes from inproc and ignoring peer ends
+
+ src/socket_base.cpp | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+commit 66c22456b97e1278ec0b24dcd1ff66e619d8fca2
+Author: Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de>
+Date: Tue Dec 4 15:14:21 2012 +0100
+
+ Close pipes for inproc sockets on zmq_disconnect
+
+ - fixes LIBZMQ-476 and LIBZMQ-475
+
+ AUTHORS | 1 +
+ doc/zmq_disconnect.txt | 2 +
+ src/socket_base.cpp | 33 ++++++++++-
+ src/socket_base.hpp | 4 ++
+ tests/Makefile.am | 5 +-
+ tests/test_disconnect_inproc.cpp | 119 ++++++++++++++++++++++++++++++++++++++
+ 6 files changed, 162 insertions(+), 2 deletions(-)
+
+commit b2f6741bcb73892fca4f7d374f18aecbf89435cb
+Merge: 013a99d 75161b5
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sat Dec 1 00:53:02 2012 -0800
+
+ Merge pull request #481 from ianbarber/master
+
+ Simplify test_connect_delay
+
+commit 75161b5c62f5f37e00573b3894cf8dc2b960e654
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Fri Nov 30 23:07:12 2012 +0000
+
+ Serialise test_connect_delay
+
+ Simplify the test connect delay test script, removing the threads and
+ moving to a serialised version. AFAICS this should provide the same
+ test, but without the race conditions that happened with the previous
+ test.
+
+ tests/test_connect_delay.cpp | 215 +++++++++++++++++++++---------------------
+ 1 file changed, 106 insertions(+), 109 deletions(-)
+
+commit 013a99daabeb6e31234341da8130a9ce7f7fb882
+Merge: a4a7316 3fc8c70
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Fri Nov 30 13:41:54 2012 -0800
+
+ Merge pull request #480 from vperron/master
+
+ Tiny fix
+
+commit 3fc8c7073d68235f0f6506d3c705778b40b86d15
+Author: Victor Perron <victor@iso3103.net>
+Date: Fri Nov 30 22:16:20 2012 +0100
+
+ Same fix, in-line style
+
+ src/decoder.hpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 33f42efb48af75194a31c5be8cd01868a12062f8
+Author: Victor Perron <victor@iso3103.net>
+Date: Fri Nov 30 21:39:22 2012 +0100
+
+ Change NULL to 0 to keep compatibility with some cross-compiling GCC
+ versions
+
+ src/decoder.hpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit a4a731652a2e7db91a8fa692c073da8c1dce0834
+Merge: cae5d3b 1d11f19
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Nov 26 08:23:43 2012 -0800
+
+ Merge pull request #479 from ianbarber/master
+
+ Update RPM spec file
+
+commit 1d11f196b1c556516177fa645c351bfadfa8a31c
+Author: Ian Barber <ianbarber@google.com>
+Date: Mon Nov 26 16:12:25 2012 +0000
+
+ Update SPEC file
+
+ Update the RPM spec file with Justin Cook's changes to fix the build for 3.2.2. (https://zeromq.jira.com/browse/LIBZMQ-473)
+
+ builds/redhat/zeromq.spec.in | 28 +++++++++++++++++++---------
+ 1 file changed, 19 insertions(+), 9 deletions(-)
+
+commit cae5d3b817fc6bbfc67b41e89585989900d6bbd3
+Merge: d1cbf96 359a505
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Nov 22 01:16:55 2012 -0800
+
+ Merge pull request #478 from methodmissing/event-messages-3.2
+
+ Event message memory corruption fixes
+
+commit d1cbf96cdee1677ebee6a1384dbdff4ef0f23a37
+Merge: a28322c e6da46f
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Thu Nov 22 00:03:02 2012 -0800
+
+ Merge pull request #477 from hintjens/master
+
+ Added autogen.sh hint to INSTALL
+
+commit e6da46ff8c8243419a16069bca364eb0adbbfca0
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Nov 22 12:09:02 2012 +0900
+
+ Added autogen.sh hint
+
+ INSTALL | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+commit 359a50594930b3522d354d790fdbca73a92ef52b
+Author: Lourens Naudé <lourens@methodmissing.com>
+Date: Thu Nov 22 00:12:17 2012 +0000
+
+ Prefer malloc to new for event address allocation as per Martin's recommendation
+
+ src/socket_base.cpp | 22 +++++++++++-----------
+ 1 file changed, 11 insertions(+), 11 deletions(-)
+
+commit a28322cd0cf7a62e4f41d70fa3896a438c23db9d
+Merge: 8db8c45 a8721c3
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Nov 21 14:15:59 2012 -0800
+
+ Merge pull request #476 from hurtonm/master
+
+ Check decoder's state function for NULL before calling it
+
+commit a8721c3c04f41f0b90a4b1ebaf4bcd767c45a6ab
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Wed Nov 21 22:50:55 2012 +0100
+
+ Check decoder's state function for NULL before calling it
+
+ Fixes bug reported by Peter Friend
+ (http://lists.zeromq.org/pipermail/zeromq-dev/2012-November/019425.html)
+
+ src/decoder.hpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+commit b1f4850153dbddb66c8e32fe3ce70361e954a38a
+Author: Lourens Naudé <lourens@methodmissing.com>
+Date: Wed Nov 21 18:27:53 2012 +0000
+
+ Let socket event messages initialize with zmq_msg_init_data and let the framework handle cleanup
+
+ src/socket_base.cpp | 6 ++++--
+ src/socket_base.hpp | 5 +++++
+ src/zmq.cpp | 41 +++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 50 insertions(+), 2 deletions(-)
+
+commit f78ca629b5b923c4a0485238d16e78c9eb131618
+Merge: 6d245eb 8db8c45
+Author: Lourens Naudé <lourens@methodmissing.com>
+Date: Wed Nov 21 18:04:05 2012 +0000
+
+ Merge branch 'master' of github.com:zeromq/libzmq
+
+commit 8db8c45b185557a2e8abd7818ba8d0c260725d7d
+Merge: 7e6c304 be4cc2f
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Nov 20 13:27:43 2012 -0800
+
+ Merge pull request #475 from ianbarber/master
+
+ Add ZMTP link to zmq_tcp doc.
+
+commit be4cc2f80aaeb202f7fc63ff0e729b428fbcdcd0
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Tue Nov 20 19:10:47 2012 +0000
+
+ Update zmq_tcp to include a reference to RFC
+
+ Include a note with a link to ZMQ RFC 15 for the ZMTP protocol
+ description.
+
+ doc/zmq_tcp.txt | 2 ++
+ 1 file changed, 2 insertions(+)
+
+commit 7e6c304a9871891f96a7d3c9254c863ad98a4e17
+Merge: 1a18c7b 1489857
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Mon Nov 19 02:40:36 2012 -0800
+
+ Merge pull request #474 from hintjens/master
+
+ Fixed doc for SNDHWM
+
+commit 14898579734ffe14d37a9b5ea74c880582eddabf
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Nov 19 16:32:58 2012 +0900
+
+ Fixed ZMQ_SNDHWM description
+
+ doc/zmq_setsockopt.txt | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+commit 7533ebb33d1cc6f23061e0228bf7eb22713aaa17
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Nov 19 10:20:56 2012 +0900
+
+ Clarified that SNDHWM is per part, not message
+
+ doc/zmq_setsockopt.txt | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+commit 6d245eb6bc614c050d7650c564fd1a986475cc67
+Author: Lourens Naudé <lourens@methodmissing.com>
+Date: Sat Nov 17 11:29:47 2012 +0000
+
+ Copy monitor specific event endpoints to event messages as the engine etc. can be released at anytime
+
+ src/ipc_connecter.cpp | 8 +++----
+ src/ipc_listener.cpp | 10 ++++----
+ src/socket_base.cpp | 61 +++++++++++++++++++++++++++++++------------------
+ src/socket_base.hpp | 27 ++++++++++++----------
+ src/stream_engine.cpp | 2 +-
+ src/tcp_connecter.cpp | 8 +++----
+ src/tcp_listener.cpp | 8 +++----
+ 7 files changed, 72 insertions(+), 52 deletions(-)
+
+commit ce4d32168440d5767805b7ee7cbfaac2f4c3f272
+Author: Lourens Naudé <lourens@methodmissing.com>
+Date: Sat Nov 17 10:06:09 2012 +0000
+
+ Revert "Merge pull request #473 from methodmissing/fix-engine-endpoint"
+
+ This reverts commit 1a18c7b0a816e10f8a8a770b2141d47f661f0302, reversing
+ changes made to bef9a41bdb991b867981317e0e20ee174ecd6fea.
+
+ src/stream_engine.cpp | 6 ++----
+ src/stream_engine.hpp | 2 +-
+ 2 files changed, 3 insertions(+), 5 deletions(-)
+
+commit 1a18c7b0a816e10f8a8a770b2141d47f661f0302
+Merge: bef9a41 fdf162a
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Fri Nov 16 13:06:24 2012 -0800
+
+ Merge pull request #473 from methodmissing/fix-engine-endpoint
+
+ [LIBZMQ-450] Copy the stream engine endpoint - string reference caused memory corruption
+
+commit fdf162a117782720ed8b7a1cbb71194f0c5136a9
+Author: Lourens Naudé <lourens@methodmissing.com>
+Date: Fri Nov 16 17:21:07 2012 +0000
+
+ [LIBZMQ-450] Copy the stream engine endpoint - string reference caused memory corruption
+
+ src/stream_engine.cpp | 6 ++++--
+ src/stream_engine.hpp | 2 +-
+ 2 files changed, 5 insertions(+), 3 deletions(-)
+
+commit bef9a41bdb991b867981317e0e20ee174ecd6fea
+Merge: 01b9bc3 b8d5d3f
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Nov 15 17:58:44 2012 -0800
+
+ Merge pull request #472 from jgm-radez/master
+
+ Issue 468
+
+commit b8d5d3fa695c5026c2af36daa8e357978ab135ac
+Author: John Muehlhausen <jgm@jgm.org>
+Date: Thu Nov 15 15:30:30 2012 -0600
+
+ Issue 468
+
+ XPUB "verbose" mode excludes unsubscriptions
+
+ src/xpub.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit 01b9bc36631f168ec2096e88a4d280cc45912557
+Merge: 37f8ce6 5205415
Author: Pieter Hintjens <ph@imatix.com>
-Date: Thu Nov 22 23:54:06 2012 -0800
+Date: Wed Nov 14 02:12:29 2012 -0800
- Merge pull request #65 from hintjens/master
+ Merge pull request #471 from methodmissing/fix-disconnect-event-addr
- Release 3.2.2 stable
+ Fix addresses on triggered events
-commit 61b936893d7048c47c61daf3d42bb2d16392bfbf
-Author: Pieter Hintjens <ph@imatix.com>
-Date: Fri Nov 23 16:52:50 2012 +0900
+commit 5205415beb7631200a0dc150d1e6acf8089b65ff
+Author: Lourens Naudé <lourens@methodmissing.com>
+Date: Wed Nov 14 09:51:24 2012 +0000
- Updated NEWS for release 3.2.2
+ Fix addresses on triggered events
- NEWS | 22 ++++++++++++++++++++++
- 1 file changed, 22 insertions(+)
+ src/socket_base.cpp | 18 +++++++++---------
+ 1 file changed, 9 insertions(+), 9 deletions(-)
-commit bcf8916e17b00b2092df56e3b9c89ba294583ad7
-Author: Pieter Hintjens <ph@imatix.com>
-Date: Fri Nov 23 16:42:13 2012 +0900
+commit 37f8ce69c17c7200605d3c3e688bf1a9e191e121
+Merge: 30eaadd 6559da3
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Tue Nov 13 12:13:58 2012 -0800
+
+ Merge pull request #470 from cdolan/master
+
+ Fixed test compilation issue by using memset/memmove rather than bzero/bcopy
- Backported latest socket event framework
+commit 6559da3033f20bd978a9647d21343f5978b311ec
+Author: Christopher Dolan <chris@codingstream.org>
+Date: Tue Nov 13 19:33:18 2012 +0000
- src/ipc_connecter.cpp | 11 +++--
- src/ipc_listener.cpp | 10 ++--
- src/socket_base.cpp | 109 ++++++++++++++++++++++++------------------
- src/socket_base.hpp | 28 +++++++----
- src/stream_engine.cpp | 2 +-
- src/tcp_connecter.cpp | 11 +++--
- src/tcp_listener.cpp | 8 ++--
- src/zmq.cpp | 63 +++++++++++++++++++-----
- tests/test_connect_delay.cpp | 6 +--
- 9 files changed, 157 insertions(+), 91 deletions(-)
+ Use memset/memmove rather than bzero/bcopy
-commit 12f3f8a7f68d44fe73e5b4fe20752c323453e23e
-Merge: efdb5cf 9120741
-Author: Pieter Hintjens <ph@imatix.com>
-Date: Wed Nov 21 19:20:21 2012 -0800
+ tests/test_raw_sock.cpp | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
- Merge pull request #64 from hintjens/master
+commit 30eaadddc3d95e194966e96e8b4a011ee7e5638b
+Merge: c179ad1 9013ee0
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Tue Nov 13 04:29:44 2012 -0800
+
+ Merge pull request #469 from hurtonm/code_cleanup
- Backported fix for LIBZMQ-472
+ Minor code cleanup
-commit 9120741719d7d842fd430eff3f7c028b060b045a
+commit 9013ee0d52bb88a5ea08b78c1d31ea5b1b0cd95d
Author: Martin Hurton <hurtonm@gmail.com>
-Date: Wed Nov 21 22:50:55 2012 +0100
+Date: Tue Nov 13 13:06:29 2012 +0100
- Check decoder's state function for NULL before calling it
-
- Fixes bug reported by Peter Friend
- (http://lists.zeromq.org/pipermail/zeromq-dev/2012-November/019425.html)
+ Minor code cleanup
- src/decoder.hpp | 4 ++++
- 1 file changed, 4 insertions(+)
+ src/epoll.cpp | 5 +++--
+ src/kqueue.cpp | 5 +++--
+ src/poll.cpp | 6 +++---
+ src/select.cpp | 5 +++--
+ 4 files changed, 12 insertions(+), 9 deletions(-)
-commit efdb5cf076348446a1f25e98a47cb0bca789e192
-Merge: f9b6da0 ae8c4a4
+commit c179ad11730cfe742ccd74577372aef43fed2fa1
+Merge: 99f7144 c543b2c
Author: Pieter Hintjens <ph@imatix.com>
-Date: Wed Nov 21 19:10:12 2012 -0800
+Date: Tue Nov 13 03:56:01 2012 -0800
- Merge pull request #63 from hintjens/master
+ Merge pull request #468 from hurtonm/issue_465
- Added autogen.sh hint to INSTALL
+ Resolve LIBZMQ-465
-commit ae8c4a4adf7f6cc90fa84b4e37ae0587c4f891d2
-Author: Pieter Hintjens <ph@imatix.com>
-Date: Thu Nov 22 12:09:31 2012 +0900
+commit c543b2ce8cb0dd8790e7bdc89b08ef49812616d4
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Sat Nov 10 23:05:10 2012 +0100
- Added autogen.sh hint
+ Resolve LIBZMQ-465
- INSTALL | 7 +++++++
- 1 file changed, 7 insertions(+)
+ src/decoder.cpp | 5 -----
+ src/decoder.hpp | 24 ++++++++++++++++++------
+ src/i_decoder.hpp | 2 +-
+ src/raw_decoder.cpp | 2 +-
+ src/raw_decoder.hpp | 2 +-
+ src/stream_engine.cpp | 17 +++++++++++------
+ src/stream_engine.hpp | 4 +++-
+ src/v1_decoder.cpp | 5 -----
+ src/v1_decoder.hpp | 2 --
+ 9 files changed, 35 insertions(+), 28 deletions(-)
-commit f9b6da0e78f3672e577e0eb15312d9601df99ccd
-Merge: 65a29e8 f5a9c32
+commit 99f714445f67d552eb2add6ed5f818d546dce901
+Merge: 793895c 66dc4d8
Author: Pieter Hintjens <ph@imatix.com>
-Date: Sun Nov 18 23:33:54 2012 -0800
+Date: Fri Nov 9 08:45:22 2012 -0800
- Merge pull request #61 from hintjens/master
+ Merge pull request #467 from hurtonm/code_cleanup
- Fixed doc for SNDHWM
+ Code cleanup
-commit f5a9c328e99eddfc12ba057e2052fa94be83a0ec
-Author: Pieter Hintjens <ph@imatix.com>
-Date: Mon Nov 19 16:33:20 2012 +0900
+commit 66dc4d8b542ca8571b66cc7fcf97daa87734e36f
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Fri Nov 9 17:17:43 2012 +0100
- Fixed ZMQ_SNDHWM description
+ Don't pass flags to xrecv method
- doc/zmq_setsockopt.txt | 10 +++++-----
- 1 file changed, 5 insertions(+), 5 deletions(-)
+ src/dealer.cpp | 5 +----
+ src/dealer.hpp | 2 +-
+ src/pair.cpp | 5 +----
+ src/pair.hpp | 2 +-
+ src/pub.cpp | 2 +-
+ src/pub.hpp | 2 +-
+ src/pull.cpp | 5 +----
+ src/pull.hpp | 2 +-
+ src/rep.cpp | 6 +++---
+ src/rep.hpp | 2 +-
+ src/req.cpp | 8 ++++----
+ src/req.hpp | 2 +-
+ src/router.cpp | 5 +----
+ src/router.hpp | 2 +-
+ src/socket_base.cpp | 8 ++++----
+ src/socket_base.hpp | 2 +-
+ src/xpub.cpp | 5 +----
+ src/xpub.hpp | 2 +-
+ src/xsub.cpp | 5 +----
+ src/xsub.hpp | 2 +-
+ 20 files changed, 28 insertions(+), 46 deletions(-)
+
+commit 7865f96e97e6e225d19e9f75317196e62f378cd9
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Fri Nov 9 17:08:03 2012 +0100
+
+ Don't pass flags to xsend method
+
+ src/dealer.cpp | 4 ++--
+ src/dealer.hpp | 2 +-
+ src/dist.cpp | 13 +++++--------
+ src/dist.hpp | 6 +++---
+ src/lb.cpp | 5 +----
+ src/lb.hpp | 2 +-
+ src/pair.cpp | 4 ++--
+ src/pair.hpp | 2 +-
+ src/push.cpp | 4 ++--
+ src/push.hpp | 2 +-
+ src/rep.cpp | 6 +++---
+ src/rep.hpp | 2 +-
+ src/req.cpp | 6 +++---
+ src/req.hpp | 2 +-
+ src/router.cpp | 5 +----
+ src/router.hpp | 2 +-
+ src/socket_base.cpp | 6 +++---
+ src/socket_base.hpp | 2 +-
+ src/sub.cpp | 4 ++--
+ src/sub.hpp | 2 +-
+ src/xpub.cpp | 4 ++--
+ src/xpub.hpp | 2 +-
+ src/xsub.cpp | 6 +++---
+ src/xsub.hpp | 2 +-
+ 24 files changed, 43 insertions(+), 52 deletions(-)
-commit 65a29e85ee66c292b78d9fa1eef3ee577659377c
-Merge: 7f81575 f0383bf
+commit 793895c477cab1da4edd1565d9f70bc8f7d485a8
+Merge: d1e0889 b78800e
Author: Pieter Hintjens <ph@imatix.com>
-Date: Sun Nov 18 17:22:24 2012 -0800
+Date: Fri Nov 9 06:51:04 2012 -0800
- Merge pull request #60 from hintjens/master
+ Merge pull request #466 from hurtonm/code_cleanup
- Fixed doc for SNDHWM
+ Simplify implementation of DEALER socket
-commit f0383bffad74a7377c880b5f6196ea42b477874f
-Author: Pieter Hintjens <ph@imatix.com>
-Date: Mon Nov 19 10:21:46 2012 +0900
+commit b78800e467cb56820f07484e25e2360254ce8c5b
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Fri Nov 9 15:45:25 2012 +0100
- Clarified that SNDHWM is per part, not message
+ Simplify implementation of DEALER socket
- doc/zmq_setsockopt.txt | 8 ++++++--
- 1 file changed, 6 insertions(+), 2 deletions(-)
+ src/dealer.cpp | 26 ++------------------------
+ src/dealer.hpp | 6 ------
+ 2 files changed, 2 insertions(+), 30 deletions(-)
-commit a7438de239bb1fc6925c9dd0fcbfa994aa55e2da
-Author: John Muehlhausen <jgm@jgm.org>
-Date: Thu Nov 15 15:30:30 2012 -0600
+commit d1e0889ab02b093233bb4fae26723c9b8daecb3b
+Merge: 3eaf4a9 6290054
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Fri Nov 9 06:19:23 2012 -0800
- Issue 468
+ Merge pull request #463 from hintjens/master
- XPUB "verbose" mode excludes unsubscriptions
-
- src/xpub.cpp | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
+ Addded ROUTER-ROUTER (back) as valid combination
-commit 7f8157524525ee8544f6637fb9bcf4acb9b14915
-Merge: f976e8c c05a1b1
+commit 3eaf4a967c6e9ea2dee9ec5f7bbb6753f4c17900
+Merge: de33978 19a8ea4
Author: Pieter Hintjens <ph@imatix.com>
-Date: Wed Nov 14 02:38:02 2012 -0800
+Date: Fri Nov 9 06:13:18 2012 -0800
- Merge pull request #59 from hintjens/master
+ Merge pull request #465 from steve-o/cmake-minor
- Backported fix for LIBZMQ-450
+ Cmake minor version labeling and sync with 3.x
-commit c05a1b1f26497adf0f4adce2d62cc37c4349bba3
-Author: Lourens Naudé <lourens@methodmissing.com>
-Date: Wed Nov 14 09:51:24 2012 +0000
+commit 19a8ea4584f63d9fbdb695347f1d9b359f70698f
+Author: Steven McCoy <steven.mccoy@miru.hk>
+Date: Fri Nov 9 08:54:14 2012 -0500
+
+ Update source list with raw codec.
+
+ CMakeLists.txt | 2 ++
+ 1 file changed, 2 insertions(+)
- Backported fix for addresses on triggered events
+commit 3ba401d7da3b01f97fd8a0409aace71d7f81a6a3
+Author: Steven McCoy <steven.mccoy@miru.hk>
+Date: Fri Nov 9 08:48:59 2012 -0500
+
+ Bring along CMake patchset from zeromq3-x for adding minor version to Windows labeling.
- src/socket_base.cpp | 120 ++++++++++++++++++++++++++++-----------------------
- 1 file changed, 65 insertions(+), 55 deletions(-)
+ CMakeLists.txt | 96 +++++++++++++++++++++++++++++-----------------
+ cmake/NSIS.template64.in | 20 +++++-----
+ 2 files changed, 70 insertions(+), 46 deletions(-)
-commit f976e8cc98b15e987550ec0dd6417d07080547b6
-Merge: 69fa792 07122ee
+commit de339785f261ad85146dfdf23d6b6c89ea3011fa
+Merge: ec08241 ea19b7b
Author: Pieter Hintjens <ph@imatix.com>
-Date: Tue Nov 13 17:03:48 2012 -0800
+Date: Fri Nov 9 05:19:05 2012 -0800
- Merge pull request #58 from hintjens/master
+ Merge pull request #464 from hurtonm/code_cleanup
- Addded ROUTER-ROUTER and DEALER-DEALER (back) as valid combinations
+ Code cleanup
+
+commit ea19b7b65801669308b776c644acb056fa29a4e9
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Fri Nov 9 14:12:11 2012 +0100
+
+ Small cleanups
+
+ src/options.cpp | 2 +-
+ src/req.cpp | 1 -
+ src/session_base.cpp | 2 --
+ src/socket_base.cpp | 14 +++++---------
+ 4 files changed, 6 insertions(+), 13 deletions(-)
+
+commit 925a53066344f24279763205d01dde4dfcf3ff7c
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Fri Nov 9 14:02:19 2012 +0100
+
+ Use const_cast operator to remove const modifier
+
+ src/socket_base.cpp | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+commit 82999f2d203295265f323ec44799296012959db4
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Fri Nov 9 13:49:27 2012 +0100
+
+ Don't forward identities to DEALER sockets
+
+ src/dealer.cpp | 12 +-----------
+ 1 file changed, 1 insertion(+), 11 deletions(-)
-commit 07122eefec4d542745cc096138195a0f5d861a6b
+commit 6290054f00596a1b4b29b3a2e2c2d7c1a00549e3
Author: Pieter Hintjens <ph@imatix.com>
-Date: Wed Nov 14 10:03:11 2012 +0900
+Date: Fri Nov 9 21:10:34 2012 +0900
- Updated doc to allow DEALER-DEALER and ROUTER-ROUTER
+ Added ROUTER-ROUTER as legal combination
- doc/zmq_socket.txt | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
+ doc/zmq_socket.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit 69fa792caeee4930d2a66c43bdfe580a20d1b29a
-Merge: 36736e6 30738e1
+commit ec0824142ec6bc4932919b53f5d511b6f983693e
+Merge: 4e028ec c1e960b
Author: Pieter Hintjens <ph@imatix.com>
-Date: Tue Nov 13 04:40:49 2012 -0800
+Date: Thu Nov 8 17:02:50 2012 -0800
- Merge pull request #57 from hintjens/master
+ Merge pull request #462 from hurtonm/raw_fixes
- Backported fixes for LIBZMQ-465
+ Fix raw mode on reconnect
-commit 30738e1123550a511060d5b871218894e1a9cb33
-Author: Pieter Hintjens <ph@imatix.com>
-Date: Tue Nov 13 21:39:59 2012 +0900
+commit c1e960b31d0a2ffdcb3016e7301b9da5ca612493
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Thu Nov 8 18:17:11 2012 +0100
- Backported fix for ZMQ-465
+ Never exchange identities for sockets in raw mode
+
+ Zeromq shall never send/receive socket identifiers for sockets in raw
+ mode. The existing implementation breaks this requirement after
+ reconnection.
- src/decoder.hpp | 1 -
- 1 file changed, 1 deletion(-)
+ src/session_base.cpp | 15 ++++++---------
+ 1 file changed, 6 insertions(+), 9 deletions(-)
-commit 50b6da0c1cc992293603915aa62769e739a41b3f
+commit aec47b364225c347a7edca778185f407308c2e83
Author: Martin Hurton <hurtonm@gmail.com>
-Date: Tue Nov 13 13:06:29 2012 +0100
+Date: Thu Nov 8 14:31:26 2012 +0100
- Minor code cleanup
+ Extend ZMQ_ROUTER_RAW test
+
+ Add test when the zeromq socket connects to a TCP socket.
+ The test now fails due to bug in the zeromq library.
- src/epoll.cpp | 5 +++--
- src/kqueue.cpp | 5 +++--
- src/poll.cpp | 6 +++---
- src/select.cpp | 5 +++--
- 4 files changed, 12 insertions(+), 9 deletions(-)
+ tests/test_raw_sock.cpp | 103 +++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 103 insertions(+)
+
+commit 872ef76f3c45bcd1cc30eb45b8eb3545b70808f1
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Nov 7 17:23:37 2012 +0100
+
+ Added DEALER-DEALER as legal combination
+
+ doc/zmq_socket.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 4e028ecb30a9fcd8d8c26c9e92de8077c306ef93
+Merge: 5da9712 e51a1f0
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Nov 6 21:20:54 2012 -0800
+
+ Merge pull request #461 from hurtonm/code_cleanup
+
+ session_base: code cleanup
-commit 0c0a351fa5ffed3b66206eac6b77cef2fb316151
+commit e51a1f04c9812bd77c4d0062d53f6874ec5efa62
Author: Martin Hurton <hurtonm@gmail.com>
-Date: Sat Nov 10 23:05:10 2012 +0100
+Date: Tue Nov 6 23:47:43 2012 +0100
- Backported fix for ZMQ-465
+ session_base: code cleanup
+
+ - add unlikely hints
+ - drop unnecessary assertion
+ - style fixes
+
+ There is no need to require the 'more' flag in the provided message
+ structure be 0 when pulling message from the session.
- src/decoder.cpp | 5 -----
- src/decoder.hpp | 31 +++++++++++++++++++++++++------
- src/i_decoder.hpp | 2 +-
- src/stream_engine.cpp | 17 +++++++++++------
- src/stream_engine.hpp | 4 +++-
- src/v1_decoder.cpp | 5 -----
- src/v1_decoder.hpp | 2 --
- 7 files changed, 40 insertions(+), 26 deletions(-)
+ src/session_base.cpp | 30 +++++++++++++-----------------
+ 1 file changed, 13 insertions(+), 17 deletions(-)
+
+commit 5da971275dcccb7d41dadf2b8e030983d57c18aa
+Merge: 80aef8d 777c38a
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Tue Nov 6 07:05:52 2012 -0800
+
+ Merge pull request #460 from hintjens/master
+
+ Renamed ZMQ_ROUTER_RAW_SOCK to ZMQ_ROUTER_RAW
+
+commit 777c38ae32a5d1799b3275d38ff8d587c885dd55
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Nov 6 13:18:58 2012 +0100
+
+ Renamed raw option to ZMQ_ROUTER_RAW
-commit 36736e64cc10b4e2bfbea9b93eb4b4c8bdc8badd
-Merge: 87c6ebb 50e9d72
+ doc/zmq_setsockopt.txt | 17 +++++++++++++++++
+ include/zmq.h | 2 +-
+ src/router.cpp | 4 ++--
+ tests/test_raw_sock.cpp | 2 +-
+ 4 files changed, 21 insertions(+), 4 deletions(-)
+
+commit 80aef8dfda2bea1efcf20da983ca45cdd287385f
+Merge: 1348924 41dc2e6
Author: Pieter Hintjens <ph@imatix.com>
-Date: Tue Nov 6 04:01:22 2012 -0800
+Date: Tue Nov 6 00:47:59 2012 -0800
- Merge pull request #56 from hintjens/master
+ Merge pull request #459 from hurtonm/issue_459
- Backported fixes for LIBZMQ-459
+ Resolve LIBZMQ-459
-commit 50e9d72dc4015e2c582bd7cadf5928e7e47dc38b
+commit 41dc2e60493ff1f10a8d2c4c8ae41f55ee4c327e
Author: Martin Hurton <hurtonm@gmail.com>
Date: Fri Nov 2 11:11:14 2012 +0100
src/stream_engine.cpp | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
-commit 87c6ebb135f4a774dbd13677b269b0ba0b98249e
-Merge: ed9c744 4527d8d
-Author: Pieter Hintjens <ph@imatix.com>
-Date: Mon Nov 5 09:44:33 2012 -0800
+commit 13489242513a6b1b67c23a5baa39ed9ab4ca7cea
+Merge: 2deb2e0 f67a199
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Mon Nov 5 09:41:56 2012 -0800
- Merge pull request #55 from vortechs2000/remove_cpp_comments_from_zmq_h
+ Merge pull request #458 from vortechs2000/remove_cpp_comments_from_zmq_h
Older versions of C compilers don't like C++ comments
-commit 4527d8db6f970e2b3f788b2dd04b7cff4803e11a
+commit f67a19933202c01a1ead80aa2943356c8e7915bf
Author: AJ Lewis <aj.lewis@quantum.com>
Date: Mon Nov 5 11:27:13 2012 -0600
There's no need to exclude older compilers by putting C++ style
comments in the C API header.
-
- Signed-off-by: AJ Lewis <aj.lewis@quantum.com>
include/zmq.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
-commit ed9c7440d2cdf8a9100f06684ee82c19d9e7cc94
-Merge: f56c6fa fec6497
+commit 2deb2e095eead548f52e837d679e17a9d96574d2
+Merge: cdd7cd1 1e60d17
Author: Pieter Hintjens <ph@imatix.com>
-Date: Thu Nov 1 08:43:41 2012 -0700
+Date: Thu Nov 1 21:47:23 2012 -0700
+
+ Merge pull request #457 from mjasperse/patch-1
+
+ Update builds/msvc/libzmq/libzmq.vcproj
+
+commit 1e60d17a23ce943ac7575185acfe5049e70c7e2a
+Author: mjasperse <m.jasperse@gmail.com>
+Date: Fri Nov 2 11:29:46 2012 +1100
+
+ Update builds/msvc/libzmq/libzmq.vcproj
+
+ Without the LinkDLL statement, command-line compile using vcbuild attempts to compile EXE and complains about entrypoint
+ The LinkDLL statement forces the linker to produce desired output
- Merge pull request #54 from hintjens/master
+ builds/msvc/libzmq/libzmq.vcproj | 3 +++
+ 1 file changed, 3 insertions(+)
+
+commit cdd7cd10c95897c299febb1a6856ca9cdc5579f2
+Merge: 04e716a 7c66e8f
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Thu Nov 1 07:04:17 2012 -0700
+
+ Merge pull request #456 from hurtonm/issue_464
- Backported fixes for LIBZMQ-464
+ Resolve LIBZMQ-464
-commit fec6497976a37b86cb0214303d6260c07c1f7341
+commit 7c66e8f807881e0e98d6b8b5f28908777375b4c5
Author: Martin Hurton <hurtonm@gmail.com>
Date: Thu Nov 1 14:37:42 2012 +0100
src/msg.cpp | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
-commit f56c6faf657d2c6571313716ef77d5dc5f0ff13b
-Merge: fff2670 1d9a3fd
-Author: Pieter Hintjens <ph@imatix.com>
-Date: Tue Oct 30 20:38:56 2012 -0700
+commit 04e716ac9967c6d3318c2db3bdb9d83f54a1db60
+Merge: 0404b3b 79da450
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Wed Oct 31 01:16:05 2012 -0700
- Merge pull request #53 from hintjens/master
+ Merge pull request #455 from hintjens/master
- Fixed formatting on zmq_getsockopt.txt
+ zmq_getsockopt man page was malformatted
-commit 1d9a3fd480aa60a63d21792d3aefcad01215f133
+commit 79da450b8b3e4d100b3fa2eaca467850f481adb4
Author: Pieter Hintjens <ph@imatix.com>
-Date: Wed Oct 31 04:38:19 2012 +0100
+Date: Wed Oct 31 04:28:53 2012 +0100
Fixed formatting in man page
+ .gitignore | 1 +
doc/zmq_getsockopt.txt | 16 ++++++++--------
- 1 file changed, 8 insertions(+), 8 deletions(-)
+ 2 files changed, 9 insertions(+), 8 deletions(-)
+
+commit 0404b3b60a8e1b95c928f26c304b1ee7ff7ffa7c
+Merge: abbe34c 9d8eb1f
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Tue Oct 30 04:24:21 2012 -0700
-commit fff267071dc89a43470920d10666ed2f1d29c9dd
-Merge: 08b0af5 ec8d935
+ Merge pull request #454 from hurtonm/code_cleanup
+
+ Style fixes
+
+commit 9d8eb1f9b94da7330b7c7ef2735c6a329a640a71
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Tue Oct 30 12:18:13 2012 +0100
+
+ Style fixes
+
+ src/decoder.hpp | 5 +-
+ src/i_decoder.hpp | 2 +-
+ src/options.hpp | 2 +-
+ src/raw_decoder.cpp | 2 +-
+ src/raw_decoder.hpp | 2 +-
+ src/raw_encoder.cpp | 1 -
+ src/raw_encoder.hpp | 1 -
+ src/router.cpp | 36 ++++++-------
+ src/session_base.cpp | 14 ++---
+ src/stream_engine.cpp | 17 ++++---
+ tests/test_raw_sock.cpp | 129 +++++++++++++++++++++--------------------------
+ 11 files changed, 99 insertions(+), 112 deletions(-)
+
+commit abbe34cdc2c5889e3de021bdc237a297ffa654a6
+Merge: 4bc405a d16e0a5
Author: Pieter Hintjens <ph@imatix.com>
-Date: Tue Oct 30 03:13:50 2012 -0700
+Date: Tue Oct 30 03:12:46 2012 -0700
- Merge pull request #52 from hintjens/master
+ Merge pull request #453 from hurtonm/issue_458
- Backported fixes for LIBZMQ-458
+ Resolve LIBZMQ-458
-commit ec8d935acc0127d9a344ef2308641ddb37131e92
+commit d16e0a534263eb80331b4b79c583b16e726a58dd
Author: Martin Hurton <hurtonm@gmail.com>
Date: Tue Oct 30 11:03:41 2012 +0100
tests/test_router_mandatory.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-commit 08b0af50752c4c707b53119a120cd9a6af323f5b
-Merge: b0576e8 5b9de45
+commit 4bc405a366db75567dbc3175b8bb3578cce7685b
+Merge: 7523b9e 83387b4
Author: Pieter Hintjens <ph@imatix.com>
-Date: Mon Oct 29 22:29:33 2012 -0700
+Date: Mon Oct 29 21:00:15 2012 -0700
- Merge pull request #51 from hintjens/master
+ Merge pull request #452 from hshardeesi/master
- Backported fixes for LIBZMQ-447
+ New socket option (ZMQ_ROUTER_RAW_SOCK) for ZMQ_ROUTER sockets
-commit b0576e8c543507ff0d13326f53cb0a34b859e207
-Merge: 2996b25 a5da31e
+commit 7523b9ed29869b7bbe8d5b9c567675f756b565ff
+Merge: dcf0693 3aa3032
Author: Pieter Hintjens <ph@imatix.com>
-Date: Mon Oct 29 22:28:16 2012 -0700
+Date: Mon Oct 29 03:21:33 2012 -0700
- Merge pull request #47 from steve-o/master
+ Merge pull request #451 from hurtonm/use_correct_types_in_stream_engine
- Improve PGM build integration for Windows
+ Use correct types when returning value in read/write methods
-commit 5b9de45a89b46f9b2a07236efcee7182ff1c2dee
+commit dcf0693d6eb20e143d38a58fb389c2d9068a4080
+Merge: 19f77a1 03deb2c
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Oct 29 03:21:09 2012 -0700
+
+ Merge pull request #450 from hurtonm/issue_447
+
+ Resolve LIBZMQ-447
+
+commit 3aa30329d18109cfdfefbacfb53cbc927ce7a964
+Author: Martin Hurton <hurtonm@gmail.com>
+Date: Sat Sep 29 13:28:25 2012 +0200
+
+ Use correct types when returning value in read/write methods
+
+ src/stream_engine.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit 03deb2c97aa6447005d49128f24e253a941b98d7
Author: Martin Hurton <hurtonm@gmail.com>
Date: Mon Oct 29 10:09:00 2012 +0100
src/socket_base.cpp | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
-commit 2996b25039a7e30de4c186fb376b58f5671875d2
-Merge: ceb388e 09c56c4
+commit 83387b4073233955c5033d377e6d21e74fafc793
+Author: Hardeep <hshardeesi@gmail.com>
+Date: Mon Oct 29 00:03:36 2012 -0700
+
+ Added support for non-zmq tcp client connections to router socket.
+ - Created a new option ZMQ_ROUTER_RAW_SOCK
+ - Added new raw_encoder and raw_decoder to receive and send messages in raw form to remote client
+ - Added test case file tests/test_raw_sock.cpp
+
+ o To create a raw router sock set the ZMQ_ROUTER_RAW_SOCK option
+ o ZMQ_MSGMORE flag is ignored for non-id messages
+ o To terminate a remote connection send id message followed by zero length data message
+
+ AUTHORS | 1 +
+ include/zmq.h | 1 +
+ src/Makefile.am | 6 +-
+ src/decoder.hpp | 5 ++
+ src/i_decoder.hpp | 3 +-
+ src/options.cpp | 1 +
+ src/options.hpp | 3 +
+ src/raw_decoder.cpp | 99 ++++++++++++++++++++++++++++
+ src/raw_decoder.hpp | 69 ++++++++++++++++++++
+ src/raw_encoder.cpp | 87 ++++++++++++++++++++++++
+ src/raw_encoder.hpp | 69 ++++++++++++++++++++
+ src/router.cpp | 74 +++++++++++++++------
+ src/router.hpp | 1 +
+ src/session_base.cpp | 14 ++++
+ src/stream_engine.cpp | 42 +++++++++---
+ tests/Makefile.am | 4 +-
+ tests/test_raw_sock.cpp | 167 +++++++++++++++++++++++++++++++++++++++++++++++
+ 17 files changed, 615 insertions(+), 31 deletions(-)
+
+commit 19f77a1ccfaf431afec221c5a66888541a48152f
+Merge: 6b45262 0bf8a4d
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Sat Oct 27 18:25:42 2012 -0700
+
+ Merge pull request #449 from hintjens/master
+
+ Fixed code formatting
+
+commit 0bf8a4d2d2474a738f883db718a4d65beb7138e9
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Sun Oct 28 07:36:18 2012 +0900
+
+ Code formatting
+
+ src/xsub.cpp | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+commit 6b45262086133cc9f9e130de0c656543d063078a
+Merge: bb59dc1 500f6cf
Author: Pieter Hintjens <ph@imatix.com>
-Date: Fri Oct 26 17:45:30 2012 -0700
+Date: Sat Oct 27 14:01:48 2012 -0700
+
+ Merge pull request #448 from jgm-radez/master
+
+ resolve issue 456
+
+commit 500f6cffe36504a70980a1ac4904fe4e9c3b727c
+Author: John Muehlhausen <jgm@jgm.org>
+Date: Sat Oct 27 15:51:03 2012 -0500
+
+ patch for issue 456
+
+ Do not filter out duplicate subscriptions on the XSUB side of
+ XSUB/XPUB, so that ZMQ_XPUB_VERBOSE doesn't get blocked by forwarding
+ devices (as long as the devices all use ZMQ_XPUB_VERBOSE)
+
+ src/xsub.cpp | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
- Merge pull request #49 from hintjens/master
+commit bb59dc1b2a426a4f9be9a84ace774e8372dbc43a
+Merge: 0b13872 171897f
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Fri Oct 26 19:50:32 2012 -0700
+
+ Merge pull request #447 from hintjens/master
- Backported fixes for LIBZMQ-452 and LIBZMQ-415
+ Cleanups to man pages
-commit 09c56c44932eaf309bcd74f2400bc2b204d9bcec
+commit 171897f4e8550e9f339e5e3607335c5e8d6b9d1f
Author: Pieter Hintjens <ph@imatix.com>
-Date: Sat Oct 27 09:45:01 2012 +0900
+Date: Sat Oct 27 09:43:19 2012 +0900
Cleanups to man pages
doc/zmq_tcp.txt | 111 ++++++++++++---------------------------------------
7 files changed, 158 insertions(+), 210 deletions(-)
-commit d9d7d9be545635b929d6803b94e70a8caf564dd5
+commit 0b13872ff4483c72e586abbd93e500f35d0f7440
+Merge: 01be614 ef79492
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Oct 25 02:21:31 2012 -0700
+
+ Merge pull request #446 from hurtonm/issue_452
+
+ Resolve LIBZMQ-452
+
+commit 01be614593e4cc44403c6274cd9e307b0ba3ce49
+Merge: d2ee38a 4824237
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Thu Oct 25 02:15:46 2012 -0700
+
+ Merge pull request #445 from hurtonm/issue_417
+
+ Resolve LIBZMQ-417
+
+commit ef794925b437c643a3a0d5681eb22e008975ebe2
Author: Martin Hurton <hurtonm@gmail.com>
Date: Wed Oct 24 23:46:58 2012 +0200
tests/test_connect_delay.cpp | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
-commit d95f8c5f5575dd88b475fda2ad94fa7fb783d923
+commit 4824237761c79a8e21b350fd32b1ef177996e331
Author: Martin Hurton <hurtonm@gmail.com>
Date: Wed Oct 24 22:05:45 2012 +0200
src/session_base.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-commit ceb388e3715df5c8ae0c1081af78780d9099e0a0
-Merge: c391966 888c1bd
+commit d2ee38acfe732ac1216699da51609fdb4d24fc97
+Merge: 2675a9d 422c418
Author: Pieter Hintjens <ph@imatix.com>
-Date: Tue Oct 23 17:01:36 2012 -0700
+Date: Wed Oct 24 06:50:02 2012 -0700
- Merge pull request #48 from vortechs2000/fix_aix
+ Merge pull request #444 from vortechs2000/fix_aix
Fix Build Regression #449: Move socket_base.hpp and err.hpp after poll.h include
-commit 888c1bdb5b1f87184bee882d42a42a75f140a410
+commit 422c418a15b69001f679e6b51f1cfffbd2ded625
Author: AJ Lewis <aj.lewis@quantum.com>
Date: Tue Oct 23 16:18:36 2012 -0500
src/proxy.cpp | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
-commit a5da31eb0766cac578941f37cc7a94f5b7bcebcf
-Author: Steven McCoy <steven.mccoy@miru.hk>
-Date: Sat Oct 20 14:56:00 2012 -0400
-
- Update NSIS x64 install to use different registry keys to x86.
-
- cmake/NSIS.template64.in | 20 ++++++++++----------
- 1 file changed, 10 insertions(+), 10 deletions(-)
-
-commit bbff2fc3f82eee90767d5aba52d4212cd8e283ff
-Author: Steven McCoy <steven.mccoy@miru.hk>
-Date: Sat Oct 20 14:49:27 2012 -0400
-
- Expand Windows PGM build integration to support multiple CRTs and use registered versions.
- Add libpgm to linker as now removed upstream.
- Add version details to ZeroMQ library names.
- Add multi-CRT dependencies to packaging.
- Add x64 postfix to Win64 packages to avoid conflict with x86 installs.
+commit 2675a9d31b9fb74c671c25ba7769831c11a2fa70
+Merge: 7abb6cc 4ba34c9
+Author: Ian Barber <ian.barber@gmail.com>
+Date: Tue Oct 23 18:02:48 2012 -0700
- CMakeLists.txt | 96 +++++++++++++++++++++++++++++++++++---------------------
- 1 file changed, 60 insertions(+), 36 deletions(-)
+ Merge pull request #443 from hintjens/master
+
+ Fixed whitespace and style
-commit c391966fbbb9021df49c9e1794e65272abbd4226
-Merge: 30e2da0 24ea41c
+commit 4ba34c9d70986f17429a06c0171005ad05b66ef3
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Wed Oct 24 09:18:52 2012 +0900
+
+ Whitespace and style fixes
+
+ src/address.cpp | 12 +--
+ src/ipc_connecter.cpp | 3 +-
+ src/mtrie.cpp | 23 +++--
+ src/pgm_sender.cpp | 14 +--
+ src/pgm_socket.cpp | 9 +-
+ src/pipe.cpp | 41 +++++----
+ src/poller_base.cpp | 3 +-
+ src/router.cpp | 3 +-
+ src/session_base.cpp | 3 +-
+ src/signaler.cpp | 3 +-
+ src/socket_base.cpp | 148 ++++++++++++++++--------------
+ src/sub.cpp | 3 +-
+ src/tcp_connecter.cpp | 3 +-
+ src/trie.cpp | 239 +++++++++++++++++++++++++------------------------
+ src/zmq.cpp | 22 ++---
+ 15 files changed, 282 insertions(+), 247 deletions(-)
+
+commit 7abb6ccb6aa1d95d6e47d079d792fbd5faef5e29
+Merge: 7f63fc6 0666063
Author: Ian Barber <ian.barber@gmail.com>
-Date: Fri Oct 19 15:05:41 2012 -0700
+Date: Fri Oct 19 15:05:23 2012 -0700
- Merge pull request #46 from hintjens/master
+ Merge pull request #442 from hintjens/master
Fixed build regression #449
-commit 24ea41ce7a4efcee2c259ff6190dbb9dd57379a9
+commit 066606322c131f73f5fa9a6e673fd0df6771e540
Author: Pieter Hintjens <ph@imatix.com>
-Date: Fri Oct 19 16:23:59 2012 +0900
+Date: Fri Oct 19 16:23:21 2012 +0900
Added unbind/disconnect man pages, notes to deprecated methods
doc/zmq_sendmsg.txt | 1 +
3 files changed, 13 insertions(+), 7 deletions(-)
-commit d0eed09f6fb378efcec9753510386d58ac0d1c72
+commit ee21fac8b8a276b084547ac5dc8e0df4b13ae88b
Author: Pieter Hintjens <ph@imatix.com>
-Date: Fri Oct 19 15:16:15 2012 +0900
+Date: Fri Oct 19 15:16:36 2012 +0900
Added ZMQ_FAIL_UNROUTABLE alias back as deprecated
include/zmq.h | 1 +
1 file changed, 1 insertion(+)
-commit 5e4f858c8e6ccaf28a06365baf6760c9a07abd4a
+commit a3889d00c346bccb47b67ebf4bf3839b00b0821f
Author: Pieter Hintjens <ph@imatix.com>
-Date: Fri Oct 19 15:10:34 2012 +0900
+Date: Fri Oct 19 15:09:52 2012 +0900
Fixed issue #451
src/router.cpp | 2 +-
2 files changed, 3 insertions(+), 6 deletions(-)
-commit bdbdf8bb7edbbc8cf29f3b034e55272668a39ae2
+commit 45c063725bbf577b7f577f7f3b4a01077bacc15a
Author: Pieter Hintjens <ph@imatix.com>
-Date: Thu Oct 18 11:34:16 2012 +0900
+Date: Thu Oct 18 11:32:13 2012 +0900
Fixed issue #449
src/proxy.cpp | 28 +++++++++++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)
-commit 30e2da05a10d7307e158313c2cf45542c9d2fef2
-Merge: da7427b 2fe4a35
+commit 7f63fc6579dc335553d4e8f8ece9d7a30909e67c
+Merge: 9bab346 9681157
Author: Ian Barber <ian.barber@gmail.com>
-Date: Wed Oct 17 19:21:38 2012 -0700
+Date: Wed Oct 17 19:21:26 2012 -0700
- Merge pull request #45 from hintjens/master
+ Merge pull request #441 from hintjens/master
Fixed build regression
-commit 2fe4a355fd3fdae3881e898f22ec1c8d31cdf10b
+commit 96811575c303e92d4926d841240192aaf6f2e41c
Author: Pieter Hintjens <ph@imatix.com>
-Date: Thu Oct 18 11:10:21 2012 +0900
+Date: Thu Oct 18 11:04:51 2012 +0900
Fixed issue #448
src/socket_base.hpp | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
-commit da7427b771f2032664de23cfb4901907deeea708
-Merge: 05bd3ea e18b69b
+commit 9bab3466904884f41be56cb5474859be16a0dad3
+Merge: 6e676af 3a43bd7
Author: Ian Barber <ian.barber@gmail.com>
-Date: Mon Oct 15 23:32:25 2012 -0700
+Date: Mon Oct 15 23:32:16 2012 -0700
- Merge pull request #44 from hintjens/master
+ Merge pull request #440 from hintjens/master
Packages did not build - fixed
-commit e18b69bfa1e710078435cee730e374d622befaa0
+commit 3a43bd735426543334902dbd0569a45dbb493e50
Author: Pieter Hintjens <ph@imatix.com>
-Date: Tue Oct 16 10:00:43 2012 +0900
+Date: Tue Oct 16 10:01:26 2012 +0900
Several include files were missing
src/Makefile.am | 9 +++++++++
1 file changed, 9 insertions(+)
-commit 05bd3ea8b90a0e6ec38ca3d236a78908b0b90333
-Merge: a7b2e9d 7735322
+commit 6e676af45edfb0c17607625531befed0098b850f
+Merge: cdcaca2 351eff5
Author: Ian Barber <ian.barber@gmail.com>
-Date: Mon Oct 15 09:46:59 2012 -0700
+Date: Mon Oct 15 04:33:24 2012 -0700
- Merge pull request #43 from hintjens/master
+ Merge pull request #439 from hintjens/master
- Updated zeromq3-x version to 3.2.2 for next release
+ Updated master version to 3.2.2
+
+commit 351eff5448eba050dc7c9d53d07b2b057399ab7d
+Author: Pieter Hintjens <ph@imatix.com>
+Date: Mon Oct 15 13:23:00 2012 +0900
+
+ Bumped version to 3.3.0
+
+ include/zmq.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
-commit 773532215148bdee4dbc68d9c54c06c929811869
+commit 8e7892b72fc4dfcf8fdb462d1f21afa55153656a
Author: Pieter Hintjens <ph@imatix.com>
-Date: Mon Oct 15 13:07:52 2012 +0900
+Date: Mon Oct 15 13:06:19 2012 +0900
- Updated version for next release
+ Upated version for next release
include/zmq.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
ACLOCAL_AMFLAGS = -I config
if BUILD_PGM
-SUBDIRS = foreign/openpgm src doc perf tests
+SUBDIRS = foreign/openpgm src doc perf tests tools
else
-SUBDIRS = src doc perf tests
+SUBDIRS = src doc perf tests tools
endif
-DIST_SUBDIRS = foreign/openpgm src doc perf tests builds/msvc
+DIST_SUBDIRS = foreign/openpgm src doc perf tests tools builds/msvc
EXTRA_DIST = \
autogen.sh \
build_triplet = @build@
host_triplet = @host@
subdir = .
-DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
+DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in \
$(top_srcdir)/builds/redhat/zeromq.spec.in \
$(top_srcdir)/configure AUTHORS COPYING COPYING.LESSER INSTALL \
$(top_srcdir)/config/ltsugar.m4 \
$(top_srcdir)/config/ltversion.m4 \
$(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
ACLOCAL_AMFLAGS = -I config
-@BUILD_PGM_FALSE@SUBDIRS = src doc perf tests
-@BUILD_PGM_TRUE@SUBDIRS = foreign/openpgm src doc perf tests
-DIST_SUBDIRS = foreign/openpgm src doc perf tests builds/msvc
+@BUILD_PGM_FALSE@SUBDIRS = src doc perf tests tools
+@BUILD_PGM_TRUE@SUBDIRS = foreign/openpgm src doc perf tests tools
+DIST_SUBDIRS = foreign/openpgm src doc perf tests tools builds/msvc
EXTRA_DIST = \
autogen.sh \
version.sh \
+0MQ version 4.0.4 stable, released on 2014/03/10
+================================================
+
+Bug Fixes
+---------
+
+* Fixed #909; out of tree build issue on Linux.
+
+* Fixed #888; hangs on terminate when inproc connected but never bound.
+
+* Fixed #868; assertion failure at ip.cpp:137 when using port scanner.
+
+* Fixed #818; fix timestamp counter on s390/s390x.
+
+* Fixed #817; only export zmq_* symbols.
+
+* Fixed #797; fixed setting TCP keepalive on Windows.
+
+* Fixed #775; compile error on Windows.
+
+* Fixed #763; when talking to a ZMTP v1 peer (libzmq 2.2), a socket would
+ send an extra identity frame at the start of the connection.
+
+* Fixed LIBZMQ-576 - Crash closing a socket after zmq_msg_send returns
+ EAGAIN (reverts LIBZMQ-497)
+
+* Fixed LIBZMQ-584; subscription filters getting lost on reconnection.
+
+
+0MQ version 4.0.3 stable, released on 2013/11/24
+================================================
+
+Bug Fixes
+---------
+
+* Fixed test_many_sockets case, which failed when process socket limit
+ was 1024.
+
+
+0MQ version 4.0.2 stable, released on 2013/11/24
+================================================
+
+Bug Fixes
+---------
+
+* Fixed LIBZMQ-583 - improved low-res timer for Windows
+* Fixed LIBZMQ-578 - z85_decode was extremely slow
+* Fixed LIBZMQ-577 - fault in man pages.
+* Fixed LIBZMQ-574 - assertion failure when ran out of system file handles
+* Fixed LIBZMQ-571 - test_stream failing in some cases
+* Fixed LIBZMQ-569 - Socket server crashes with random client data and when
+ talking to 2.2 versions
+* Fixed LIBZMQ-39 - Bad file descriptor during shutdown
+* Pulled expected failing test_linger.cpp from release
+* Reduced pause time in tests to allow "make check" to run faster
+
+
+0MQ version 4.0.1 stable, released on 2013/10/08
+================================================
+
+Changes
+-------
+
+* Updated CURVE mechanism to track revised RFC 27 (INITIATE vouch).
+
+ The INITIATE command vouch box is Box[C',S](C->S') instead of
+ Box[C'](C->S), to reduce the risk of client impersonation, as per
+ https://codesinchaos.wordpress.com/2012/09/09/curvecp-1/.
+
+* Fixed LIBZMQ-567, adding abstract namespaces for IPC sockets on Linux.
+
+ Converts an initial strudel or "at sign" (@) in the Unix socket path to
+ a NULL character ('\0') indicating that the socket uses the abstract
+ namespace instead of the filesystem namespace. For instance, binding a
+ socket to 'ipc://@/tmp/tester' will not create a file associated with
+ the socket whereas binding to 'ipc:///tmp/tester' will create the file
+ /tmp/tester. See issue 567 for more information.
+
+* Added zmq_z85_encode and zmq_z85_decode to core libzmq API.
+
+* Added zmq_curve_keypair to core libzmq API.
+
+* Bumped library ABI version to 4:0:1.
+
+Bug fixes
+---------
+
+* Fixed some build/test errors on OS/X + Clang++.
+
+* Fixed LIBZMQ-565, typo in code.
+
+* Fixed LIBZMQ-566, dealer-to-router connections sometimes failing.
+
+* Fixed builds for AIX, MSVC 2008, OS/X with clang++, Solaris.
+
+* Improved CURVE handshake error handling.
+
+
+0MQ version 4.0.0 (RC1), released on 2013/09/20
+===============================================
+
+Major changes
+-------------
+
+* New wire level protocol, ZMTP/3.0, see http://rfc.zeromq.org/spec:23.
+ Does not yet implement the SUBSCRIBE, CANCEL, PING, and PONG commands.
+
+* New security framework, from plain user+password to strong encryption,
+ see section below. See http://hintjens.com/blog:49 for a tutorial.
+
+* New ZMQ_STREAM socket type for working as a TCP client or server. See:
+ tests/test_stream.cpp.
+
+Improvements
+------------
+
+* You can now connect to an inproc:// endpoint that does not already
+ exist. This means inproc:// no longer needs careful set-up, but it may
+ break code that relied on the old behaviour. See:
+ tests/test_inproc_connect.cpp.
+
+* Libzmq now checks socket types at connection time, so that trying to
+ connect a 'wrong' socket type will fail.
+
+* New zmq_ctx_shutdown API method will shutdown a context and send ETERM
+ to blocking calls, without blocking. Use zmq_ctx_term to finalise the
+ process.
+
+* The regression test suite has been significantly extended and improved.
+
+* Contexts can now be terminated in forked child processes. See:
+ tests/test_fork.cpp.
+
+* zmq_disconnect now respects the linger setting on sockets.
+
+* New zmq_send_const API method to send constant data (without copying).
+ See: tests/test_inproc_connect.cpp.
+
+* Added CMake support for static libraries.
+
+* Added test cases for socket semantics as defined in RFCs 28, 29, 30, 31.
+ See: tests/test_spec_*.cpp.
+
+* New socket option, ZMQ_PROBE_ROUTER triggers an empty message on connect.
+ See: tests/test_probe_router.cpp.
+
+* New socket option, ZMQ_REQ_CORRELATE allows for correlation of replies
+ from a REP socket. See: tests/test_req_correlate.cpp.
+
+* New socket option, ZMQ_REQ_RELAXED, lets you disable the state machine
+ on a REQ socket, so you can send multiple requests without waiting for
+ replies, and without getting an EFSM error. See:
+ tests/test_req_relaxed.cpp.
+
+* New socket option, ZMQ_CONFLATE restricts the outgoing and incoming
+ socket buffers to a single message. See: tests/test_conflate.cpp.
+
+Deprecated Options
+------------------
+
+* ZMQ_IPV4ONLY deprecated and renamed to ZMQ_IPV6 so that options are
+ consistently "off" by default.
+
+* ZMQ_DELAY_ATTACH_ON_CONNECT deprecated, and renamed to ZMQ_IMMEDIATE.
+ See: tests/test_immediate.cpp.
+
+Security Framework
+------------------
+
+Based on new ZMTP wire level protocol that negotiates a security
+"mechanism" between client and server before exchanging any other data.
+
+Security mechanisms are extensible. ZMTP defines three by default:
+
+* NULL - classic ZeroMQ, with no authentication. See
+ http://rfc.zeromq.org/spec:23.
+
+* PLAIN - plain-text username + password authentication. See
+ http://rfc.zeromq.org/spec:24.
+
+* CURVE - secure authentication and encryption based on elliptic curve
+ cryptography, using the Curve25519 algorithm from Daniel Bernstein and
+ based on CurveCP's security handshake. See http://rfc.zeromq.org/spec:25,
+ http://rfc.zeromq.org/spec:26, and http://curvecp.org.
+
+Authentication is done by pluggable "authenticators" that connect to libzmq
+over an inproc endpoint, see http://rfc.zeromq.org/spec:27.
+
+Socket options to configure PLAIN security on client or server:
+
+* ZMQ_PLAIN_SERVER, ZMQ_PLAIN_USERNAME, ZMQ_PLAIN_PASSWORD. See
+ tests/test_security_plain.
+
+Socket options to configure CURVE security on client or server:
+
+* ZMQ_CURVE_SERVER, ZMQ_CURVE_PUBLICKEY, ZMQ_CURVE_SECRETKEY,
+ ZMQ_CURVE_SERVERKEY. See tests/test_security_curve.cpp.
+
+Socket options to configure "domain" for ZAP handler:
+
+* ZMQ_ZAP_DOMAIN, see tests/test_security_null.cpp.
+
+Support for encoding/decoding CURVE binary keys to ASCII:
+
+* zmq_z85_encode, zmq_z85_decode.
+
+Other issues addressed in this release
+--------------------------------------
+
+* LIBZMQ-525 Multipart upstreaming from XSUB to XPUB
+
+
+0MQ version 3.2.4 stable, released on 2013/09/20
+================================================
+
+* LIBZMQ-84 (Windows) Assertion failed: Address already in use at signaler.cpp:80
+* LIBZMQ-456 ZMQ_XPUB_VERBOSE does not propagate in a tree of XPUB/XSUB devices
+* LIBZMQ-532 (Windows) critical section not released on error
+* LIBZMQ-569 Detect OpenPGM 5.2 system library
+* LIBZMQ-563 Subscribers sometimes stopped receiving messages (aka LIBZMQ-541)
+* LIBZMQ-XXX Added support for Travis Continuous Integration
+* LIBZMQ-XXX Several improvements to MSVC support
+
+
+0MQ version 3.2.3 stable, released on 2013/05/02
+================================================
+
+Issues addressed in this release
+--------------------------------
+
+* LIBZMQ-526 Assertion failure "Invalid argument (tcp_connecter.cpp:285)"
+* LIBZMQ-446 Setting the DSCP bits by default causes CAP_NET_ADMIN error
+* LIBZMQ-496 Crash on heavy socket opening/closing: Device or resource busy (mutex.hpp:90)
+* LIBZMQ-462 test_connect_delay fails at test_connect_delay.cpp:80
+* LIBZMQ-497 Messages getting dropped
+* LIBZMQ-488 signaler.cpp leaks the win32 Event Handle
+* LIBZMQ-476 zmq_disconnect has no effect for inproc sockets
+* LIBZMQ-475 zmq_disconnect does not sent unsubscribe messages
+
+
0MQ version 3.2.2 stable, released on 2012/11/23
================================================
* LIBZMQ-450 lt-test_monitor: fails with assertion at test_monitor.cpp:81
* LIBZMQ-451 ZMQ_ROUTER_MANDATORY blocks forever
* LIBZMQ-452 test_connect_delay.cpp:175:12: error: 'sleep' was not declared in this scope
-* LIBZMQ-456 ZMQ_XPUB_VERBOSE does not propagate in a tree of XPUB/XSUB devices
* LIBZMQ-458 lt-test_router_mandatory fails with assertion at test_router_mandatory.cpp:53
* LIBZMQ-459 Assertion failed: encoder (stream_engine.cpp:266
* LIBZMQ-464 PUB socket with HWM set leaks memory
* LIBZMQ-468 ZMQ_XPUB_VERBOSE & unsubscribe
* LIBZMQ-472 Segfault in zmq_poll in REQ to ROUTER dialog
+
0MQ version 3.2.1 (RC2), released on 2012/10/15
===============================================
+++ /dev/null
-Welcome
--------
-
-The 0MQ lightweight messaging kernel is a library which extends the
-standard socket interfaces with features traditionally provided by
-specialised messaging middleware products. 0MQ sockets provide an
-abstraction of asynchronous message queues, multiple messaging patterns,
-message filtering (subscriptions), seamless access to multiple transport
-protocols and more.
-
-
-Building and installation
--------------------------
-
-See the INSTALL file included with the distribution.
-
-
-Resources
----------
-
-Extensive documentation is provided with the distribution. Refer to
-doc/zmq.html, or "man zmq" after you have installed 0MQ on your system.
-
-Website: http://www.zeromq.org/
-
-Development mailing list: zeromq-dev@lists.zeromq.org
-Announcements mailing list: zeromq-announce@lists.zeromq.org
-
-Git repository: http://github.com/zeromq/libzmq
-
-0MQ developers can also be found on the IRC channel #zeromq, on the
-Freenode network (irc.freenode.net).
-
-Copying
--------
-
-Free use of this software is granted under the terms of the GNU Lesser General
-Public License (LGPL). For details see the files `COPYING` and `COPYING.LESSER`
-included with the 0MQ distribution.
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
])
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 8
-
-# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
-AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
-
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
LIBZMQ_DIST = libzmq/libzmq.vcproj libzmq/libzmq.vcxproj \
libzmq/libzmq.vcxproj.filters \
- platform.hpp msvc.sln msvc10.sln
+ platform.hpp msvc.sln msvc10.sln \
+ errno.cpp errno.hpp
PERF_DIST = c_local_thr/c_local_thr.vcproj \
c_local_thr/c_local_thr.vcxproj \
properties/Executable.props \
properties/Precompiled.props \
properties/Release.props \
+ properties/Static.props \
properties/Win32.props \
properties/Win32_Release.props \
properties/WithOpenPGM.props \
properties/x64.props \
- properties/ZeroMQ.props
+ properties/ZeroMQ.props \
+ properties/ZeroMQ_Static.props
PRECOMPILED_DIST = ../../src/precompiled.hpp \
../../src/precompiled.cpp
$(top_srcdir)/config/ltsugar.m4 \
$(top_srcdir)/config/ltversion.m4 \
$(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
top_srcdir = @top_srcdir@
LIBZMQ_DIST = libzmq/libzmq.vcproj libzmq/libzmq.vcxproj \
libzmq/libzmq.vcxproj.filters \
- platform.hpp msvc.sln msvc10.sln
+ platform.hpp msvc.sln msvc10.sln \
+ errno.cpp errno.hpp
PERF_DIST = c_local_thr/c_local_thr.vcproj \
c_local_thr/c_local_thr.vcxproj \
properties/Executable.props \
properties/Precompiled.props \
properties/Release.props \
+ properties/Static.props \
properties/Win32.props \
properties/Win32_Release.props \
properties/WithOpenPGM.props \
properties/x64.props \
- properties/ZeroMQ.props
+ properties/ZeroMQ.props \
+ properties/ZeroMQ_Static.props
PRECOMPILED_DIST = ../../src/precompiled.hpp \
../../src/precompiled.cpp
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
>
<Tool
Name="VCPreBuildEventTool"
+ CommandLine="copy ..\platform.hpp ..\..\..\perf"
/>
<Tool
Name="VCCustomBuildTool"
>
<Tool
Name="VCPreBuildEventTool"
+ CommandLine="copy ..\platform.hpp ..\..\..\perf"
/>
<Tool
Name="VCCustomBuildTool"
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <PreBuildEvent>
+ <Command>copy ..\platform.hpp ..\..\..\perf</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <PreBuildEvent>
+ <Command>copy ..\platform.hpp ..\..\..\perf</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <PreBuildEvent>
+ <Command>copy ..\platform.hpp ..\..\..\perf</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <PreBuildEvent>
+ <Command>copy ..\platform.hpp ..\..\..\perf</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\perf\local_thr.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
>
<Tool
Name="VCPreBuildEventTool"
+ CommandLine="copy ..\platform.hpp ..\..\..\perf"
/>
<Tool
Name="VCCustomBuildTool"
>
<Tool
Name="VCPreBuildEventTool"
+ CommandLine="copy ..\platform.hpp ..\..\..\perf"
/>
<Tool
Name="VCCustomBuildTool"
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <PreBuildEvent>
+ <Command>copy ..\platform.hpp ..\..\..\perf</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <PreBuildEvent>
+ <Command>copy ..\platform.hpp ..\..\..\perf</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <PreBuildEvent>
+ <Command>copy ..\platform.hpp ..\..\..\perf</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <PreBuildEvent>
+ <Command>copy ..\platform.hpp ..\..\..\perf</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\perf\remote_thr.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
--- /dev/null
+#if defined _WIN32_WCE\r
+\r
+//#include "..\..\include\zmq.h"\r
+#include "..\..\src\err.hpp"\r
+\r
+int errno;\r
+int _doserrno;\r
+int _sys_nerr;\r
+\r
+char* error_desc_buff = NULL;\r
+\r
+char* strerror(int errno)\r
+{\r
+ if (NULL != error_desc_buff)\r
+ {\r
+ LocalFree(error_desc_buff);\r
+ error_desc_buff = NULL;\r
+ }\r
+\r
+ FormatMessage(\r
+ FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_ALLOCATE_BUFFER,\r
+ NULL,\r
+ errno,\r
+ 0,\r
+ (LPTSTR)&error_desc_buff,\r
+ 1024,\r
+ NULL\r
+ );\r
+ return error_desc_buff;\r
+}\r
+\r
+#endif
\ No newline at end of file
--- /dev/null
+#ifndef ERRNO_H\r
+#define ERRNO_H 1\r
+\r
+//#define EPERM 1\r
+//#define ENOENT 2\r
+//#define ESRCH 3\r
+#define EINTR 4\r
+//#define EIO 5\r
+//#define ENXIO 6\r
+//#define E2BIG 7\r
+//#define ENOEXEC 8\r
+#define EBADF 9\r
+//#define ECHILD 10\r
+#define EAGAIN 11\r
+//#define ENOMEM 12\r
+#define EACCES 13\r
+#define EFAULT 14\r
+//#define EOSERR 15 // rk\r
+//#define EBUSY 16\r
+//#define EEXIST 17\r
+//#define EXDEV 18\r
+//#define ENODEV 19\r
+//#define ENOTDIR 20\r
+//#define EISDIR 21\r
+#define EINVAL 22\r
+//#define ENFILE 23\r
+#define EMFILE 24\r
+//#define ENOTTY 25\r
+//#define EFBIG 27\r
+//#define ENOSPC 28\r
+//#define ESPIPE 29\r
+//#define EROFS 30\r
+//#define EMLINK 31\r
+//#define EPIPE 32\r
+//#define EDOM 33\r
+//#define ERANGE 34\r
+//#define EDEADLK 36\r
+//#define ENOSYS 37\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+extern int errno;\r
+extern int _doserrno;\r
+extern int _sys_nerr;\r
+\r
+char* strerror(int errno);\r
+\r
+#define sys_nerr _sys_nerr\r
+\r
+#ifdef __cplusplus\r
+};\r
+#endif\r
+\r
+#endif
\ No newline at end of file
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9.00"
- Name="inproc_lat"
- ProjectGUID="{6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}"
- RootNamespace="inproc_lat"
- TargetFrameworkVersion="196613"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- WarningLevel="3"
- DebugInformationFormat="4"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="../../../bin/inproc_lat.exe"
- GenerateDebugInformation="true"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="2"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- EnableIntrinsicFunctions="true"
- RuntimeLibrary="2"
- EnableFunctionLevelLinking="true"
- WarningLevel="3"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="../../../bin/inproc_lat.exe"
- GenerateDebugInformation="true"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\..\perf\inproc_lat.cpp"
- >
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+ ProjectType="Visual C++"\r
+ Version="9,00"\r
+ Name="inproc_lat"\r
+ ProjectGUID="{6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}"\r
+ RootNamespace="inproc_lat"\r
+ TargetFrameworkVersion="196613"\r
+ >\r
+ <Platforms>\r
+ <Platform\r
+ Name="Win32"\r
+ />\r
+ </Platforms>\r
+ <ToolFiles>\r
+ </ToolFiles>\r
+ <Configurations>\r
+ <Configuration\r
+ Name="Debug|Win32"\r
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+ IntermediateDirectory="$(ConfigurationName)"\r
+ ConfigurationType="1"\r
+ CharacterSet="2"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ CommandLine="copy ..\platform.hpp ..\..\..\perf"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ Optimization="0"\r
+ MinimalRebuild="true"\r
+ BasicRuntimeChecks="3"\r
+ RuntimeLibrary="3"\r
+ WarningLevel="3"\r
+ DebugInformationFormat="4"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ OutputFile="../../../bin/inproc_lat.exe"\r
+ GenerateDebugInformation="true"\r
+ TargetMachine="1"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="Release|Win32"\r
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+ IntermediateDirectory="$(ConfigurationName)"\r
+ ConfigurationType="1"\r
+ CharacterSet="2"\r
+ WholeProgramOptimization="1"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ CommandLine="copy ..\platform.hpp ..\..\..\perf"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ Optimization="2"\r
+ EnableIntrinsicFunctions="true"\r
+ RuntimeLibrary="2"\r
+ EnableFunctionLevelLinking="true"\r
+ WarningLevel="3"\r
+ DebugInformationFormat="3"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ OutputFile="../../../bin/inproc_lat.exe"\r
+ GenerateDebugInformation="true"\r
+ OptimizeReferences="2"\r
+ EnableCOMDATFolding="2"\r
+ TargetMachine="1"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ </Configurations>\r
+ <References>\r
+ </References>\r
+ <Files>\r
+ <Filter\r
+ Name="Source Files"\r
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+ >\r
+ <File\r
+ RelativePath="..\..\..\perf\inproc_lat.cpp"\r
+ >\r
+ </File>\r
+ </Filter>\r
+ </Files>\r
+ <Globals>\r
+ </Globals>\r
+</VisualStudioProject>\r
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <PreBuildEvent>
+ <Command>copy ..\platform.hpp ..\..\..\perf</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <PreBuildEvent>
+ <Command>copy ..\platform.hpp ..\..\..\perf</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <PreBuildEvent>
+ <Command>copy ..\platform.hpp ..\..\..\perf</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <PreBuildEvent>
+ <Command>copy ..\platform.hpp ..\..\..\perf</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\perf\inproc_lat.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9.00"
- Name="inproc_thr"
- ProjectGUID="{1077E977-95DD-4E73-A692-74647DD0CC1E}"
- RootNamespace="inproc_thr"
- TargetFrameworkVersion="196613"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- WarningLevel="3"
- DebugInformationFormat="4"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="../../../bin/inproc_thr.exe"
- GenerateDebugInformation="true"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="2"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- EnableIntrinsicFunctions="true"
- RuntimeLibrary="2"
- EnableFunctionLevelLinking="true"
- WarningLevel="3"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="../../../bin/inproc_thr.exe"
- GenerateDebugInformation="true"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\..\perf\inproc_thr.cpp"
- >
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+ ProjectType="Visual C++"\r
+ Version="9,00"\r
+ Name="inproc_thr"\r
+ ProjectGUID="{1077E977-95DD-4E73-A692-74647DD0CC1E}"\r
+ RootNamespace="inproc_thr"\r
+ TargetFrameworkVersion="196613"\r
+ >\r
+ <Platforms>\r
+ <Platform\r
+ Name="Win32"\r
+ />\r
+ </Platforms>\r
+ <ToolFiles>\r
+ </ToolFiles>\r
+ <Configurations>\r
+ <Configuration\r
+ Name="Debug|Win32"\r
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+ IntermediateDirectory="$(ConfigurationName)"\r
+ ConfigurationType="1"\r
+ CharacterSet="2"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ CommandLine="copy ..\platform.hpp ..\..\..\perf"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ Optimization="0"\r
+ MinimalRebuild="true"\r
+ BasicRuntimeChecks="3"\r
+ RuntimeLibrary="3"\r
+ WarningLevel="3"\r
+ DebugInformationFormat="4"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ OutputFile="../../../bin/inproc_thr.exe"\r
+ GenerateDebugInformation="true"\r
+ TargetMachine="1"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="Release|Win32"\r
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+ IntermediateDirectory="$(ConfigurationName)"\r
+ ConfigurationType="1"\r
+ CharacterSet="2"\r
+ WholeProgramOptimization="1"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ CommandLine="copy ..\platform.hpp ..\..\..\perf"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ Optimization="2"\r
+ EnableIntrinsicFunctions="true"\r
+ RuntimeLibrary="2"\r
+ EnableFunctionLevelLinking="true"\r
+ WarningLevel="3"\r
+ DebugInformationFormat="3"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ OutputFile="../../../bin/inproc_thr.exe"\r
+ GenerateDebugInformation="true"\r
+ OptimizeReferences="2"\r
+ EnableCOMDATFolding="2"\r
+ TargetMachine="1"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ </Configurations>\r
+ <References>\r
+ </References>\r
+ <Files>\r
+ <Filter\r
+ Name="Source Files"\r
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+ >\r
+ <File\r
+ RelativePath="..\..\..\perf\inproc_thr.cpp"\r
+ >\r
+ </File>\r
+ </Filter>\r
+ </Files>\r
+ <Globals>\r
+ </Globals>\r
+</VisualStudioProject>\r
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <PreBuildEvent>
+ <Command>copy ..\platform.hpp ..\..\..\perf</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <PreBuildEvent>
+ <Command>copy ..\platform.hpp ..\..\..\perf</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <PreBuildEvent>
+ <Command>copy ..\platform.hpp ..\..\..\perf</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <PreBuildEvent>
+ <Command>copy ..\platform.hpp ..\..\..\perf</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\perf\inproc_thr.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
-<?xml version="1.0" encoding="windows-1250"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9.00"
- Name="libzmq"
- ProjectGUID="{641C5F36-32EE-4323-B740-992B651CF9D6}"
- RootNamespace="libzmq"
- TargetFrameworkVersion="196613"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="2"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- CommandLine="copy ..\platform.hpp ..\..\..\src"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions="-DDLL_EXPORT -DFD_SETSIZE=1024 -D_CRT_SECURE_NO_WARNINGS"
- Optimization="0"
- PreprocessorDefinitions="NOMINMAX"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- WarningLevel="3"
- DebugInformationFormat="4"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="Ws2_32.lib Rpcrt4.lib"
- OutputFile="../../../lib/libzmq.dll"
- GenerateDebugInformation="true"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="2"
- CharacterSet="2"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- CommandLine="copy ..\platform.hpp ..\..\..\src"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions="-DDLL_EXPORT -DFD_SETSIZE=1024 -D_CRT_SECURE_NO_WARNINGS"
- Optimization="2"
- EnableIntrinsicFunctions="true"
- RuntimeLibrary="2"
- EnableFunctionLevelLinking="true"
- WarningLevel="3"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="Ws2_32.lib Rpcrt4.lib"
- OutputFile="../../../lib/libzmq.dll"
- GenerateDebugInformation="true"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="WithOpenPGM|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="2"
- CharacterSet="2"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- CommandLine="copy ..\platform.hpp ..\..\..\src"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions="-DDLL_EXPORT -DFD_SETSIZE=1024 -D_CRT_SECURE_NO_WARNINGS"
- Optimization="2"
- EnableIntrinsicFunctions="true"
- AdditionalIncludeDirectories="../../../../OpenPGM/include"
- PreprocessorDefinitions="ZMQ_HAVE_OPENPGM"
- RuntimeLibrary="2"
- EnableFunctionLevelLinking="true"
- WarningLevel="3"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="Ws2_32.lib Rpcrt4.lib libpgm.lib"
- OutputFile="../../../lib/libzmq.dll"
- AdditionalLibraryDirectories="../../../../OpenPGM/lib"
- GenerateDebugInformation="true"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\..\src\address.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\clock.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\ctx.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\dealer.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\decoder.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\devpoll.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\dist.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\encoder.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\epoll.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\err.cpp"
- >
- </File>
- <File
- RelativePath="..\errno.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\fq.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\io_object.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\io_thread.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\ip.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\ipc_address.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\ipc_connecter.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\ipc_listener.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\kqueue.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\lb.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\mailbox.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\msg.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\mtrie.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\object.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\options.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\own.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\pair.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\pgm_receiver.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\pgm_sender.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\pgm_socket.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\pipe.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\poll.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\poller_base.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\proxy.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\pub.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\pull.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\push.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\random.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\reaper.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\rep.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\req.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\router.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\select.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\session_base.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\signaler.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\socket_base.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\stream_engine.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\sub.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\tcp.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\tcp_address.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\tcp_connecter.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\tcp_listener.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\thread.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\trie.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\v1_decoder.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\v1_encoder.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\xpub.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\xsub.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\zmq.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\zmq_utils.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- <File
- RelativePath="..\..\..\src\address.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\array.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\atomic_counter.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\atomic_ptr.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\clock.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\command.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\config.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\ctx.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\decoder.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\devpoll.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\dist.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\encoder.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\epoll.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\err.hpp"
- >
- </File>
- <File
- RelativePath="..\errno.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\fd.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\fq.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\i_engine.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\i_poll_events.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\io_object.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\io_thread.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\ip.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\ipc_address.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\ipc_connecter.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\ipc_listener.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\kqueue.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\lb.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\likely.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\mailbox.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\msg.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\mtrie.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\mutex.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\object.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\options.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\own.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\pair.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\pgm_receiver.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\pgm_sender.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\pgm_socket.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\pipe.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\platform.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\poll.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\poller.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\poller_base.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\proxy.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\pub.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\pull.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\push.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\random.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\reaper.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\rep.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\req.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\select.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\session_base.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\signaler.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\socket_base.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\stdint.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\stream_engine.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\sub.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\tcp.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\tcp_address.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\tcp_connecter.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\tcp_listener.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\thread.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\trie.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\v1_decoder.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\v1_encoder.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\v1_protocol.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\windows.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\wire.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\xpub.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\xrep.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\xreq.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\xsub.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\ypipe.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\src\yqueue.hpp"
- >
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="windows-1250"?>\r
+<VisualStudioProject\r
+ ProjectType="Visual C++"\r
+ Version="9,00"\r
+ Name="libzmq"\r
+ ProjectGUID="{641C5F36-32EE-4323-B740-992B651CF9D6}"\r
+ RootNamespace="libzmq"\r
+ TargetFrameworkVersion="196613"\r
+ >\r
+ <Platforms>\r
+ <Platform\r
+ Name="Win32"\r
+ />\r
+ </Platforms>\r
+ <ToolFiles>\r
+ </ToolFiles>\r
+ <Configurations>\r
+ <Configuration\r
+ Name="Debug|Win32"\r
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+ IntermediateDirectory="$(ConfigurationName)"\r
+ ConfigurationType="2"\r
+ CharacterSet="2"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ CommandLine="copy ..\platform.hpp ..\..\..\src"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ AdditionalOptions="-DDLL_EXPORT -DFD_SETSIZE=1024 -D_CRT_SECURE_NO_WARNINGS"\r
+ Optimization="0"\r
+ PreprocessorDefinitions="NOMINMAX"\r
+ MinimalRebuild="true"\r
+ BasicRuntimeChecks="3"\r
+ RuntimeLibrary="3"\r
+ WarningLevel="3"\r
+ DebugInformationFormat="4"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ AdditionalDependencies="Ws2_32.lib Rpcrt4.lib Advapi32.lib"\r
+ OutputFile="../../../lib/libzmq.dll"\r
+ LinkDLL="true"\r
+ GenerateDebugInformation="true"\r
+ TargetMachine="1"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="Release|Win32"\r
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+ IntermediateDirectory="$(ConfigurationName)"\r
+ ConfigurationType="2"\r
+ CharacterSet="2"\r
+ WholeProgramOptimization="1"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ CommandLine="copy ..\platform.hpp ..\..\..\src"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ AdditionalOptions="-DDLL_EXPORT -DFD_SETSIZE=1024 -D_CRT_SECURE_NO_WARNINGS"\r
+ Optimization="2"\r
+ EnableIntrinsicFunctions="true"\r
+ RuntimeLibrary="2"\r
+ EnableFunctionLevelLinking="true"\r
+ WarningLevel="3"\r
+ DebugInformationFormat="3"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ AdditionalDependencies="Ws2_32.lib Rpcrt4.lib Advapi32.lib"\r
+ OutputFile="../../../lib/libzmq.dll"\r
+ LinkDLL="true"\r
+ GenerateDebugInformation="true"\r
+ OptimizeReferences="2"\r
+ EnableCOMDATFolding="2"\r
+ TargetMachine="1"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="StaticDebug|Win32"\r
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+ IntermediateDirectory="$(ConfigurationName)"\r
+ ConfigurationType="4"\r
+ CharacterSet="2"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ CommandLine="copy ..\platform.hpp ..\..\..\src"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ AdditionalOptions="-DZMQ_STATIC -DFD_SETSIZE=1024 -D_CRT_SECURE_NO_WARNINGS"\r
+ Optimization="0"\r
+ PreprocessorDefinitions="NOMINMAX"\r
+ MinimalRebuild="true"\r
+ BasicRuntimeChecks="3"\r
+ RuntimeLibrary="3"\r
+ WarningLevel="3"\r
+ DebugInformationFormat="4"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLibrarianTool"\r
+ AdditionalOptions="/ignore:4006"\r
+ AdditionalDependencies="Ws2_32.lib Rpcrt4.lib Advapi32.lib"\r
+ OutputFile="../../../lib/libzmq_d.lib"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="StaticRelease|Win32"\r
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+ IntermediateDirectory="$(ConfigurationName)"\r
+ ConfigurationType="4"\r
+ CharacterSet="2"\r
+ WholeProgramOptimization="1"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ CommandLine="copy ..\platform.hpp ..\..\..\src"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ AdditionalOptions="-DZMQ_STATIC -DFD_SETSIZE=1024 -D_CRT_SECURE_NO_WARNINGS"\r
+ Optimization="2"\r
+ EnableIntrinsicFunctions="true"\r
+ RuntimeLibrary="2"\r
+ EnableFunctionLevelLinking="true"\r
+ WarningLevel="3"\r
+ DebugInformationFormat="3"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLibrarianTool"\r
+ AdditionalOptions="/ignore:4006"\r
+ AdditionalDependencies="Ws2_32.lib Rpcrt4.lib Advapi32.lib"\r
+ OutputFile="../../../lib/libzmq.lib"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="WithOpenPGM|Win32"\r
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+ IntermediateDirectory="$(ConfigurationName)"\r
+ ConfigurationType="2"\r
+ CharacterSet="2"\r
+ WholeProgramOptimization="1"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ CommandLine="copy ..\platform.hpp ..\..\..\src"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ AdditionalOptions="-DDLL_EXPORT -DFD_SETSIZE=1024 -D_CRT_SECURE_NO_WARNINGS"\r
+ Optimization="2"\r
+ EnableIntrinsicFunctions="true"\r
+ AdditionalIncludeDirectories="../../../../OpenPGM/include"\r
+ PreprocessorDefinitions="ZMQ_HAVE_OPENPGM"\r
+ RuntimeLibrary="2"\r
+ EnableFunctionLevelLinking="true"\r
+ WarningLevel="3"\r
+ DebugInformationFormat="3"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ AdditionalDependencies="Ws2_32.lib Rpcrt4.lib Advapi32.lib libpgm.lib"\r
+ OutputFile="../../../lib/libzmq.dll"\r
+ AdditionalLibraryDirectories="../../../../OpenPGM/lib"\r
+ LinkDLL="true"\r
+ GenerateDebugInformation="true"\r
+ OptimizeReferences="2"\r
+ EnableCOMDATFolding="2"\r
+ TargetMachine="1"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ </Configurations>\r
+ <References>\r
+ </References>\r
+ <Files>\r
+ <Filter\r
+ Name="Source Files"\r
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+ >\r
+ <File\r
+ RelativePath="..\..\..\src\address.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\clock.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\ctx.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\dealer.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\devpoll.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\dist.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\epoll.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\err.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\errno.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\fq.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\io_object.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\io_thread.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\ip.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\ipc_address.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\ipc_connecter.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\ipc_listener.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\kqueue.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\lb.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\mailbox.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\mechanism.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\msg.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\mtrie.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\null_mechanism.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\object.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\options.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\own.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\pair.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\pgm_receiver.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\pgm_sender.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\pgm_socket.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\pipe.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\plain_mechanism.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\poll.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\poller_base.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\proxy.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\pub.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\pull.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\push.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\random.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\raw_decoder.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\raw_encoder.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\reaper.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\rep.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\req.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\router.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\select.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\session_base.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\signaler.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\socket_base.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\stream.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\stream_engine.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\sub.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\tcp.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\tcp_address.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\tcp_connecter.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\tcp_listener.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\thread.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\trie.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\v1_decoder.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\v1_encoder.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\v2_decoder.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\v2_encoder.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\xpub.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\xsub.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\zmq.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\zmq_utils.cpp"\r
+ >\r
+ </File>\r
+ </Filter>\r
+ <Filter\r
+ Name="Header Files"\r
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
+ >\r
+ <File\r
+ RelativePath="..\..\..\src\address.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\array.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\atomic_counter.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\atomic_ptr.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\clock.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\command.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\config.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\ctx.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\decoder.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\devpoll.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\dist.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\encoder.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\epoll.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\err.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\errno.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\fd.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\fq.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\i_engine.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\i_poll_events.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\io_object.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\io_thread.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\ip.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\ipc_address.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\ipc_connecter.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\ipc_listener.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\kqueue.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\lb.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\likely.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\mailbox.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\mechanism.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\msg.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\mtrie.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\mutex.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\null_mechanism.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\object.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\options.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\own.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\pair.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\pgm_receiver.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\pgm_sender.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\pgm_socket.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\pipe.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\plain_mechanism.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\platform.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\poll.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\poller.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\poller_base.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\proxy.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\pub.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\pull.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\push.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\random.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\raw_decoder.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\raw_encoder.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\reaper.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\rep.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\req.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\select.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\session_base.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\signaler.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\socket_base.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\stdint.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\stream.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\stream_engine.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\sub.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\tcp.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\tcp_address.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\tcp_connecter.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\tcp_listener.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\thread.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\trie.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\v1_decoder.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\v1_encoder.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\v1_protocol.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\v2_decoder.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\v2_encoder.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\v2_protocol.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\windows.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\wire.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\xpub.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\xrep.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\xreq.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\xsub.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\ypipe.hpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\..\src\yqueue.hpp"\r
+ >\r
+ </File>\r
+ </Filter>\r
+ </Files>\r
+ <Globals>\r
+ </Globals>\r
+</VisualStudioProject>\r
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
+ <ProjectConfiguration Include="StaticDebug|Win32">
+ <Configuration>StaticDebug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="StaticRelease|Win32">
+ <Configuration>StaticRelease</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
<ProjectConfiguration Include="WithOpenPGM|Win32">
<Configuration>WithOpenPGM</Configuration>
<Platform>Win32</Platform>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='StaticRelease|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='StaticDebug|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings" />
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='WithOpenPGM|Win32'" Label="PropertySheets">
<Import Project="$(ProjectDir)..\properties\x64.props" />
<Import Project="$(ProjectDir)..\properties\Debug.props" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='StaticRelease|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(ProjectDir)..\properties\ZeroMQ_Static.props" />
+ <Import Project="$(ProjectDir)..\properties\Win32_Release.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='StaticDebug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(ProjectDir)..\properties\ZeroMQ_Static.props" />
+ <Import Project="$(ProjectDir)..\properties\Win32.props" />
+ <Import Project="$(ProjectDir)..\properties\Debug.props" />
+ </ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <PreBuildEvent>
+ <Command>copy ..\platform.hpp ..\..\..\src</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <PreBuildEvent>
+ <Command>copy ..\platform.hpp ..\..\..\src</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <PreBuildEvent>
+ <Command>copy ..\platform.hpp ..\..\..\src</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <PreBuildEvent>
+ <Command>copy ..\platform.hpp ..\..\..\src</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='StaticRelease|Win32'">
+ <PreBuildEvent>
+ <Command>copy ..\platform.hpp ..\..\..\src</Command>
+ </PreBuildEvent>
+ <ClCompile>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ </ClCompile>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='StaticDebug|Win32'">
+ <PreBuildEvent>
+ <Command>copy ..\platform.hpp ..\..\..\src</Command>
+ </PreBuildEvent>
+ <ClCompile>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ </ClCompile>
+ </ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\src\address.cpp" />
<ClCompile Include="..\..\..\src\clock.cpp" />
<ClCompile Include="..\..\..\src\ctx.cpp" />
<ClCompile Include="..\..\..\src\dealer.cpp" />
- <ClCompile Include="..\..\..\src\decoder.cpp" />
<ClCompile Include="..\..\..\src\devpoll.cpp" />
<ClCompile Include="..\..\..\src\dist.cpp" />
- <ClCompile Include="..\..\..\src\encoder.cpp" />
<ClCompile Include="..\..\..\src\epoll.cpp" />
<ClCompile Include="..\..\..\src\err.cpp" />
<ClCompile Include="..\..\..\src\fq.cpp" />
<ClCompile Include="..\..\..\src\kqueue.cpp" />
<ClCompile Include="..\..\..\src\lb.cpp" />
<ClCompile Include="..\..\..\src\mailbox.cpp" />
+ <ClCompile Include="..\..\..\src\mechanism.cpp" />
<ClCompile Include="..\..\..\src\msg.cpp" />
<ClCompile Include="..\..\..\src\mtrie.cpp" />
+ <ClCompile Include="..\..\..\src\null_mechanism.cpp" />
<ClCompile Include="..\..\..\src\object.cpp" />
<ClCompile Include="..\..\..\src\options.cpp" />
<ClCompile Include="..\..\..\src\own.cpp" />
<ClCompile Include="..\..\..\src\pgm_sender.cpp" />
<ClCompile Include="..\..\..\src\pgm_socket.cpp" />
<ClCompile Include="..\..\..\src\pipe.cpp" />
+ <ClCompile Include="..\..\..\src\plain_mechanism.cpp" />
<ClCompile Include="..\..\..\src\poll.cpp" />
<ClCompile Include="..\..\..\src\poller_base.cpp" />
<ClCompile Include="..\..\..\src\precompiled.cpp">
<ClCompile Include="..\..\..\src\pull.cpp" />
<ClCompile Include="..\..\..\src\push.cpp" />
<ClCompile Include="..\..\..\src\random.cpp" />
+ <ClCompile Include="..\..\..\src\raw_decoder.cpp" />
+ <ClCompile Include="..\..\..\src\raw_encoder.cpp" />
<ClCompile Include="..\..\..\src\reaper.cpp" />
<ClCompile Include="..\..\..\src\rep.cpp" />
<ClCompile Include="..\..\..\src\req.cpp" />
<ClCompile Include="..\..\..\src\session_base.cpp" />
<ClCompile Include="..\..\..\src\signaler.cpp" />
<ClCompile Include="..\..\..\src\socket_base.cpp" />
+ <ClCompile Include="..\..\..\src\stream.cpp" />
<ClCompile Include="..\..\..\src\stream_engine.cpp" />
<ClCompile Include="..\..\..\src\sub.cpp" />
<ClCompile Include="..\..\..\src\tcp.cpp" />
<ClCompile Include="..\..\..\src\trie.cpp" />
<ClCompile Include="..\..\..\src\v1_decoder.cpp" />
<ClCompile Include="..\..\..\src\v1_encoder.cpp" />
+ <ClCompile Include="..\..\..\src\v2_decoder.cpp" />
+ <ClCompile Include="..\..\..\src\v2_encoder.cpp" />
<ClCompile Include="..\..\..\src\xpub.cpp" />
<ClCompile Include="..\..\..\src\xsub.cpp" />
<ClCompile Include="..\..\..\src\zmq.cpp" />
<ClInclude Include="..\..\..\src\lb.hpp" />
<ClInclude Include="..\..\..\src\likely.hpp" />
<ClInclude Include="..\..\..\src\mailbox.hpp" />
+ <ClInclude Include="..\..\..\src\mechanism.hpp" />
<ClInclude Include="..\..\..\src\msg.hpp" />
<ClInclude Include="..\..\..\src\mtrie.hpp" />
<ClInclude Include="..\..\..\src\mutex.hpp" />
+ <ClInclude Include="..\..\..\src\null_mechanism.hpp" />
<ClInclude Include="..\..\..\src\object.hpp" />
<ClInclude Include="..\..\..\src\options.hpp" />
<ClInclude Include="..\..\..\src\own.hpp" />
<ClInclude Include="..\..\..\src\pgm_sender.hpp" />
<ClInclude Include="..\..\..\src\pgm_socket.hpp" />
<ClInclude Include="..\..\..\src\pipe.hpp" />
+ <ClInclude Include="..\..\..\src\plain_mechanism.hpp" />
<ClInclude Include="..\..\..\src\platform.hpp" />
<ClInclude Include="..\..\..\src\poll.hpp" />
<ClInclude Include="..\..\..\src\poller.hpp" />
<ClInclude Include="..\..\..\src\pull.hpp" />
<ClInclude Include="..\..\..\src\push.hpp" />
<ClInclude Include="..\..\..\src\random.hpp" />
+ <ClInclude Include="..\..\..\src\raw_decoder.hpp" />
+ <ClInclude Include="..\..\..\src\raw_encoder.hpp" />
<ClInclude Include="..\..\..\src\reaper.hpp" />
<ClInclude Include="..\..\..\src\rep.hpp" />
<ClInclude Include="..\..\..\src\req.hpp" />
<ClInclude Include="..\..\..\src\signaler.hpp" />
<ClInclude Include="..\..\..\src\socket_base.hpp" />
<ClInclude Include="..\..\..\src\stdint.hpp" />
+ <ClInclude Include="..\..\..\src\stream.hpp" />
<ClInclude Include="..\..\..\src\stream_engine.hpp" />
<ClInclude Include="..\..\..\src\sub.hpp" />
<ClInclude Include="..\..\..\src\tcp.hpp" />
<ClCompile Include="..\..\..\src\dealer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="..\..\..\src\decoder.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="..\..\..\src\devpoll.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\dist.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="..\..\..\src\encoder.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="..\..\..\src\epoll.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\v1_encoder.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="..\..\..\src\raw_decoder.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\src\raw_encoder.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\src\v2_decoder.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\src\v2_encoder.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\src\stream.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\src\mechanism.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\src\null_mechanism.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\src\plain_mechanism.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\include\zmq.h">
<ClInclude Include="..\..\..\src\v1_decoder.hpp">
<Filter>Header Files</Filter>
</ClInclude>
+ <ClInclude Include="..\..\..\src\raw_decoder.hpp">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\src\raw_encoder.hpp">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\src\stream.hpp">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\src\null_mechanism.hpp">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\src\plain_mechanism.hpp">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\src\mechanism.hpp">
+ <Filter>Header Files</Filter>
+ </ClInclude>
</ItemGroup>
</Project>
\ No newline at end of file
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
+ StaticDebug|Win32 = StaticDebug|Win32
+ StaticRelease|Win32 = StaticRelease|Win32
WithOpenPGM|Win32 = WithOpenPGM|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{641C5F36-32EE-4323-B740-992B651CF9D6}.Debug|Win32.Build.0 = Debug|Win32
{641C5F36-32EE-4323-B740-992B651CF9D6}.Release|Win32.ActiveCfg = Release|Win32
{641C5F36-32EE-4323-B740-992B651CF9D6}.Release|Win32.Build.0 = Release|Win32
+ {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticDebug|Win32.ActiveCfg = StaticDebug|Win32
+ {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticDebug|Win32.Build.0 = StaticDebug|Win32
+ {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticRelease|Win32.ActiveCfg = StaticRelease|Win32
+ {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticRelease|Win32.Build.0 = StaticRelease|Win32
{641C5F36-32EE-4323-B740-992B651CF9D6}.WithOpenPGM|Win32.ActiveCfg = WithOpenPGM|Win32
{641C5F36-32EE-4323-B740-992B651CF9D6}.WithOpenPGM|Win32.Build.0 = WithOpenPGM|Win32
{4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.Debug|Win32.ActiveCfg = Debug|Win32
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Express 2012 for Windows Desktop
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libzmq", "libzmq\libzmq.vcxproj", "{641C5F36-32EE-4323-B740-992B651CF9D6}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "local_lat", "c_local_lat\c_local_lat.vcxproj", "{4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}"
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
+ StaticDebug|Win32 = StaticDebug|Win32
+ StaticDebug|x64 = StaticDebug|x64
+ StaticRelease|Win32 = StaticRelease|Win32
+ StaticRelease|x64 = StaticRelease|x64
WithOpenPGM|Win32 = WithOpenPGM|Win32
WithOpenPGM|x64 = WithOpenPGM|x64
EndGlobalSection
{641C5F36-32EE-4323-B740-992B651CF9D6}.Release|Win32.Build.0 = Release|Win32
{641C5F36-32EE-4323-B740-992B651CF9D6}.Release|x64.ActiveCfg = Release|x64
{641C5F36-32EE-4323-B740-992B651CF9D6}.Release|x64.Build.0 = Release|x64
+ {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticDebug|Win32.ActiveCfg = StaticDebug|Win32
+ {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticDebug|Win32.Build.0 = StaticDebug|Win32
+ {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticDebug|x64.ActiveCfg = StaticDebug|Win32
+ {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticRelease|Win32.ActiveCfg = StaticRelease|Win32
+ {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticRelease|Win32.Build.0 = StaticRelease|Win32
+ {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticRelease|x64.ActiveCfg = StaticRelease|Win32
{641C5F36-32EE-4323-B740-992B651CF9D6}.WithOpenPGM|Win32.ActiveCfg = WithOpenPGM|Win32
{641C5F36-32EE-4323-B740-992B651CF9D6}.WithOpenPGM|Win32.Build.0 = WithOpenPGM|Win32
{641C5F36-32EE-4323-B740-992B651CF9D6}.WithOpenPGM|x64.ActiveCfg = WithOpenPGM|x64
{4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.Release|Win32.Build.0 = Release|Win32
{4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.Release|x64.ActiveCfg = Release|x64
{4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.Release|x64.Build.0 = Release|x64
+ {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.StaticDebug|Win32.ActiveCfg = Debug|Win32
+ {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.StaticDebug|x64.ActiveCfg = Debug|x64
+ {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.StaticRelease|Win32.ActiveCfg = Release|Win32
+ {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.StaticRelease|x64.ActiveCfg = Release|x64
{4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.WithOpenPGM|Win32.ActiveCfg = Release|Win32
{4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.WithOpenPGM|Win32.Build.0 = Release|Win32
{4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.WithOpenPGM|x64.ActiveCfg = Release|x64
{9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.Release|Win32.Build.0 = Release|Win32
{9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.Release|x64.ActiveCfg = Release|x64
{9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.Release|x64.Build.0 = Release|x64
+ {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.StaticDebug|Win32.ActiveCfg = Debug|Win32
+ {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.StaticDebug|x64.ActiveCfg = Debug|x64
+ {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.StaticRelease|Win32.ActiveCfg = Release|Win32
+ {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.StaticRelease|x64.ActiveCfg = Release|x64
{9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.WithOpenPGM|Win32.ActiveCfg = Release|Win32
{9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.WithOpenPGM|Win32.Build.0 = Release|Win32
{9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.WithOpenPGM|x64.ActiveCfg = Release|x64
{8EF2DF6B-6646-460F-8032-913B70FE0E94}.Release|Win32.Build.0 = Release|Win32
{8EF2DF6B-6646-460F-8032-913B70FE0E94}.Release|x64.ActiveCfg = Release|x64
{8EF2DF6B-6646-460F-8032-913B70FE0E94}.Release|x64.Build.0 = Release|x64
+ {8EF2DF6B-6646-460F-8032-913B70FE0E94}.StaticDebug|Win32.ActiveCfg = Debug|Win32
+ {8EF2DF6B-6646-460F-8032-913B70FE0E94}.StaticDebug|x64.ActiveCfg = Debug|x64
+ {8EF2DF6B-6646-460F-8032-913B70FE0E94}.StaticRelease|Win32.ActiveCfg = Release|Win32
+ {8EF2DF6B-6646-460F-8032-913B70FE0E94}.StaticRelease|x64.ActiveCfg = Release|x64
{8EF2DF6B-6646-460F-8032-913B70FE0E94}.WithOpenPGM|Win32.ActiveCfg = Release|Win32
{8EF2DF6B-6646-460F-8032-913B70FE0E94}.WithOpenPGM|Win32.Build.0 = Release|Win32
{8EF2DF6B-6646-460F-8032-913B70FE0E94}.WithOpenPGM|x64.ActiveCfg = Release|x64
{B15E059C-0CBB-4A82-8C42-6567FB650802}.Release|Win32.Build.0 = Release|Win32
{B15E059C-0CBB-4A82-8C42-6567FB650802}.Release|x64.ActiveCfg = Release|x64
{B15E059C-0CBB-4A82-8C42-6567FB650802}.Release|x64.Build.0 = Release|x64
+ {B15E059C-0CBB-4A82-8C42-6567FB650802}.StaticDebug|Win32.ActiveCfg = Debug|Win32
+ {B15E059C-0CBB-4A82-8C42-6567FB650802}.StaticDebug|x64.ActiveCfg = Debug|x64
+ {B15E059C-0CBB-4A82-8C42-6567FB650802}.StaticRelease|Win32.ActiveCfg = Release|Win32
+ {B15E059C-0CBB-4A82-8C42-6567FB650802}.StaticRelease|x64.ActiveCfg = Release|x64
{B15E059C-0CBB-4A82-8C42-6567FB650802}.WithOpenPGM|Win32.ActiveCfg = Release|Win32
{B15E059C-0CBB-4A82-8C42-6567FB650802}.WithOpenPGM|Win32.Build.0 = Release|Win32
{B15E059C-0CBB-4A82-8C42-6567FB650802}.WithOpenPGM|x64.ActiveCfg = Release|x64
{6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.Release|Win32.Build.0 = Release|Win32
{6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.Release|x64.ActiveCfg = Release|x64
{6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.Release|x64.Build.0 = Release|x64
+ {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.StaticDebug|Win32.ActiveCfg = Debug|Win32
+ {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.StaticDebug|x64.ActiveCfg = Debug|x64
+ {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.StaticRelease|Win32.ActiveCfg = Release|Win32
+ {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.StaticRelease|x64.ActiveCfg = Release|x64
{6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.WithOpenPGM|Win32.ActiveCfg = Release|Win32
{6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.WithOpenPGM|Win32.Build.0 = Release|Win32
{6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.WithOpenPGM|x64.ActiveCfg = Release|x64
{1077E977-95DD-4E73-A692-74647DD0CC1E}.Release|Win32.Build.0 = Release|Win32
{1077E977-95DD-4E73-A692-74647DD0CC1E}.Release|x64.ActiveCfg = Release|x64
{1077E977-95DD-4E73-A692-74647DD0CC1E}.Release|x64.Build.0 = Release|x64
+ {1077E977-95DD-4E73-A692-74647DD0CC1E}.StaticDebug|Win32.ActiveCfg = Debug|Win32
+ {1077E977-95DD-4E73-A692-74647DD0CC1E}.StaticDebug|x64.ActiveCfg = Debug|x64
+ {1077E977-95DD-4E73-A692-74647DD0CC1E}.StaticRelease|Win32.ActiveCfg = Release|Win32
+ {1077E977-95DD-4E73-A692-74647DD0CC1E}.StaticRelease|x64.ActiveCfg = Release|x64
{1077E977-95DD-4E73-A692-74647DD0CC1E}.WithOpenPGM|Win32.ActiveCfg = Release|Win32
{1077E977-95DD-4E73-A692-74647DD0CC1E}.WithOpenPGM|Win32.Build.0 = Release|Win32
{1077E977-95DD-4E73-A692-74647DD0CC1E}.WithOpenPGM|x64.ActiveCfg = Release|x64
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ImportGroup Label="PropertySheets">
+ <Import Project="Common.props" />
+ </ImportGroup>
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <_PropertySheetDisplayName>Static Library</_PropertySheetDisplayName>
+ </PropertyGroup>
+ <ItemDefinitionGroup>
+ <ClCompile>
+ <PreprocessorDefinitions>_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ </ItemDefinitionGroup>
+</Project>
\ No newline at end of file
</PreBuildEvent>
<ClCompile>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;DLL_EXPORT;FD_SETSIZE=1024;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <DisableSpecificWarnings>4355</DisableSpecificWarnings>
</ClCompile>
<Link>
<AdditionalDependencies>Ws2_32.lib;Rpcrt4.lib;%(AdditionalDependencies)</AdditionalDependencies>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ImportGroup Label="PropertySheets">
+ <Import Project="Static.props" />
+ <Import Project="Precompiled.props" />
+ </ImportGroup>
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <_PropertySheetDisplayName>ZeroMQ Static Settings</_PropertySheetDisplayName>
+ </PropertyGroup>
+ <ItemDefinitionGroup>
+ <PreBuildEvent>
+ <Command>copy ..\platform.hpp ..\..\..\src</Command>
+ </PreBuildEvent>
+ <ClCompile>
+ <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;ZMQ_STATIC;FD_SETSIZE=1024;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Lib>
+ <AdditionalDependencies>Ws2_32.lib;Rpcrt4.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalOptions>/ignore:4006 /ignore:4221 %(AdditionalOptions)</AdditionalOptions>
+ </Lib>
+ </ItemDefinitionGroup>
+</Project>
\ No newline at end of file
BuildRequires: gcc, make, gcc-c++, libstdc++-devel
Requires: libstdc++
-%if %{?rhel}%{!?rhel:0} >= 6
+%if 0%{?rhel}
+%if 0%{?rhel} == 6
BuildRequires: libuuid-devel
Requires: libuuid
-%elseif %{?rhel}%{!?rhel:0} >= 5
+%endif
+%if 0%{?rhel} == 5
BuildRequires: e2fsprogs-devel
Requires: e2fsprogs
+%endif
%else
BuildRequires: uuid-devel
Requires: uuid
%build
%ifarch pentium3 pentium4 athlon i386 i486 i586 i686 x86_64
- %configure --with-pgm
+ %configure --with-pgm --with-pic --with-gnu-ld
%else
%configure
%endif
%doc AUTHORS ChangeLog COPYING COPYING.LESSER NEWS README
# libraries
-%{_libdir}/libzmq.so.1
-%{_libdir}/libzmq.so.1.0.0
-
-%attr(0755,root,root) %{_bindir}/zmq_forwarder
-%attr(0755,root,root) %{_bindir}/zmq_queue
-%attr(0755,root,root) %{_bindir}/zmq_streamer
+%{_libdir}/libzmq.so.3
+%{_libdir}/libzmq.so.3.0.0
%{_mandir}/man7/zmq.7.gz
-%{_mandir}/man1/zmq_forwarder.1.gz
-%{_mandir}/man1/zmq_queue.1.gz
-%{_mandir}/man1/zmq_streamer.1.gz
%files devel
%defattr(-,root,root,-)
%{_mandir}/man3/zmq_bind.3.gz
%{_mandir}/man3/zmq_close.3.gz
%{_mandir}/man3/zmq_connect.3.gz
+%{_mandir}/man3/zmq_disconnect.3.gz
+%{_mandir}/man3/zmq_ctx_destroy.3.gz
+%{_mandir}/man3/zmq_ctx_get.3.gz
+%{_mandir}/man3/zmq_ctx_new.3.gz
+%{_mandir}/man3/zmq_ctx_set.3.gz
+%{_mandir}/man3/zmq_ctx_term.3.gz
+%{_mandir}/man3/zmq_msg_recv.3.gz
%{_mandir}/man3/zmq_errno.3.gz
%{_mandir}/man3/zmq_getsockopt.3.gz
%{_mandir}/man3/zmq_init.3.gz
%{_mandir}/man3/zmq_msg_init_size.3.gz
%{_mandir}/man3/zmq_msg_move.3.gz
%{_mandir}/man3/zmq_msg_size.3.gz
+%{_mandir}/man3/zmq_msg_get.3.gz
+%{_mandir}/man3/zmq_msg_more.3.gz
+%{_mandir}/man3/zmq_msg_recv.3.gz
+%{_mandir}/man3/zmq_msg_send.3.gz
+%{_mandir}/man3/zmq_msg_set.3.gz
%{_mandir}/man3/zmq_poll.3.gz
+%{_mandir}/man3/zmq_proxy.3.gz
%{_mandir}/man3/zmq_recv.3.gz
%{_mandir}/man3/zmq_recvmsg.3.gz
%{_mandir}/man3/zmq_send.3.gz
%{_mandir}/man3/zmq_sendmsg.3.gz
%{_mandir}/man3/zmq_setsockopt.3.gz
%{_mandir}/man3/zmq_socket.3.gz
+%{_mandir}/man3/zmq_socket_monitor.3.gz
%{_mandir}/man3/zmq_strerror.3.gz
%{_mandir}/man3/zmq_term.3.gz
%{_mandir}/man3/zmq_version.3.gz
+%{_mandir}/man3/zmq_unbind.3.gz
%{_mandir}/man7/zmq_epgm.7.gz
%{_mandir}/man7/zmq_inproc.7.gz
%{_mandir}/man7/zmq_ipc.7.gz
%{_mandir}/man7/zmq_tcp.7.gz
%changelog
+* Mon Nov 26 2012 Justin Cook <jhcook@gmail.com> 3.2.2
+- Update packaged files
+
* Fri Apr 8 2011 Mikko Koppanen <mikko@kuut.io> 3.0.0-1
- Update dependencies and packaged files
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for zeromq 3.2.2.
+# Generated by GNU Autoconf 2.68 for zeromq 4.0.4.
#
# Report bugs to <zeromq-dev@lists.zeromq.org>.
#
# Identity of this package.
PACKAGE_NAME='zeromq'
PACKAGE_TARNAME='zeromq'
-PACKAGE_VERSION='3.2.2'
-PACKAGE_STRING='zeromq 3.2.2'
+PACKAGE_VERSION='4.0.4'
+PACKAGE_STRING='zeromq 4.0.4'
PACKAGE_BUGREPORT='zeromq-dev@lists.zeromq.org'
PACKAGE_URL=''
LIBZMQ_EXTRA_LDFLAGS
LIBZMQ_EXTRA_CXXFLAGS
LIBZMQ_EXTRA_CFLAGS
+ON_LINUX_FALSE
+ON_LINUX_TRUE
ON_ANDROID_FALSE
ON_ANDROID_TRUE
ON_MINGW_FALSE
enable_libtool_lock
enable_debug
with_gcov
+with_libsodium
+with_libsodium_include_dir
+with_libsodium_lib_dir
with_documentation
with_poller
enable_eventfd
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures zeromq 3.2.2 to adapt to many kinds of systems.
+\`configure' configures zeromq 4.0.4 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of zeromq 3.2.2:";;
+ short | recursive ) echo "Configuration of zeromq 4.0.4:";;
esac
cat <<\_ACEOF
--with-sysroot=DIR Search for dependent libraries within DIR
(or the compiler's sysroot if not specified).
--with-gcov=yes/no With GCC Code Coverage reporting.
+ --with-libsodium Specify libsodium prefix
+ --with-libsodium-include-dir
+ Specify libsodium include prefix
+ --with-libsodium-lib-dir
+ Specify libsodium library prefix
--without-documentation disable documentation build even if asciidoc and
xmlto are present [default=no]
--with-poller choose polling system manually. valid values are
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-zeromq configure 3.2.2
+zeromq configure 4.0.4
generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by zeromq $as_me 3.2.2, which was
+It was created by zeromq $as_me 4.0.4, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
# Define the identity of the package.
PACKAGE='zeromq'
- VERSION='3.2.2'
+ VERSION='4.0.4'
cat >>confdefs.h <<_ACEOF
# ZeroMQ versions 2.1.x: 1:0:0 (ABI version 1)
# ZeroMQ version 3.0: 2:0:0 (ABI version 2)
# ZeroMQ version 3.1: 3:0:0 (ABI version 3)
+# ZeroMQ version 4.0: 4:0:1 (ABI version 4)
#
# libzmq -version-info current:revision:age
-LTVER="3:0:0"
+LTVER="4:0:1"
# Take a copy of original flags
fi
}
-# Checks for libraries.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5
-$as_echo_n "checking for pthread_create in -lpthread... " >&6; }
-if ${ac_cv_lib_pthread_pthread_create+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpthread $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
+# Allow libsodium to be installed in a custom path:
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pthread_create ();
-int
-main ()
-{
-return pthread_create ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_pthread_pthread_create=yes
-else
- ac_cv_lib_pthread_pthread_create=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+
+# Check whether --with-libsodium was given.
+if test "${with_libsodium+set}" = set; then :
+ withval=$with_libsodium; zmq_search_libsodium="yes"
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5
-$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; }
-if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBPTHREAD 1
-_ACEOF
- LIBS="-lpthread $LIBS"
+if test "x$zmq_search_libsodium" = "xyes"; then
+ if test -r "${with_libsodium}/include/sodium.h"; then
+ CPPFLAGS="-I${with_libsodium}/include ${CPPFLAGS}"
+ LDFLAGS="-L${with_libsodium}/lib ${LDFLAGS}"
+ fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5
-$as_echo_n "checking for clock_gettime in -lrt... " >&6; }
-if ${ac_cv_lib_rt_clock_gettime+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lrt $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char clock_gettime ();
-int
-main ()
-{
-return clock_gettime ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_rt_clock_gettime=yes
-else
- ac_cv_lib_rt_clock_gettime=no
+# Check whether --with-libsodium-include-dir was given.
+if test "${with_libsodium_include_dir+set}" = set; then :
+ withval=$with_libsodium_include_dir; zmq_search_libsodium_include="yes"
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+
+
+if test "x$zmq_search_libsodium_include" = "xyes"; then
+ if test -r "${with_libsodium_include_dir}/sodium.h"; then
+ CPPFLAGS="-I${with_libsodium_include_dir}/include ${CPPFLAGS}"
+ fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5
-$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; }
-if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBRT 1
-_ACEOF
- LIBS="-lrt $LIBS"
+# Check whether --with-libsodium_lib_dir was given.
+if test "${with_libsodium_lib_dir+set}" = set; then :
+ withval=$with_libsodium_lib_dir; zmq_search_libsodium_lib="yes"
fi
+if test "x$zmq_search_libsodium_lib" = "xyes"; then
+ if test -r "${with_libsodium_lib_dir}/libsodium.{a|so|dylib}"; then
+ LDFLAGS="-L${with_libsodium}/lib ${LDFLAGS}"
+ fi
+fi
+
# Set pedantic
libzmq_pedantic="yes"
# By default use DSO visibility
libzmq_dso_visibility="yes"
-# Whether we are on mingw or android or not.
+# Platform specific checks
libzmq_on_mingw32="no"
libzmq_on_android="no"
+libzmq_on_linux="no"
# Set some default features required by 0MQ code.
CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE $CPPFLAGS"
$as_echo "#define ZMQ_HAVE_LINUX 1" >>confdefs.h
+ libzmq_on_linux="yes"
case "${host_os}" in
*android*)
$as_echo "#define ZMQ_FORCE_MUTEXES 1" >>confdefs.h
fi
+ # ssp library is required for libsodium on Solaris-like systems
+ LDFLAGS="-lssp $LDFLAGS"
+ CPPFLAGS="$CPPFLAGS -Wno-long-long"
;;
*freebsd*)
# Define on FreeBSD to enable all library features
;;
esac
+# Checks for libraries
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5
+$as_echo_n "checking for pthread_create in -lpthread... " >&6; }
+if ${ac_cv_lib_pthread_pthread_create+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_create ();
+int
+main ()
+{
+return pthread_create ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_pthread_pthread_create=yes
+else
+ ac_cv_lib_pthread_pthread_create=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5
+$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; }
+if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBPTHREAD 1
+_ACEOF
+
+ LIBS="-lpthread $LIBS"
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5
+$as_echo_n "checking for clock_gettime in -lrt... " >&6; }
+if ${ac_cv_lib_rt_clock_gettime+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lrt $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char clock_gettime ();
+int
+main ()
+{
+return clock_gettime ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_rt_clock_gettime=yes
+else
+ ac_cv_lib_rt_clock_gettime=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5
+$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; }
+if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBRT 1
+_ACEOF
+
+ LIBS="-lrt $LIBS"
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sodium_init in -lsodium" >&5
+$as_echo_n "checking for sodium_init in -lsodium... " >&6; }
+if ${ac_cv_lib_sodium_sodium_init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsodium $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sodium_init ();
+int
+main ()
+{
+return sodium_init ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_sodium_sodium_init=yes
+else
+ ac_cv_lib_sodium_sodium_init=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sodium_sodium_init" >&5
+$as_echo "$ac_cv_lib_sodium_sodium_init" >&6; }
+if test "x$ac_cv_lib_sodium_sodium_init" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBSODIUM 1
+_ACEOF
+
+ LIBS="-lsodium $LIBS"
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libsodium is needed for CURVE security" >&5
+$as_echo "$as_me: WARNING: libsodium is needed for CURVE security" >&2;}
+fi
+
+
#
# Check if the compiler supports -fvisibility=hidden flag. MinGW32 uses __declspec
#
# PGM extension
libzmq_pgm_ext="no"
-pgm_basename="libpgm-5.1.118~dfsg"
+pgm_basename="libpgm-5.2.122~dfsg"
# Check whether --with-pgm was given.
# Build with system openpgm
if test "x$with_system_pgm_ext" != "xno"; then
+ have_pgm_system_library="no"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenPGM" >&5
$as_echo_n "checking for OpenPGM... " >&6; }
+if test -n "$OpenPGM_CFLAGS"; then
+ pkg_cv_OpenPGM_CFLAGS="$OpenPGM_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openpgm-5.2 >= 5.2\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "openpgm-5.2 >= 5.2") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_OpenPGM_CFLAGS=`$PKG_CONFIG --cflags "openpgm-5.2 >= 5.2" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$OpenPGM_LIBS"; then
+ pkg_cv_OpenPGM_LIBS="$OpenPGM_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openpgm-5.2 >= 5.2\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "openpgm-5.2 >= 5.2") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_OpenPGM_LIBS=`$PKG_CONFIG --libs "openpgm-5.2 >= 5.2" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ OpenPGM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "openpgm-5.2 >= 5.2" 2>&1`
+ else
+ OpenPGM_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "openpgm-5.2 >= 5.2" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$OpenPGM_PKG_ERRORS" >&5
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenPGM" >&5
+$as_echo_n "checking for OpenPGM... " >&6; }
+
+if test -n "$OpenPGM_CFLAGS"; then
+ pkg_cv_OpenPGM_CFLAGS="$OpenPGM_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openpgm-5.1 >= 5.1\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "openpgm-5.1 >= 5.1") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_OpenPGM_CFLAGS=`$PKG_CONFIG --cflags "openpgm-5.1 >= 5.1" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$OpenPGM_LIBS"; then
+ pkg_cv_OpenPGM_LIBS="$OpenPGM_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openpgm-5.1 >= 5.1\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "openpgm-5.1 >= 5.1") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_OpenPGM_LIBS=`$PKG_CONFIG --libs "openpgm-5.1 >= 5.1" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ OpenPGM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "openpgm-5.1 >= 5.1" 2>&1`
+ else
+ OpenPGM_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "openpgm-5.1 >= 5.1" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$OpenPGM_PKG_ERRORS" >&5
+
+ as_fn_error $? "Package requirements (openpgm-5.1 >= 5.1) were not met:
+
+$OpenPGM_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables OpenPGM_CFLAGS
+and OpenPGM_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively, you may set the environment variables OpenPGM_CFLAGS
+and OpenPGM_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ OpenPGM_CFLAGS=$pkg_cv_OpenPGM_CFLAGS
+ OpenPGM_LIBS=$pkg_cv_OpenPGM_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ have_pgm_system_library="yes"
+fi
+
+
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenPGM" >&5
+$as_echo_n "checking for OpenPGM... " >&6; }
+
if test -n "$OpenPGM_CFLAGS"; then
pkg_cv_OpenPGM_CFLAGS="$OpenPGM_CFLAGS"
elif test -n "$PKG_CONFIG"; then
OpenPGM_LIBS=$pkg_cv_OpenPGM_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
+ have_pgm_system_library="yes"
+fi
+
+else
+ OpenPGM_CFLAGS=$pkg_cv_OpenPGM_CFLAGS
+ OpenPGM_LIBS=$pkg_cv_OpenPGM_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ have_pgm_system_library="yes"
fi
+ if test "x$have_pgm_system_library" = "xyes"; then
$as_echo "#define ZMQ_HAVE_OPENPGM 1" >>confdefs.h
- LIBZMQ_EXTRA_CXXFLAGS="$OpenPGM_CFLAGS $LIBZMQ_EXTRA_CXXFLAGS"
- LIBS="$OpenPGM_LIBS $LIBS"
+ LIBZMQ_EXTRA_CXXFLAGS="$OpenPGM_CFLAGS $LIBZMQ_EXTRA_CXXFLAGS"
+ LIBS="$OpenPGM_LIBS $LIBS"
+ fi
fi
ON_ANDROID_FALSE=
fi
+ if test "x$libzmq_on_linux" = "xyes"; then
+ ON_LINUX_TRUE=
+ ON_LINUX_FALSE='#'
+else
+ ON_LINUX_TRUE='#'
+ ON_LINUX_FALSE=
+fi
+
# Checks for library functions.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5
_ACEOF
-for ac_func in perror gettimeofday clock_gettime memset socket getifaddrs freeifaddrs
+for ac_func in perror gettimeofday clock_gettime memset socket getifaddrs freeifaddrs fork
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var"
-ac_config_files="$ac_config_files Makefile src/Makefile doc/Makefile perf/Makefile src/libzmq.pc builds/msvc/Makefile tests/Makefile foreign/openpgm/Makefile builds/redhat/zeromq.spec"
+ac_config_files="$ac_config_files Makefile src/Makefile src/libzmq.pc doc/Makefile perf/Makefile tests/Makefile tools/Makefile builds/msvc/Makefile foreign/openpgm/Makefile builds/redhat/zeromq.spec"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
as_fn_error $? "conditional \"ON_ANDROID\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${ON_LINUX_TRUE}" && test -z "${ON_LINUX_FALSE}"; then
+ as_fn_error $? "conditional \"ON_LINUX\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
: "${CONFIG_STATUS=./config.status}"
ac_write_fail=0
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by zeromq $as_me 3.2.2, which was
+This file was extended by zeromq $as_me 4.0.4, which was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-zeromq config.status 3.2.2
+zeromq config.status 4.0.4
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
"libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
+ "src/libzmq.pc") CONFIG_FILES="$CONFIG_FILES src/libzmq.pc" ;;
"doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
"perf/Makefile") CONFIG_FILES="$CONFIG_FILES perf/Makefile" ;;
- "src/libzmq.pc") CONFIG_FILES="$CONFIG_FILES src/libzmq.pc" ;;
- "builds/msvc/Makefile") CONFIG_FILES="$CONFIG_FILES builds/msvc/Makefile" ;;
"tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
+ "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;;
+ "builds/msvc/Makefile") CONFIG_FILES="$CONFIG_FILES builds/msvc/Makefile" ;;
"foreign/openpgm/Makefile") CONFIG_FILES="$CONFIG_FILES foreign/openpgm/Makefile" ;;
"builds/redhat/zeromq.spec") CONFIG_FILES="$CONFIG_FILES builds/redhat/zeromq.spec" ;;
$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
-
--- /dev/null
+# -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+AC_PREREQ(2.61)
+#
+# The 0MQ version number is extracted from include/zmq.h using
+# the version.sh script. Hence, it should be updated there.
+# The version in git should reflect the *next* version planned.
+#
+AC_INIT([zeromq],[m4_esyscmd([./version.sh])],[zeromq-dev@lists.zeromq.org])
+
+AC_CONFIG_AUX_DIR(config)
+AC_CONFIG_MACRO_DIR(config)
+AC_CONFIG_HEADERS([src/platform.hpp])
+AM_INIT_AUTOMAKE(tar-ustar dist-zip foreign)
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+
+# This lets us use PACKAGE_VERSION in Makefiles
+AC_SUBST(PACKAGE_VERSION)
+
+# Libtool -version-info (ABI version)
+#
+# Don't change this unless you know exactly what you're doing and have read and
+# understand:
+# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
+#
+# Changes:
+#
+# ZeroMQ versions prior to 2.1.0 use 0:0:0 (undefined)
+# ZeroMQ versions 2.1.x: 1:0:0 (ABI version 1)
+# ZeroMQ version 3.0: 2:0:0 (ABI version 2)
+# ZeroMQ version 3.1: 3:0:0 (ABI version 3)
+# ZeroMQ version 4.0: 4:0:1 (ABI version 4)
+#
+# libzmq -version-info current:revision:age
+LTVER="4:0:1"
+AC_SUBST(LTVER)
+
+# Take a copy of original flags
+ZMQ_ORIG_CFLAGS="${CFLAGS:-none}"
+ZMQ_ORIG_CPPFLAGS="${CPPFLAGS:-none}"
+ZMQ_ORIG_CXXFLAGS="${CXXFLAGS:-none}"
+
+# Checks for programs.
+AC_PROG_CC
+AC_PROG_CC_C99
+AC_PROG_CXX
+AM_PROG_CC_C_O
+AC_PROG_SED
+AC_PROG_AWK
+
+# Libtool configuration for different targets. See acinclude.m4
+AC_ARG_VAR([XMLTO], [Path to xmlto command])
+AC_PATH_PROG([XMLTO], [xmlto])
+AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
+AC_PATH_PROG([ASCIIDOC], [asciidoc])
+LIBZMQ_CONFIG_LIBTOOL
+AC_LIBTOOL_WIN32_DLL
+AC_PROG_LIBTOOL
+
+# Check whether to build a with debug symbols
+LIBZMQ_CHECK_ENABLE_DEBUG
+
+# Check wheter to enable code coverage
+LIBZMQ_WITH_GCOV
+
+# Allow libsodium to be installed in a custom path:
+
+AC_ARG_WITH([libsodium],
+ [AS_HELP_STRING([--with-libsodium],
+ [Specify libsodium prefix])],
+ [zmq_search_libsodium="yes"],
+ [])
+
+if test "x$zmq_search_libsodium" = "xyes"; then
+ if test -r "${with_libsodium}/include/sodium.h"; then
+ CPPFLAGS="-I${with_libsodium}/include ${CPPFLAGS}"
+ LDFLAGS="-L${with_libsodium}/lib ${LDFLAGS}"
+ fi
+fi
+
+AC_ARG_WITH([libsodium-include-dir],
+ [AS_HELP_STRING([--with-libsodium-include-dir],
+ [Specify libsodium include prefix])],
+ [zmq_search_libsodium_include="yes"],
+ [])
+
+if test "x$zmq_search_libsodium_include" = "xyes"; then
+ if test -r "${with_libsodium_include_dir}/sodium.h"; then
+ CPPFLAGS="-I${with_libsodium_include_dir}/include ${CPPFLAGS}"
+ fi
+fi
+
+AC_ARG_WITH([libsodium_lib_dir],
+ [AS_HELP_STRING([--with-libsodium-lib-dir],
+ [Specify libsodium library prefix])],
+ [zmq_search_libsodium_lib="yes"],
+ [])
+
+if test "x$zmq_search_libsodium_lib" = "xyes"; then
+ if test -r "${with_libsodium_lib_dir}/libsodium.{a|so|dylib}"; then
+ LDFLAGS="-L${with_libsodium}/lib ${LDFLAGS}"
+ fi
+fi
+
+# Set pedantic
+libzmq_pedantic="yes"
+
+# By default compiling with -Werror except OSX.
+libzmq_werror="yes"
+
+# By default use DSO visibility
+libzmq_dso_visibility="yes"
+
+# Platform specific checks
+libzmq_on_mingw32="no"
+libzmq_on_android="no"
+libzmq_on_linux="no"
+
+# Set some default features required by 0MQ code.
+CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE $CPPFLAGS"
+
+# For host type checks
+AC_CANONICAL_HOST
+
+# OS-specific tests
+case "${host_os}" in
+ *linux*)
+ # Define on Linux to enable all library features. Define if using a gnu compiler
+ if test "x$GXX" = "xyes"; then
+ CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS"
+ fi
+ AC_DEFINE(ZMQ_HAVE_LINUX, 1, [Have Linux OS])
+ libzmq_on_linux="yes"
+
+ case "${host_os}" in
+ *android*)
+ AC_DEFINE(ZMQ_HAVE_ANDROID, 1, [Have Android OS])
+ libzmq_on_android="yes"
+ ;;
+ esac
+ ;;
+ *solaris*)
+ # Define on Solaris to enable all library features
+ CPPFLAGS="-D_PTHREADS $CPPFLAGS"
+ AC_DEFINE(ZMQ_HAVE_SOLARIS, 1, [Have Solaris OS])
+ AC_CHECK_LIB(socket, socket)
+ AC_CHECK_LIB(nsl, gethostbyname)
+ AC_MSG_CHECKING([whether atomic operations can be used])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+ [[#include <atomic.h>]],
+ [[uint32_t value;
+ atomic_cas_32 (&value, 0, 0);
+ return 0;]])],
+ [solaris_has_atomic=yes],
+ [solaris_has_atomic=no])
+ AC_MSG_RESULT([$solaris_has_atomic])
+ # Solaris 8 does not have atomic operations exported to user space.
+ if test "x$solaris_has_atomic" = "xno"; then
+ AC_DEFINE(ZMQ_FORCE_MUTEXES, 1, [Force to use mutexes])
+ fi
+ # ssp library is required for libsodium on Solaris-like systems
+ LDFLAGS="-lssp $LDFLAGS"
+ CPPFLAGS="$CPPFLAGS -Wno-long-long"
+ ;;
+ *freebsd*)
+ # Define on FreeBSD to enable all library features
+ CPPFLAGS="-D__BSD_VISIBLE $CPPFLAGS"
+ AC_DEFINE(ZMQ_HAVE_FREEBSD, 1, [Have FreeBSD OS])
+ ;;
+ *darwin*)
+ # Define on Darwin to enable all library features
+ CPPFLAGS="-D_DARWIN_C_SOURCE $CPPFLAGS"
+ libzmq_pedantic="no"
+ libzmq_werror="no"
+ AC_DEFINE(ZMQ_HAVE_OSX, 1, [Have DarwinOSX OS])
+ AC_LANG_PUSH([C++])
+ LIBZMQ_CHECK_LANG_FLAG_PREPEND([-Wno-uninitialized])
+ AC_LANG_POP([C++])
+ ;;
+ *netbsd*)
+ # Define on NetBSD to enable all library features
+ CPPFLAGS="-D_NETBSD_SOURCE $CPPFLAGS"
+ AC_DEFINE(ZMQ_HAVE_NETBSD, 1, [Have NetBSD OS])
+ # NetBSD 5.0 and newer provides atomic operations but we can
+ # only use these on systems where PR #42842 has been fixed so
+ # we must try and link a test program using C++.
+ libzmq_netbsd_has_atomic=no
+ AC_MSG_CHECKING([whether atomic operations can be used])
+ AC_LANG_PUSH([C++])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM(
+ [[#include <atomic.h>]],
+ [[uint32_t value;
+ atomic_cas_32 (&value, 0, 0);
+ return 0;]])],
+ [libzmq_netbsd_has_atomic=yes],
+ [libzmq_netbsd_has_atomic=no])
+ AC_LANG_POP([C++])
+ AC_MSG_RESULT([$libzmq_netbsd_has_atomic])
+ if test "x$libzmq_netbsd_has_atomic" = "xno"; then
+ AC_DEFINE(ZMQ_FORCE_MUTEXES, 1, [Force to use mutexes])
+ fi
+ ;;
+ *openbsd*)
+ # Define on OpenBSD to enable all library features
+ CPPFLAGS="-D_BSD_SOURCE $CPPFLAGS"
+ AC_DEFINE(ZMQ_HAVE_OPENBSD, 1, [Have OpenBSD OS])
+ ;;
+ *nto-qnx*)
+ libzmq_pedantic="no"
+ AC_DEFINE(ZMQ_HAVE_QNXNTO, 1, [Have QNX Neutrino OS])
+ AC_CHECK_LIB(socket, socket)
+ ;;
+ *aix*)
+ AC_DEFINE(ZMQ_HAVE_AIX, 1, [Have AIX OS])
+ ;;
+ *hpux*)
+ # Define on HP-UX to enable all library features
+ CPPFLAGS="-D_POSIX_C_SOURCE=200112L $CPPFLAGS"
+ AC_DEFINE(ZMQ_HAVE_HPUX, 1, [Have HPUX OS])
+ LIBZMQ_CHECK_LANG_FLAG_PREPEND([-Ae])
+ AC_CHECK_FUNCS(gethrtime)
+ ;;
+ *mingw32*)
+ AC_DEFINE(ZMQ_HAVE_WINDOWS, 1, [Have Windows OS])
+ AC_DEFINE(ZMQ_HAVE_MINGW32, 1, [Have MinGW32])
+ AC_CHECK_HEADERS(windows.h)
+ AC_CHECK_LIB(ws2_32, main, ,
+ [AC_MSG_ERROR([cannot link with ws2_32.dll.])])
+ AC_CHECK_LIB(rpcrt4, main, ,
+ [AC_MSG_ERROR([cannot link with rpcrt4.dll.])])
+ AC_CHECK_LIB(iphlpapi, main, ,
+ [AC_MSG_ERROR([cannot link with iphlpapi.dll.])])
+ # mingw32 defines __int64_t as long long
+ AC_LANG_PUSH([C++])
+ LIBZMQ_CHECK_LANG_FLAG_PREPEND([-Wno-long-long])
+ AC_LANG_POP([C++])
+ libzmq_on_mingw32="yes"
+ libzmq_dso_visibility="no"
+
+ if test "x$enable_static" = "xyes"; then
+ AC_MSG_ERROR([Building static libraries is not supported under MinGW32])
+ fi
+ ;;
+ *cygwin*)
+ # Define on Cygwin to enable all library features
+ CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS"
+ AC_DEFINE(ZMQ_HAVE_CYGWIN, 1, [Have Cygwin])
+ if test "x$enable_static" = "xyes"; then
+ AC_MSG_ERROR([Building static libraries is not supported under Cygwin])
+ fi
+ ;;
+ *)
+ AC_MSG_ERROR([unsupported system: ${host_os}.])
+ ;;
+esac
+
+# Checks for libraries
+AC_CHECK_LIB([pthread], [pthread_create])
+AC_CHECK_LIB([rt], [clock_gettime])
+AC_CHECK_LIB([sodium], [sodium_init],,AC_MSG_WARN(libsodium is needed for CURVE security))
+
+#
+# Check if the compiler supports -fvisibility=hidden flag. MinGW32 uses __declspec
+#
+if test "x$libzmq_dso_visibility" = "xyes"; then
+ AC_LANG_PUSH([C++])
+ LIBZMQ_CHECK_LANG_VISIBILITY([LIBZMQ_EXTRA_CXXFLAGS="$libzmq_cv_[]_AC_LANG_ABBREV[]_visibility_flag ${LIBZMQ_EXTRA_CXXFLAGS}"])
+ AC_LANG_POP([C++])
+fi
+
+# CPU-specific optimizations
+case "${host_cpu}" in
+ *sparc*)
+ AC_LANG_PUSH([C++])
+ LIBZMQ_CHECK_LANG_FLAG_PREPEND([-mcpu=v9])
+ AC_LANG_POP([C++])
+ ;;
+ *)
+ ;;
+esac
+
+# Check whether to build docs / install man pages
+LIBZMQ_CHECK_DOC_BUILD
+
+# Check polling system
+LIBZMQ_CHECK_POLLER([CPPFLAGS="${CPPFLAGS} -D${libzmq_cv_poller_flag}"],
+ [AC_MSG_ERROR([Unable to continue without polling system])])
+
+# Checks for header files.
+AC_HEADER_STDC
+AC_CHECK_HEADERS(errno.h arpa/inet.h netinet/tcp.h netinet/in.h stddef.h \
+stdlib.h string.h sys/socket.h sys/time.h time.h unistd.h limits.h)
+
+# Check if we have ifaddrs.h header file.
+AC_CHECK_HEADERS(ifaddrs.h, [AC_DEFINE(ZMQ_HAVE_IFADDRS, 1, [Have ifaddrs.h header.])])
+
+# Check if we have sys/uio.h header file.
+AC_CHECK_HEADERS(sys/uio.h, [AC_DEFINE(ZMQ_HAVE_UIO, 1, [Have uio.h header.])])
+
+# Force not to use eventfd
+AC_ARG_ENABLE([eventfd], [AS_HELP_STRING([--disable-eventfd], [disable eventfd [default=no]])],
+ [zmq_disable_eventfd=yes], [zmq_disable_eventfd=no])
+
+if test "x$zmq_disable_eventfd" != "xyes"; then
+ # Check if we have eventfd.h header file.
+ AC_CHECK_HEADERS(sys/eventfd.h,
+ [AC_DEFINE(ZMQ_HAVE_EVENTFD, 1, [Have eventfd extension.])])
+fi
+
+# Use c++ in subsequent tests
+AC_LANG_PUSH(C++)
+
+AC_HEADER_STDBOOL
+AC_C_CONST
+AC_C_INLINE
+# Checks for typedefs, structures, and compiler characteristics.
+if test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes"; then
+ dnl 279: controlling expression is constant
+ dnl Fixes build with ICC 12.x
+ LIBZMQ_CHECK_WITH_FLAG([-wd279], [AC_TYPE_SIZE_T])
+ LIBZMQ_CHECK_WITH_FLAG([-wd279], [AC_TYPE_SSIZE_T])
+else
+ AC_TYPE_SIZE_T
+ AC_TYPE_SSIZE_T
+fi
+AC_HEADER_TIME
+AC_TYPE_UINT32_T
+AC_C_VOLATILE
+
+# PGM extension
+libzmq_pgm_ext="no"
+
+pgm_basename="libpgm-5.2.122~dfsg"
+
+AC_ARG_WITH([pgm], [AS_HELP_STRING([--with-pgm],
+ [build libzmq with PGM extension [default=no]])],
+ [with_pgm_ext=$withval], [with_pgm_ext=no])
+
+# build using system pgm
+AC_ARG_WITH([system-pgm], [AS_HELP_STRING([--with-system-pgm],
+ [build libzmq with PGM extension. Requires pkg-config [default=no]])],
+ [with_system_pgm_ext=yes], [with_system_pgm_ext=no])
+
+if test "x$with_pgm_ext" != "xno" -a "x$with_system_pgm_ext" != "xno"; then
+ AC_MSG_ERROR([--with-pgm and --with-system-pgm cannot be specified together])
+fi
+
+if test "x$with_pgm_ext" != "xno"; then
+
+ # This allows placing the tar.gz to foreign/openpgm
+ # and using ./configure --with-pgm=libpgm-x.y.z
+ if test "x$with_pgm_ext" != "xyes"; then
+ pgm_basename="$with_pgm_ext"
+ fi
+
+ # Unpack libpgm
+ AC_MSG_NOTICE([Unpacking ${pgm_basename}.tar.gz])
+ libzmq_pwd=`pwd`
+ cd foreign/openpgm
+
+ if ! (gzip -dc "${pgm_basename}.tar.gz" || echo "failed") | ${am__untar}; then
+ AC_MSG_ERROR([cannot unpack the foreign/openpgm/${pgm_basename}.tar.gz file])
+ fi
+
+ cd "${libzmq_pwd}"
+
+ if test -d foreign/openpgm/build-staging; then
+ rm -rf foreign/openpgm/build-staging
+ fi
+
+ mv foreign/openpgm/${pgm_basename} foreign/openpgm/build-staging
+ pgm_srcdir=foreign/openpgm/build-staging/openpgm/pgm
+
+ if ! test -d foreign/openpgm/build-staging/openpgm/pgm/config; then
+ mkdir foreign/openpgm/build-staging/openpgm/pgm/config
+ fi
+
+ # DSO symbol visibility for openpgm
+ AC_LANG_PUSH([C])
+ LIBZMQ_CHECK_LANG_VISIBILITY([ac_configure_args="CFLAGS='$libzmq_cv_[]_AC_LANG_ABBREV[]_visibility_flag' ${ac_configure_args}"])
+ AC_LANG_POP([C])
+
+ pgm_subdir=build-staging/openpgm/pgm
+ AC_SUBST(pgm_subdir)
+
+ AC_SUBST(pgm_srcdir)
+ AC_CONFIG_SUBDIRS([foreign/openpgm/build-staging/openpgm/pgm/])
+
+ # Success!
+ AC_DEFINE(ZMQ_HAVE_OPENPGM, 1, [Have OpenPGM extension])
+ libzmq_pgm_ext="yes"
+fi
+
+# Build with system openpgm
+if test "x$with_system_pgm_ext" != "xno"; then
+ m4_ifdef([PKG_CHECK_MODULES], [
+ have_pgm_system_library="no"
+ PKG_CHECK_MODULES([OpenPGM], [openpgm-5.2 >= 5.2],
+ [ have_pgm_system_library="yes" ],
+ [PKG_CHECK_MODULES([OpenPGM], [openpgm-5.1 >= 5.1],
+ [ have_pgm_system_library="yes" ])
+ ]
+ )
+ if test "x$have_pgm_system_library" = "xyes"; then
+ AC_DEFINE(ZMQ_HAVE_OPENPGM, 1, [Have OpenPGM extension])
+ LIBZMQ_EXTRA_CXXFLAGS="$OpenPGM_CFLAGS $LIBZMQ_EXTRA_CXXFLAGS"
+ LIBS="$OpenPGM_LIBS $LIBS"
+ fi
+ ],
+ [AC_MSG_ERROR([--with-system-pgm requires a working pkg-config installation])])
+fi
+
+AC_SUBST(pgm_basename)
+
+# Set -Wall, -Werror and -pedantic
+AC_LANG_PUSH([C++])
+
+# Check how to enable -Wall
+LIBZMQ_LANG_WALL([CPPFLAGS="$libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag $CPPFLAGS"])
+
+if test "x$libzmq_werror" = "xyes" -a "x$libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" != "xyes"; then
+ LIBZMQ_LANG_WERROR([CPPFLAGS="$libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag $CPPFLAGS"])
+fi
+
+if test "x$libzmq_pedantic" = "xyes"; then
+ LIBZMQ_LANG_STRICT([CPPFLAGS="$libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag $CPPFLAGS"])
+fi
+AC_LANG_POP([C++])
+
+AM_CONDITIONAL(BUILD_PGM, test "x$libzmq_pgm_ext" = "xyes")
+AM_CONDITIONAL(ON_MINGW, test "x$libzmq_on_mingw32" = "xyes")
+AM_CONDITIONAL(ON_ANDROID, test "x$libzmq_on_android" = "xyes")
+AM_CONDITIONAL(ON_LINUX, test "x$libzmq_on_linux" = "xyes")
+
+# Checks for library functions.
+AC_TYPE_SIGNAL
+AC_CHECK_FUNCS(perror gettimeofday clock_gettime memset socket getifaddrs freeifaddrs fork)
+AC_CHECK_HEADERS([alloca.h])
+LIBZMQ_CHECK_SOCK_CLOEXEC([AC_DEFINE(
+ [ZMQ_HAVE_SOCK_CLOEXEC],
+ [1],
+ [Whether SOCK_CLOEXEC is defined and functioning.])
+ ])
+
+# TCP keep-alives Checks.
+LIBZMQ_CHECK_SO_KEEPALIVE([AC_DEFINE(
+ [ZMQ_HAVE_SO_KEEPALIVE],
+ [1],
+ [Whether SO_KEEPALIVE is supported.])
+ ])
+LIBZMQ_CHECK_TCP_KEEPCNT([AC_DEFINE(
+ [ZMQ_HAVE_TCP_KEEPCNT],
+ [1],
+ [Whether TCP_KEEPCNT is supported.])
+ ])
+LIBZMQ_CHECK_TCP_KEEPIDLE([AC_DEFINE(
+ [ZMQ_HAVE_TCP_KEEPIDLE],
+ [1],
+ [Whether TCP_KEEPIDLE is supported.])
+ ])
+LIBZMQ_CHECK_TCP_KEEPINTVL([AC_DEFINE(
+ [ZMQ_HAVE_TCP_KEEPINTVL],
+ [1],
+ [Whether TCP_KEEPINTVL is supported.])
+ ])
+LIBZMQ_CHECK_TCP_KEEPALIVE([AC_DEFINE(
+ [ZMQ_HAVE_TCP_KEEPALIVE],
+ [1],
+ [Whether TCP_KEEPALIVE is supported.])
+ ])
+
+# Subst LIBZMQ_EXTRA_CFLAGS & CXXFLAGS & LDFLAGS
+AC_SUBST(LIBZMQ_EXTRA_CFLAGS)
+AC_SUBST(LIBZMQ_EXTRA_CXXFLAGS)
+AC_SUBST(LIBZMQ_EXTRA_LDFLAGS)
+
+AC_CONFIG_FILES([Makefile \
+ src/Makefile \
+ src/libzmq.pc \
+ doc/Makefile \
+ perf/Makefile \
+ tests/Makefile \
+ tools/Makefile \
+ builds/msvc/Makefile \
+ foreign/openpgm/Makefile \
+ builds/redhat/zeromq.spec])
+AC_OUTPUT
+++ /dev/null
-# -*- Autoconf -*-
-# Process this file with autoconf to produce a configure script.
-AC_PREREQ(2.61)
-#
-# The 0MQ version number is extracted from include/zmq.h using
-# the version.sh script. Hence, it should be updated there.
-# The version in git should reflect the *next* version planned.
-#
-AC_INIT([zeromq],[m4_esyscmd([./version.sh])],[zeromq-dev@lists.zeromq.org])
-
-AC_CONFIG_AUX_DIR(config)
-AC_CONFIG_MACRO_DIR(config)
-AM_CONFIG_HEADER(src/platform.hpp)
-AM_INIT_AUTOMAKE(tar-ustar dist-zip foreign)
-m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
-
-# This lets us use PACKAGE_VERSION in Makefiles
-AC_SUBST(PACKAGE_VERSION)
-
-# Libtool -version-info (ABI version)
-#
-# Don't change this unless you know exactly what you're doing and have read and
-# understand:
-# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
-#
-# Changes:
-#
-# ZeroMQ versions prior to 2.1.0 use 0:0:0 (undefined)
-# ZeroMQ versions 2.1.x: 1:0:0 (ABI version 1)
-# ZeroMQ version 3.0: 2:0:0 (ABI version 2)
-# ZeroMQ version 3.1: 3:0:0 (ABI version 3)
-#
-# libzmq -version-info current:revision:age
-LTVER="3:0:0"
-AC_SUBST(LTVER)
-
-# Take a copy of original flags
-ZMQ_ORIG_CFLAGS="${CFLAGS:-none}"
-ZMQ_ORIG_CPPFLAGS="${CPPFLAGS:-none}"
-ZMQ_ORIG_CXXFLAGS="${CXXFLAGS:-none}"
-
-# Checks for programs.
-AC_PROG_CC
-AC_PROG_CC_C99
-AC_PROG_CXX
-AM_PROG_CC_C_O
-AC_PROG_SED
-AC_PROG_AWK
-
-# Libtool configuration for different targets. See acinclude.m4
-AC_ARG_VAR([XMLTO], [Path to xmlto command])
-AC_PATH_PROG([XMLTO], [xmlto])
-AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
-AC_PATH_PROG([ASCIIDOC], [asciidoc])
-LIBZMQ_CONFIG_LIBTOOL
-AC_LIBTOOL_WIN32_DLL
-AC_PROG_LIBTOOL
-
-# Check whether to build a with debug symbols
-LIBZMQ_CHECK_ENABLE_DEBUG
-
-# Check wheter to enable code coverage
-LIBZMQ_WITH_GCOV
-
-# Checks for libraries.
-AC_CHECK_LIB([pthread], [pthread_create])
-AC_CHECK_LIB([rt], [clock_gettime])
-
-# Set pedantic
-libzmq_pedantic="yes"
-
-# By default compiling with -Werror except OSX.
-libzmq_werror="yes"
-
-# By default use DSO visibility
-libzmq_dso_visibility="yes"
-
-# Whether we are on mingw or android or not.
-libzmq_on_mingw32="no"
-libzmq_on_android="no"
-
-# Set some default features required by 0MQ code.
-CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE $CPPFLAGS"
-
-# For host type checks
-AC_CANONICAL_HOST
-
-# OS-specific tests
-case "${host_os}" in
- *linux*)
- # Define on Linux to enable all library features. Define if using a gnu compiler
- if test "x$GXX" = "xyes"; then
- CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS"
- fi
- AC_DEFINE(ZMQ_HAVE_LINUX, 1, [Have Linux OS])
-
- case "${host_os}" in
- *android*)
- AC_DEFINE(ZMQ_HAVE_ANDROID, 1, [Have Android OS])
- libzmq_on_android="yes"
- ;;
- esac
- ;;
- *solaris*)
- # Define on Solaris to enable all library features
- CPPFLAGS="-D_PTHREADS $CPPFLAGS"
- AC_DEFINE(ZMQ_HAVE_SOLARIS, 1, [Have Solaris OS])
- AC_CHECK_LIB(socket, socket)
- AC_CHECK_LIB(nsl, gethostbyname)
- AC_MSG_CHECKING([whether atomic operations can be used])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
- [[#include <atomic.h>]],
- [[uint32_t value;
- atomic_cas_32 (&value, 0, 0);
- return 0;]])],
- [solaris_has_atomic=yes],
- [solaris_has_atomic=no])
- AC_MSG_RESULT([$solaris_has_atomic])
- # Solaris 8 does not have atomic operations exported to user space.
- if test "x$solaris_has_atomic" = "xno"; then
- AC_DEFINE(ZMQ_FORCE_MUTEXES, 1, [Force to use mutexes])
- fi
- ;;
- *freebsd*)
- # Define on FreeBSD to enable all library features
- CPPFLAGS="-D__BSD_VISIBLE $CPPFLAGS"
- AC_DEFINE(ZMQ_HAVE_FREEBSD, 1, [Have FreeBSD OS])
- ;;
- *darwin*)
- # Define on Darwin to enable all library features
- CPPFLAGS="-D_DARWIN_C_SOURCE $CPPFLAGS"
- libzmq_pedantic="no"
- libzmq_werror="no"
- AC_DEFINE(ZMQ_HAVE_OSX, 1, [Have DarwinOSX OS])
- AC_LANG_PUSH([C++])
- LIBZMQ_CHECK_LANG_FLAG_PREPEND([-Wno-uninitialized])
- AC_LANG_POP([C++])
- ;;
- *netbsd*)
- # Define on NetBSD to enable all library features
- CPPFLAGS="-D_NETBSD_SOURCE $CPPFLAGS"
- AC_DEFINE(ZMQ_HAVE_NETBSD, 1, [Have NetBSD OS])
- # NetBSD 5.0 and newer provides atomic operations but we can
- # only use these on systems where PR #42842 has been fixed so
- # we must try and link a test program using C++.
- libzmq_netbsd_has_atomic=no
- AC_MSG_CHECKING([whether atomic operations can be used])
- AC_LANG_PUSH([C++])
- AC_LINK_IFELSE([AC_LANG_PROGRAM(
- [[#include <atomic.h>]],
- [[uint32_t value;
- atomic_cas_32 (&value, 0, 0);
- return 0;]])],
- [libzmq_netbsd_has_atomic=yes],
- [libzmq_netbsd_has_atomic=no])
- AC_LANG_POP([C++])
- AC_MSG_RESULT([$libzmq_netbsd_has_atomic])
- if test "x$libzmq_netbsd_has_atomic" = "xno"; then
- AC_DEFINE(ZMQ_FORCE_MUTEXES, 1, [Force to use mutexes])
- fi
- ;;
- *openbsd*)
- # Define on OpenBSD to enable all library features
- CPPFLAGS="-D_BSD_SOURCE $CPPFLAGS"
- AC_DEFINE(ZMQ_HAVE_OPENBSD, 1, [Have OpenBSD OS])
- ;;
- *nto-qnx*)
- libzmq_pedantic="no"
- AC_DEFINE(ZMQ_HAVE_QNXNTO, 1, [Have QNX Neutrino OS])
- AC_CHECK_LIB(socket, socket)
- ;;
- *aix*)
- AC_DEFINE(ZMQ_HAVE_AIX, 1, [Have AIX OS])
- ;;
- *hpux*)
- # Define on HP-UX to enable all library features
- CPPFLAGS="-D_POSIX_C_SOURCE=200112L $CPPFLAGS"
- AC_DEFINE(ZMQ_HAVE_HPUX, 1, [Have HPUX OS])
- LIBZMQ_CHECK_LANG_FLAG_PREPEND([-Ae])
- AC_CHECK_FUNCS(gethrtime)
- ;;
- *mingw32*)
- AC_DEFINE(ZMQ_HAVE_WINDOWS, 1, [Have Windows OS])
- AC_DEFINE(ZMQ_HAVE_MINGW32, 1, [Have MinGW32])
- AC_CHECK_HEADERS(windows.h)
- AC_CHECK_LIB(ws2_32, main, ,
- [AC_MSG_ERROR([cannot link with ws2_32.dll.])])
- AC_CHECK_LIB(rpcrt4, main, ,
- [AC_MSG_ERROR([cannot link with rpcrt4.dll.])])
- AC_CHECK_LIB(iphlpapi, main, ,
- [AC_MSG_ERROR([cannot link with iphlpapi.dll.])])
- # mingw32 defines __int64_t as long long
- AC_LANG_PUSH([C++])
- LIBZMQ_CHECK_LANG_FLAG_PREPEND([-Wno-long-long])
- AC_LANG_POP([C++])
- libzmq_on_mingw32="yes"
- libzmq_dso_visibility="no"
-
- if test "x$enable_static" = "xyes"; then
- AC_MSG_ERROR([Building static libraries is not supported under MinGW32])
- fi
- ;;
- *cygwin*)
- # Define on Cygwin to enable all library features
- CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS"
- AC_DEFINE(ZMQ_HAVE_CYGWIN, 1, [Have Cygwin])
- if test "x$enable_static" = "xyes"; then
- AC_MSG_ERROR([Building static libraries is not supported under Cygwin])
- fi
- ;;
- *)
- AC_MSG_ERROR([unsupported system: ${host_os}.])
- ;;
-esac
-
-#
-# Check if the compiler supports -fvisibility=hidden flag. MinGW32 uses __declspec
-#
-if test "x$libzmq_dso_visibility" = "xyes"; then
- AC_LANG_PUSH([C++])
- LIBZMQ_CHECK_LANG_VISIBILITY([LIBZMQ_EXTRA_CXXFLAGS="$libzmq_cv_[]_AC_LANG_ABBREV[]_visibility_flag ${LIBZMQ_EXTRA_CXXFLAGS}"])
- AC_LANG_POP([C++])
-fi
-
-# CPU-specific optimizations
-case "${host_cpu}" in
- *sparc*)
- AC_LANG_PUSH([C++])
- LIBZMQ_CHECK_LANG_FLAG_PREPEND([-mcpu=v9])
- AC_LANG_POP([C++])
- ;;
- *)
- ;;
-esac
-
-# Check whether to build docs / install man pages
-LIBZMQ_CHECK_DOC_BUILD
-
-# Check polling system
-LIBZMQ_CHECK_POLLER([CPPFLAGS="${CPPFLAGS} -D${libzmq_cv_poller_flag}"],
- [AC_MSG_ERROR([Unable to continue without polling system])])
-
-# Checks for header files.
-AC_HEADER_STDC
-AC_CHECK_HEADERS(errno.h arpa/inet.h netinet/tcp.h netinet/in.h stddef.h \
-stdlib.h string.h sys/socket.h sys/time.h time.h unistd.h limits.h)
-
-# Check if we have ifaddrs.h header file.
-AC_CHECK_HEADERS(ifaddrs.h, [AC_DEFINE(ZMQ_HAVE_IFADDRS, 1, [Have ifaddrs.h header.])])
-
-# Check if we have sys/uio.h header file.
-AC_CHECK_HEADERS(sys/uio.h, [AC_DEFINE(ZMQ_HAVE_UIO, 1, [Have uio.h header.])])
-
-# Force not to use eventfd
-AC_ARG_ENABLE([eventfd], [AS_HELP_STRING([--disable-eventfd], [disable eventfd [default=no]])],
- [zmq_disable_eventfd=yes], [zmq_disable_eventfd=no])
-
-if test "x$zmq_disable_eventfd" != "xyes"; then
- # Check if we have eventfd.h header file.
- AC_CHECK_HEADERS(sys/eventfd.h,
- [AC_DEFINE(ZMQ_HAVE_EVENTFD, 1, [Have eventfd extension.])])
-fi
-
-# Use c++ in subsequent tests
-AC_LANG_PUSH(C++)
-
-AC_HEADER_STDBOOL
-AC_C_CONST
-AC_C_INLINE
-# Checks for typedefs, structures, and compiler characteristics.
-if test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes"; then
- dnl 279: controlling expression is constant
- dnl Fixes build with ICC 12.x
- LIBZMQ_CHECK_WITH_FLAG([-wd279], [AC_TYPE_SIZE_T])
- LIBZMQ_CHECK_WITH_FLAG([-wd279], [AC_TYPE_SSIZE_T])
-else
- AC_TYPE_SIZE_T
- AC_TYPE_SSIZE_T
-fi
-AC_HEADER_TIME
-AC_TYPE_UINT32_T
-AC_C_VOLATILE
-
-# PGM extension
-libzmq_pgm_ext="no"
-
-pgm_basename="libpgm-5.1.118~dfsg"
-
-AC_ARG_WITH([pgm], [AS_HELP_STRING([--with-pgm],
- [build libzmq with PGM extension [default=no]])],
- [with_pgm_ext=$withval], [with_pgm_ext=no])
-
-# build using system pgm
-AC_ARG_WITH([system-pgm], [AS_HELP_STRING([--with-system-pgm],
- [build libzmq with PGM extension. Requires pkg-config [default=no]])],
- [with_system_pgm_ext=yes], [with_system_pgm_ext=no])
-
-if test "x$with_pgm_ext" != "xno" -a "x$with_system_pgm_ext" != "xno"; then
- AC_MSG_ERROR([--with-pgm and --with-system-pgm cannot be specified together])
-fi
-
-if test "x$with_pgm_ext" != "xno"; then
-
- # This allows placing the tar.gz to foreign/openpgm
- # and using ./configure --with-pgm=libpgm-x.y.z
- if test "x$with_pgm_ext" != "xyes"; then
- pgm_basename="$with_pgm_ext"
- fi
-
- # Unpack libpgm
- AC_MSG_NOTICE([Unpacking ${pgm_basename}.tar.gz])
- libzmq_pwd=`pwd`
- cd foreign/openpgm
-
- if ! (gzip -dc "${pgm_basename}.tar.gz" || echo "failed") | ${am__untar}; then
- AC_MSG_ERROR([cannot unpack the foreign/openpgm/${pgm_basename}.tar.gz file])
- fi
-
- cd "${libzmq_pwd}"
-
- if test -d foreign/openpgm/build-staging; then
- rm -rf foreign/openpgm/build-staging
- fi
-
- mv foreign/openpgm/${pgm_basename} foreign/openpgm/build-staging
- pgm_srcdir=foreign/openpgm/build-staging/openpgm/pgm
-
- if ! test -d foreign/openpgm/build-staging/openpgm/pgm/config; then
- mkdir foreign/openpgm/build-staging/openpgm/pgm/config
- fi
-
- # DSO symbol visibility for openpgm
- AC_LANG_PUSH([C])
- LIBZMQ_CHECK_LANG_VISIBILITY([ac_configure_args="CFLAGS='$libzmq_cv_[]_AC_LANG_ABBREV[]_visibility_flag' ${ac_configure_args}"])
- AC_LANG_POP([C])
-
- pgm_subdir=build-staging/openpgm/pgm
- AC_SUBST(pgm_subdir)
-
- AC_SUBST(pgm_srcdir)
- AC_CONFIG_SUBDIRS([foreign/openpgm/build-staging/openpgm/pgm/])
-
- # Success!
- AC_DEFINE(ZMQ_HAVE_OPENPGM, 1, [Have OpenPGM extension])
- libzmq_pgm_ext="yes"
-fi
-
-# Build with system openpgm
-if test "x$with_system_pgm_ext" != "xno"; then
- m4_ifdef([PKG_CHECK_MODULES], [
- PKG_CHECK_MODULES([OpenPGM], [openpgm-5.1 >= 5.1])
- AC_DEFINE(ZMQ_HAVE_OPENPGM, 1, [Have OpenPGM extension])
- LIBZMQ_EXTRA_CXXFLAGS="$OpenPGM_CFLAGS $LIBZMQ_EXTRA_CXXFLAGS"
- LIBS="$OpenPGM_LIBS $LIBS"
- ],
- [AC_MSG_ERROR([--with-system-pgm requires a working pkg-config installation])])
-fi
-
-AC_SUBST(pgm_basename)
-
-# Set -Wall, -Werror and -pedantic
-AC_LANG_PUSH([C++])
-
-# Check how to enable -Wall
-LIBZMQ_LANG_WALL([CPPFLAGS="$libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag $CPPFLAGS"])
-
-if test "x$libzmq_werror" = "xyes" -a "x$libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" != "xyes"; then
- LIBZMQ_LANG_WERROR([CPPFLAGS="$libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag $CPPFLAGS"])
-fi
-
-if test "x$libzmq_pedantic" = "xyes"; then
- LIBZMQ_LANG_STRICT([CPPFLAGS="$libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag $CPPFLAGS"])
-fi
-AC_LANG_POP([C++])
-
-AM_CONDITIONAL(BUILD_PGM, test "x$libzmq_pgm_ext" = "xyes")
-AM_CONDITIONAL(ON_MINGW, test "x$libzmq_on_mingw32" = "xyes")
-AM_CONDITIONAL(ON_ANDROID, test "x$libzmq_on_android" = "xyes")
-
-# Checks for library functions.
-AC_TYPE_SIGNAL
-AC_CHECK_FUNCS(perror gettimeofday clock_gettime memset socket getifaddrs freeifaddrs)
-AC_CHECK_HEADERS([alloca.h])
-LIBZMQ_CHECK_SOCK_CLOEXEC([AC_DEFINE(
- [ZMQ_HAVE_SOCK_CLOEXEC],
- [1],
- [Whether SOCK_CLOEXEC is defined and functioning.])
- ])
-
-# TCP keep-alives Checks.
-LIBZMQ_CHECK_SO_KEEPALIVE([AC_DEFINE(
- [ZMQ_HAVE_SO_KEEPALIVE],
- [1],
- [Whether SO_KEEPALIVE is supported.])
- ])
-LIBZMQ_CHECK_TCP_KEEPCNT([AC_DEFINE(
- [ZMQ_HAVE_TCP_KEEPCNT],
- [1],
- [Whether TCP_KEEPCNT is supported.])
- ])
-LIBZMQ_CHECK_TCP_KEEPIDLE([AC_DEFINE(
- [ZMQ_HAVE_TCP_KEEPIDLE],
- [1],
- [Whether TCP_KEEPIDLE is supported.])
- ])
-LIBZMQ_CHECK_TCP_KEEPINTVL([AC_DEFINE(
- [ZMQ_HAVE_TCP_KEEPINTVL],
- [1],
- [Whether TCP_KEEPINTVL is supported.])
- ])
-LIBZMQ_CHECK_TCP_KEEPALIVE([AC_DEFINE(
- [ZMQ_HAVE_TCP_KEEPALIVE],
- [1],
- [Whether TCP_KEEPALIVE is supported.])
- ])
-
-# Subst LIBZMQ_EXTRA_CFLAGS & CXXFLAGS & LDFLAGS
-AC_SUBST(LIBZMQ_EXTRA_CFLAGS)
-AC_SUBST(LIBZMQ_EXTRA_CXXFLAGS)
-AC_SUBST(LIBZMQ_EXTRA_LDFLAGS)
-
-AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile
- perf/Makefile src/libzmq.pc \
- builds/msvc/Makefile tests/Makefile \
- foreign/openpgm/Makefile \
- builds/redhat/zeromq.spec])
-AC_OUTPUT
-
MAN3 = zmq_bind.3 zmq_unbind.3 zmq_connect.3 zmq_disconnect.3 zmq_close.3 \
- zmq_ctx_new.3 zmq_ctx_destroy.3 zmq_ctx_get.3 zmq_ctx_set.3 \
+ zmq_ctx_new.3 zmq_ctx_term.3 zmq_ctx_destroy.3 zmq_ctx_get.3 zmq_ctx_set.3 \
zmq_msg_init.3 zmq_msg_init_data.3 zmq_msg_init_size.3 \
zmq_msg_move.3 zmq_msg_copy.3 zmq_msg_size.3 zmq_msg_data.3 zmq_msg_close.3 \
zmq_msg_send.3 zmq_msg_recv.3 \
- zmq_send.3 zmq_recv.3 \
+ zmq_send.3 zmq_recv.3 zmq_send_const.3 \
zmq_msg_get.3 zmq_msg_set.3 zmq_msg_more.3 \
zmq_getsockopt.3 zmq_setsockopt.3 \
zmq_socket.3 zmq_socket_monitor.3 zmq_poll.3 \
zmq_errno.3 zmq_strerror.3 zmq_version.3 zmq_proxy.3 \
- zmq_sendmsg.3 zmq_recvmsg.3 zmq_init.3 zmq_term.3
+ zmq_sendmsg.3 zmq_recvmsg.3 zmq_init.3 zmq_term.3 \
+ zmq_z85_encode.3 zmq_z85_decode.3 zmq_curve_keypair.3
-MAN7 = zmq.7 zmq_tcp.7 zmq_pgm.7 zmq_epgm.7 zmq_inproc.7 zmq_ipc.7
+MAN7 = zmq.7 zmq_tcp.7 zmq_pgm.7 zmq_epgm.7 zmq_inproc.7 zmq_ipc.7 \
+ zmq_null.7 zmq_plain.7 zmq_curve.7
MAN_DOC = $(MAN1) $(MAN3) $(MAN7)
$(top_srcdir)/config/ltsugar.m4 \
$(top_srcdir)/config/ltversion.m4 \
$(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
MAN3 = zmq_bind.3 zmq_unbind.3 zmq_connect.3 zmq_disconnect.3 zmq_close.3 \
- zmq_ctx_new.3 zmq_ctx_destroy.3 zmq_ctx_get.3 zmq_ctx_set.3 \
+ zmq_ctx_new.3 zmq_ctx_term.3 zmq_ctx_destroy.3 zmq_ctx_get.3 zmq_ctx_set.3 \
zmq_msg_init.3 zmq_msg_init_data.3 zmq_msg_init_size.3 \
zmq_msg_move.3 zmq_msg_copy.3 zmq_msg_size.3 zmq_msg_data.3 zmq_msg_close.3 \
zmq_msg_send.3 zmq_msg_recv.3 \
- zmq_send.3 zmq_recv.3 \
+ zmq_send.3 zmq_recv.3 zmq_send_const.3 \
zmq_msg_get.3 zmq_msg_set.3 zmq_msg_more.3 \
zmq_getsockopt.3 zmq_setsockopt.3 \
zmq_socket.3 zmq_socket_monitor.3 zmq_poll.3 \
zmq_errno.3 zmq_strerror.3 zmq_version.3 zmq_proxy.3 \
- zmq_sendmsg.3 zmq_recvmsg.3 zmq_init.3 zmq_term.3
+ zmq_sendmsg.3 zmq_recvmsg.3 zmq_init.3 zmq_term.3 \
+ zmq_z85_encode.3 zmq_z85_decode.3 zmq_curve_keypair.3
+
+MAN7 = zmq.7 zmq_tcp.7 zmq_pgm.7 zmq_epgm.7 zmq_inproc.7 zmq_ipc.7 \
+ zmq_null.7 zmq_plain.7 zmq_curve.7
-MAN7 = zmq.7 zmq_tcp.7 zmq_pgm.7 zmq_epgm.7 zmq_inproc.7 zmq_ipc.7
MAN_DOC = $(MAN1) $(MAN3) $(MAN7)
MAN_TXT = $(MAN3:%.3=%.txt) $(MAN7:%.7=%.txt)
MAN_HTML = $(MAN_TXT:%.txt=%.html)
.\" Title: zmq
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.1
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ" "7" "11/23/2012" "0MQ 3\&.2\&.1" "0MQ Manual"
+.TH "ZMQ" "7" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
Destroy a 0MQ context
.RS 4
-\fBzmq_ctx_destroy\fR(3)
-.RE
-.PP
-Monitor a 0MQ context
-.RS 4
-
-\fBzmq_ctx_set_monitor\fR(3)
+\fBzmq_ctx_term\fR(3)
.RE
.sp
These deprecated functions let you create and destroy \fIcontexts\fR:
\fBzmq_msg_recv\fR(3)
\fBzmq_send\fR(3)
\fBzmq_recv\fR(3)
+\fBzmq_send_const\fR(3)
.RE
+.sp
+Monitoring socket events: \fBzmq_socket_monitor\fR(3)
.PP
\fBInput/output multiplexing\fR. 0MQ provides a mechanism for applications to multiplex input/output events over a set containing both 0MQ sockets and standard sockets\&. This mechanism mirrors the standard
\fIpoll()\fR
.SS "Proxies"
.sp
0MQ provides \fIproxies\fR to create fanout and fan\-in topologies\&. A proxy connects a \fIfrontend\fR socket to a \fIbackend\fR socket and switches all messages between the two sockets, opaquely\&. A proxy may optionally capture all traffic to a third socket\&. To start a proxy in an application thread, use \fBzmq_proxy\fR(3)\&.
+.SS "Security"
+.sp
+A 0MQ socket can select a security mechanism\&. Both peers must use the same security mechanism\&.
+.sp
+The following security mechanisms are provided for IPC and TCP connections:
+.PP
+Null security
+.RS 4
+
+\fBzmq_null\fR(7)
+.RE
+.PP
+Plain\-text authentication using username and password
+.RS 4
+
+\fBzmq_plain\fR(7)
+.RE
+.PP
+Elliptic curve authentication and encryption
+.RS 4
+
+\fBzmq_curve\fR(7)
+.RE
+.sp
+Generate a CURVE keypair in armored text format: \fBzmq_curve_keypair\fR(3)
+.sp
+Convert an armored key into a 32\-byte binary key: \fBzmq_z85_decode\fR(3)
+.sp
+Convert a 32\-byte binary CURVE key to an armored text string: \fBzmq_z85_encode\fR(3)
.SH "ERROR HANDLING"
.sp
The 0MQ library functions handle errors using the standard conventions found on POSIX systems\&. Generally, this means that upon failure a 0MQ library function shall return either a NULL value (if returning a pointer) or a negative value (if returning an integer), and the actual error code shall be stored in the \fIerrno\fR variable\&.
Language bindings (C++, Python, PHP, Ruby, Java and more) are provided by members of the 0MQ community and pointers can be found on the 0MQ website\&.
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Martin Sustrik <\m[blue]\fBsustrik@250bpm\&.com\fR\m[]\&\s-2\u[1]\d\s+2>, Martin Lucina <\m[blue]\fBmartin@lucina\&.net\fR\m[]\&\s-2\u[2]\d\s+2>, and Pieter Hintjens <\m[blue]\fBph@imatix\&.com\fR\m[]\&\s-2\u[3]\d\s+2>\&.
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
.SH "RESOURCES"
.sp
Main web site: \m[blue]\fBhttp://www\&.zeromq\&.org/\fR\m[]
.sp
-Report bugs to the 0MQ development mailing list: <\m[blue]\fBzeromq\-dev@lists\&.zeromq\&.org\fR\m[]\&\s-2\u[4]\d\s+2>
+Report bugs to the 0MQ development mailing list: <\m[blue]\fBzeromq\-dev@lists\&.zeromq\&.org\fR\m[]\&\s-2\u[1]\d\s+2>
.SH "COPYING"
.sp
Free use of this software is granted under the terms of the GNU Lesser General Public License (LGPL)\&. For details see the files COPYING and COPYING\&.LESSER included with the 0MQ distribution\&.
.SH "NOTES"
.IP " 1." 4
-sustrik@250bpm.com
-.RS 4
-\%mailto:sustrik@250bpm.com
-.RE
-.IP " 2." 4
-martin@lucina.net
-.RS 4
-\%mailto:martin@lucina.net
-.RE
-.IP " 3." 4
-ph@imatix.com
-.RS 4
-\%mailto:ph@imatix.com
-.RE
-.IP " 4." 4
zeromq-dev@lists.zeromq.org
.RS 4
\%mailto:zeromq-dev@lists.zeromq.org
</dt>\r
<dd>\r
<p>\r
- <a href="zmq_ctx_destroy.html">zmq_ctx_destroy(3)</a>\r
-</p>\r
-</dd>\r
-<dt class="hdlist1">\r
-Monitor a ØMQ context\r
-</dt>\r
-<dd>\r
-<p>\r
- <a href="zmq_ctx_set_monitor.html">zmq_ctx_set_monitor(3)</a>\r
+ <a href="zmq_ctx_term.html">zmq_ctx_term(3)</a>\r
</p>\r
</dd>\r
</dl></div>\r
<a href="zmq_msg_recv.html">zmq_msg_recv(3)</a>\r
<a href="zmq_send.html">zmq_send(3)</a>\r
<a href="zmq_recv.html">zmq_recv(3)</a>\r
+ <a href="zmq_send_const.html">zmq_send_const(3)</a>\r
</p>\r
</dd>\r
</dl></div>\r
+<div class="paragraph"><p>Monitoring socket events:\r
+ <a href="zmq_socket_monitor.html">zmq_socket_monitor(3)</a></p></div>\r
<div class="paragraph"><div class="title">Input/output multiplexing</div><p>ØMQ provides a mechanism for applications to multiplex input/output events over\r
a set containing both ØMQ sockets and standard sockets. This mechanism mirrors\r
the standard <em>poll()</em> system call, and is described in detail in\r
two sockets, opaquely. A proxy may optionally capture all traffic to a third\r
socket. To start a proxy in an application thread, use <a href="zmq_proxy.html">zmq_proxy(3)</a>.</p></div>\r
</div>\r
+<div class="sect2">\r
+<h3 id="_security">Security</h3>\r
+<div class="paragraph"><p>A ØMQ socket can select a security mechanism. Both peers must use the same\r
+security mechanism.</p></div>\r
+<div class="paragraph"><p>The following security mechanisms are provided for IPC and TCP connections:</p></div>\r
+<div class="dlist"><dl>\r
+<dt class="hdlist1">\r
+Null security\r
+</dt>\r
+<dd>\r
+<p>\r
+ <a href="zmq_null.html">zmq_null(7)</a>\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+Plain-text authentication using username and password\r
+</dt>\r
+<dd>\r
+<p>\r
+ <a href="zmq_plain.html">zmq_plain(7)</a>\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+Elliptic curve authentication and encryption\r
+</dt>\r
+<dd>\r
+<p>\r
+ <a href="zmq_curve.html">zmq_curve(7)</a>\r
+</p>\r
+</dd>\r
+</dl></div>\r
+<div class="paragraph"><p>Generate a CURVE keypair in armored text format:\r
+ <a href="zmq_curve_keypair.html">zmq_curve_keypair(3)</a></p></div>\r
+<div class="paragraph"><p>Convert an armored key into a 32-byte binary key:\r
+ <a href="zmq_z85_decode.html">zmq_z85_decode(3)</a></p></div>\r
+<div class="paragraph"><p>Convert a 32-byte binary CURVE key to an armored text string:\r
+ <a href="zmq_z85_encode.html">zmq_z85_encode(3)</a></p></div>\r
+</div>\r
</div>\r
</div>\r
<div class="sect1">\r
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Martin Sustrik <<a href="mailto:sustrik@250bpm.com">sustrik@250bpm.com</a>>,\r
-Martin Lucina <<a href="mailto:martin@lucina.net">martin@lucina.net</a>>, and Pieter Hintjens <<a href="mailto:ph@imatix.com">ph@imatix.com</a>>.</p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
<div class="sect1">\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-10-25 17:30:40 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
linkzmq:zmq_ctx_get[3]
Destroy a 0MQ context::
- linkzmq:zmq_ctx_destroy[3]
-
-Monitor a 0MQ context::
- linkzmq:zmq_ctx_set_monitor[3]
+ linkzmq:zmq_ctx_term[3]
These deprecated functions let you create and destroy 'contexts':
linkzmq:zmq_msg_recv[3]
linkzmq:zmq_send[3]
linkzmq:zmq_recv[3]
+ linkzmq:zmq_send_const[3]
+
+Monitoring socket events:
+ linkzmq:zmq_socket_monitor[3]
.Input/output multiplexing
0MQ provides a mechanism for applications to multiplex input/output events over
socket. To start a proxy in an application thread, use linkzmq:zmq_proxy[3].
+Security
+~~~~~~~~
+A 0MQ socket can select a security mechanism. Both peers must use the same
+security mechanism.
+
+The following security mechanisms are provided for IPC and TCP connections:
+
+Null security::
+ linkzmq:zmq_null[7]
+
+Plain-text authentication using username and password::
+ linkzmq:zmq_plain[7]
+
+Elliptic curve authentication and encryption::
+ linkzmq:zmq_curve[7]
+
+Generate a CURVE keypair in armored text format:
+ linkzmq:zmq_curve_keypair[3]
+
+Convert an armored key into a 32-byte binary key:
+ linkzmq:zmq_z85_decode[3]
+
+Convert a 32-byte binary CURVE key to an armored text string:
+ linkzmq:zmq_z85_encode[3]
+
+
ERROR HANDLING
--------------
The 0MQ library functions handle errors using the standard conventions found on
AUTHORS
-------
-This 0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com>,
-Martin Lucina <martin@lucina.net>, and Pieter Hintjens <ph@imatix.com>.
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
RESOURCES
.\" Title: zmq_bind
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.2
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_BIND" "3" "11/23/2012" "0MQ 3\&.2\&.2" "0MQ Manual"
+.TH "ZMQ_BIND" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
\fBzmq_connect\fR(3) \fBzmq_socket\fR(3) \fBzmq\fR(7)
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Pieter Hintjens <\m[blue]\fBph@imatix\&.com\fR\m[]\&\s-2\u[1]\d\s+2>, Martin Sustrik <\m[blue]\fBsustrik@250bpm\&.com\fR\m[]\&\s-2\u[2]\d\s+2> and Martin Lucina <\m[blue]\fBmato@kotelna\&.sk\fR\m[]\&\s-2\u[3]\d\s+2>\&.
-.SH "NOTES"
-.IP " 1." 4
-ph@imatix.com
-.RS 4
-\%mailto:ph@imatix.com
-.RE
-.IP " 2." 4
-sustrik@250bpm.com
-.RS 4
-\%mailto:sustrik@250bpm.com
-.RE
-.IP " 3." 4
-mato@kotelna.sk
-.RS 4
-\%mailto:mato@kotelna.sk
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Pieter Hintjens <<a href="mailto:ph@imatix.com">ph@imatix.com</a>>,\r
-Martin Sustrik <<a href="mailto:sustrik@250bpm.com">sustrik@250bpm.com</a>> and Martin Lucina <<a href="mailto:mato@kotelna.sk">mato@kotelna.sk</a>>.</p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-11-14 10:09:14 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
AUTHORS
-------
-This 0MQ manual page was written by Pieter Hintjens <ph@imatix.com>,
-Martin Sustrik <sustrik@250bpm.com> and Martin Lucina <mato@kotelna.sk>.
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_close
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.1
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_CLOSE" "3" "11/23/2012" "0MQ 3\&.2\&.1" "0MQ Manual"
+.TH "ZMQ_CLOSE" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
\fBzmq_socket\fR(3) \fBzmq_term\fR(3) \fBzmq_setsockopt\fR(3) \fBzmq\fR(7)
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Martin Sustrik <\m[blue]\fBsustrik@250bpm\&.com\fR\m[]\&\s-2\u[1]\d\s+2> and Martin Lucina <\m[blue]\fBmato@kotelna\&.sk\fR\m[]\&\s-2\u[2]\d\s+2>\&.
-.SH "NOTES"
-.IP " 1." 4
-sustrik@250bpm.com
-.RS 4
-\%mailto:sustrik@250bpm.com
-.RE
-.IP " 2." 4
-mato@kotelna.sk
-.RS 4
-\%mailto:mato@kotelna.sk
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Martin Sustrik <<a href="mailto:sustrik@250bpm.com">sustrik@250bpm.com</a>> and\r
-Martin Lucina <<a href="mailto:mato@kotelna.sk">mato@kotelna.sk</a>>.</p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-10-25 17:30:40 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
AUTHORS
-------
-This 0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
-Martin Lucina <mato@kotelna.sk>.
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_connect
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.2
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_CONNECT" "3" "11/23/2012" "0MQ 3\&.2\&.2" "0MQ Manual"
+.TH "ZMQ_CONNECT" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.ps -1
.br
.sp
-following a \fIzmq_connect()\fR, the socket enters its normal \fIready\fR state\&. By contrast, following a \fIzmq_bind()\fR alone, the socket enters a \fImute\fR state in which the socket blocks or drops messages according to the socket type, as defined in \fBzmq_socket\fR(3)\&.
+following a \fIzmq_connect()\fR, for socket types except for ZMQ_ROUTER, the socket enters its normal \fIready\fR state\&. By contrast, following a \fIzmq_bind()\fR alone, the socket enters a \fImute\fR state in which the socket blocks or drops messages according to the socket type, as defined in \fBzmq_socket\fR(3)\&. A ZMQ_ROUTER socket enters its normal \fIready\fR state for a specific peer only when handshaking is complete for that peer, which may take an arbitrary time\&.
.sp .5v
.RE
.SH "RETURN VALUE"
\fBzmq_bind\fR(3) \fBzmq_socket\fR(3) \fBzmq\fR(7)
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Pieter Hintjens <\m[blue]\fBph@imatix\&.com\fR\m[]\&\s-2\u[1]\d\s+2>, Martin Sustrik <\m[blue]\fBsustrik@250bpm\&.com\fR\m[]\&\s-2\u[2]\d\s+2> and Martin Lucina <\m[blue]\fBmato@kotelna\&.sk\fR\m[]\&\s-2\u[3]\d\s+2>\&.
-.SH "NOTES"
-.IP " 1." 4
-ph@imatix.com
-.RS 4
-\%mailto:ph@imatix.com
-.RE
-.IP " 2." 4
-sustrik@250bpm.com
-.RS 4
-\%mailto:sustrik@250bpm.com
-.RE
-.IP " 3." 4
-mato@kotelna.sk
-.RS 4
-\%mailto:mato@kotelna.sk
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
<td class="icon">\r
<div class="title">Note</div>\r
</td>\r
-<td class="content">following a <em>zmq_connect()</em>, the socket enters its normal <em>ready</em> state.\r
-By contrast, following a <em>zmq_bind()</em> alone, the socket enters a <em>mute</em> state\r
-in which the socket blocks or drops messages according to the socket type, as\r
-defined in <a href="zmq_socket.html">zmq_socket(3)</a>.</td>\r
+<td class="content">following a <em>zmq_connect()</em>, for socket types except for ZMQ_ROUTER,\r
+the socket enters its normal <em>ready</em> state. By contrast, following a\r
+<em>zmq_bind()</em> alone, the socket enters a <em>mute</em> state in which the socket\r
+blocks or drops messages according to the socket type, as defined in\r
+<a href="zmq_socket.html">zmq_socket(3)</a>. A ZMQ_ROUTER socket enters its normal <em>ready</em> state\r
+for a specific peer only when handshaking is complete for that peer, which\r
+may take an arbitrary time.</td>\r
</tr></table>\r
</div>\r
</div>\r
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Pieter Hintjens <<a href="mailto:ph@imatix.com">ph@imatix.com</a>>,\r
-Martin Sustrik <<a href="mailto:sustrik@250bpm.com">sustrik@250bpm.com</a>> and Martin Lucina <<a href="mailto:mato@kotelna.sk">mato@kotelna.sk</a>>.</p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-11-14 10:09:14 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
call _zmq_bind()_ before calling _zmq_connect()_. The second exception are
_ZMQ_PAIR_ sockets, which do not automatically reconnect to endpoints.
-NOTE: following a _zmq_connect()_, the socket enters its normal 'ready' state.
-By contrast, following a _zmq_bind()_ alone, the socket enters a 'mute' state
-in which the socket blocks or drops messages according to the socket type, as
-defined in linkzmq:zmq_socket[3].
-
+NOTE: following a _zmq_connect()_, for socket types except for ZMQ_ROUTER,
+the socket enters its normal 'ready' state. By contrast, following a
+_zmq_bind()_ alone, the socket enters a 'mute' state in which the socket
+blocks or drops messages according to the socket type, as defined in
+linkzmq:zmq_socket[3]. A ZMQ_ROUTER socket enters its normal 'ready' state
+for a specific peer only when handshaking is complete for that peer, which
+may take an arbitrary time.
RETURN VALUE
------------
AUTHORS
-------
-This 0MQ manual page was written by Pieter Hintjens <ph@imatix.com>,
-Martin Sustrik <sustrik@250bpm.com> and Martin Lucina <mato@kotelna.sk>.
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_ctx_destroy
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.1
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_CTX_DESTROY" "3" "11/23/2012" "0MQ 3\&.2\&.1" "0MQ Manual"
+.TH "ZMQ_CTX_DESTROY" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
-zmq_ctx_destroy \- destroy a 0MQ context
+zmq_ctx_destroy \- terminate a 0MQ context
.SH "SYNOPSIS"
.sp
\fBint zmq_ctx_destroy (void \fR\fB\fI*context\fR\fR\fB);\fR
.sp
For further details regarding socket linger behavior refer to the \fIZMQ_LINGER\fR option in \fBzmq_setsockopt\fR(3)\&.
.sp
-This function replaces the deprecated function \fBzmq_term\fR(3)\&.
+This function is deprecated by \fBzmq_ctx_term\fR(3)\&.
.SH "RETURN VALUE"
.sp
The \fIzmq_ctx_destroy()\fR function shall return zero if successful\&. Otherwise it shall return \-1 and set \fIerrno\fR to one of the values defined below\&.
\fBzmq\fR(7) \fBzmq_init\fR(3) \fBzmq_close\fR(3) \fBzmq_setsockopt\fR(3)
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Pieter Hintjens <\m[blue]\fBph@imatix\&.com\fR\m[]\&\s-2\u[1]\d\s+2>
-.SH "NOTES"
-.IP " 1." 4
-ph@imatix.com
-.RS 4
-\%mailto:ph@imatix.com
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
<h2>NAME</h2>\r
<div class="sectionbody">\r
<p>zmq_ctx_destroy -\r
- destroy a 0MQ context\r
+ terminate a 0MQ context\r
</p>\r
</div>\r
</div>\r
</ol></div>\r
<div class="paragraph"><p>For further details regarding socket linger behavior refer to the <em>ZMQ_LINGER</em>\r
option in <a href="zmq_setsockopt.html">zmq_setsockopt(3)</a>.</p></div>\r
-<div class="paragraph"><p>This function replaces the deprecated function <a href="zmq_term.html">zmq_term(3)</a>.</p></div>\r
+<div class="paragraph"><p>This function is deprecated by <a href="zmq_ctx_term.html">zmq_ctx_term(3)</a>.</p></div>\r
</div>\r
</div>\r
<div class="sect1">\r
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Pieter Hintjens <<a href="mailto:ph@imatix.com">ph@imatix.com</a>></p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-10-25 17:30:40 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
NAME
----
-zmq_ctx_destroy - destroy a 0MQ context
+zmq_ctx_destroy - terminate a 0MQ context
SYNOPSIS
For further details regarding socket linger behavior refer to the _ZMQ_LINGER_
option in linkzmq:zmq_setsockopt[3].
-This function replaces the deprecated function linkzmq:zmq_term[3].
+This function is deprecated by linkzmq:zmq_ctx_term[3].
RETURN VALUE
AUTHORS
-------
-This 0MQ manual page was written by Pieter Hintjens <ph@imatix.com>
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_ctx_get
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.1
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_CTX_GET" "3" "11/23/2012" "0MQ 3\&.2\&.1" "0MQ Manual"
+.TH "ZMQ_CTX_GET" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.SS "ZMQ_IO_THREADS: Get number of I/O threads"
.sp
The \fIZMQ_IO_THREADS\fR argument returns the size of the 0MQ thread pool for this context\&.
-.SS "ZMQ_MAX_SOCKETS: Set maximum number of sockets"
+.SS "ZMQ_MAX_SOCKETS: Get maximum number of sockets"
.sp
The \fIZMQ_MAX_SOCKETS\fR argument returns the maximum number of sockets allowed for this context\&.
+.SS "ZMQ_IPV6: Set IPv6 option"
+.sp
+The \fIZMQ_IPV6\fR argument returns the IPv6 option for the context\&.
.SH "RETURN VALUE"
.sp
The \fIzmq_ctx_get()\fR function returns a value of 0 or greater if successful\&. Otherwise it returns \-1 and sets \fIerrno\fR to one of the values defined below\&.
.\}
.nf
void *context = zmq_ctx_new ();
-zmq_ctx_get (context, ZMQ_MAX_SOCKETS, 256);
+zmq_ctx_set (context, ZMQ_MAX_SOCKETS, 256);
int max_sockets = zmq_ctx_get (context, ZMQ_MAX_SOCKETS);
assert (max_sockets == 256);
.fi
\fBzmq_ctx_set\fR(3) \fBzmq\fR(7)
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Pieter Hintjens <\m[blue]\fBph@imatix\&.com\fR\m[]\&\s-2\u[1]\d\s+2>
-.SH "NOTES"
-.IP " 1." 4
-ph@imatix.com
-.RS 4
-\%mailto:ph@imatix.com
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
for this context.</p></div>\r
</div>\r
<div class="sect2">\r
-<h3 id="_zmq_max_sockets_set_maximum_number_of_sockets">ZMQ_MAX_SOCKETS: Set maximum number of sockets</h3>\r
+<h3 id="_zmq_max_sockets_get_maximum_number_of_sockets">ZMQ_MAX_SOCKETS: Get maximum number of sockets</h3>\r
<div class="paragraph"><p>The <em>ZMQ_MAX_SOCKETS</em> argument returns the maximum number of sockets\r
allowed for this context.</p></div>\r
</div>\r
+<div class="sect2">\r
+<h3 id="_zmq_ipv6_set_ipv6_option">ZMQ_IPV6: Set IPv6 option</h3>\r
+<div class="paragraph"><p>The <em>ZMQ_IPV6</em> argument returns the IPv6 option for the context.</p></div>\r
+</div>\r
</div>\r
</div>\r
<div class="sect1">\r
<div class="title">Setting a limit on the number of sockets</div>\r
<div class="content">\r
<pre><tt>void *context = zmq_ctx_new ();\r
-zmq_ctx_get (context, ZMQ_MAX_SOCKETS, 256);\r
+zmq_ctx_set (context, ZMQ_MAX_SOCKETS, 256);\r
int max_sockets = zmq_ctx_get (context, ZMQ_MAX_SOCKETS);\r
assert (max_sockets == 256);</tt></pre>\r
</div></div>\r
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Pieter Hintjens <<a href="mailto:ph@imatix.com">ph@imatix.com</a>></p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-10-25 17:30:40 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
The 'ZMQ_IO_THREADS' argument returns the size of the 0MQ thread pool
for this context.
-ZMQ_MAX_SOCKETS: Set maximum number of sockets
+ZMQ_MAX_SOCKETS: Get maximum number of sockets
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_MAX_SOCKETS' argument returns the maximum number of sockets
allowed for this context.
+ZMQ_IPV6: Set IPv6 option
+~~~~~~~~~~~~~~~~~~~~~~~~~
+The 'ZMQ_IPV6' argument returns the IPv6 option for the context.
+
RETURN VALUE
------------
.Setting a limit on the number of sockets
----
void *context = zmq_ctx_new ();
-zmq_ctx_get (context, ZMQ_MAX_SOCKETS, 256);
+zmq_ctx_set (context, ZMQ_MAX_SOCKETS, 256);
int max_sockets = zmq_ctx_get (context, ZMQ_MAX_SOCKETS);
assert (max_sockets == 256);
----
AUTHORS
-------
-This 0MQ manual page was written by Pieter Hintjens <ph@imatix.com>
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_ctx_new
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.1
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_CTX_NEW" "3" "11/23/2012" "0MQ 3\&.2\&.1" "0MQ Manual"
+.TH "ZMQ_CTX_NEW" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
No error values are defined for this function\&.
.SH "SEE ALSO"
.sp
-\fBzmq\fR(7) \fBzmq_ctx_set\fR(3) \fBzmq_ctx_get\fR(3) \fBzmq_ctx_destroy\fR(3)
+\fBzmq\fR(7) \fBzmq_ctx_set\fR(3) \fBzmq_ctx_get\fR(3) \fBzmq_ctx_term\fR(3)
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Pieter Hintjens <\m[blue]\fBph@imatix\&.com\fR\m[]\&\s-2\u[1]\d\s+2>
-.SH "NOTES"
-.IP " 1." 4
-ph@imatix.com
-.RS 4
-\%mailto:ph@imatix.com
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
<div class="paragraph"><p><a href="zmq.html">zmq(7)</a>\r
<a href="zmq_ctx_set.html">zmq_ctx_set(3)</a>\r
<a href="zmq_ctx_get.html">zmq_ctx_get(3)</a>\r
-<a href="zmq_ctx_destroy.html">zmq_ctx_destroy(3)</a></p></div>\r
+<a href="zmq_ctx_term.html">zmq_ctx_term(3)</a></p></div>\r
</div>\r
</div>\r
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Pieter Hintjens <<a href="mailto:ph@imatix.com">ph@imatix.com</a>></p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-10-25 17:30:40 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
linkzmq:zmq[7]
linkzmq:zmq_ctx_set[3]
linkzmq:zmq_ctx_get[3]
-linkzmq:zmq_ctx_destroy[3]
+linkzmq:zmq_ctx_term[3]
AUTHORS
-------
-This 0MQ manual page was written by Pieter Hintjens <ph@imatix.com>
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_ctx_set
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.1
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_CTX_SET" "3" "11/23/2012" "0MQ 3\&.2\&.1" "0MQ Manual"
+.TH "ZMQ_CTX_SET" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
T}
.TE
.sp 1
+.SS "ZMQ_IPV6: Set IPv6 option"
+.sp
+The \fIZMQ_IPV6\fR argument sets the IPv6 value for all sockets created in the context from this point onwards\&. A value of 1 means IPv6 is enabled, while 0 means the socket will use only IPv4\&. When IPv6 is enabled, a socket will connect to, or accept connections from, both IPv4 and IPv6 hosts\&.
+.TS
+tab(:);
+lt lt.
+T{
+.sp
+Default value
+T}:T{
+.sp
+0
+T}
+.TE
+.sp 1
.SH "RETURN VALUE"
.sp
The \fIzmq_ctx_set()\fR function returns zero if successful\&. Otherwise it returns \-1 and sets \fIerrno\fR to one of the values defined below\&.
\fBzmq_ctx_get\fR(3) \fBzmq\fR(7)
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Pieter Hintjens <\m[blue]\fBph@imatix\&.com\fR\m[]\&\s-2\u[1]\d\s+2>
-.SH "NOTES"
-.IP " 1." 4
-ph@imatix.com
-.RS 4
-\%mailto:ph@imatix.com
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
</tr>\r
</table></div>\r
</div>\r
+<div class="sect2">\r
+<h3 id="_zmq_ipv6_set_ipv6_option">ZMQ_IPV6: Set IPv6 option</h3>\r
+<div class="paragraph"><p>The <em>ZMQ_IPV6</em> argument sets the IPv6 value for all sockets created in\r
+the context from this point onwards. A value of <tt>1</tt> means IPv6 is\r
+enabled, while <tt>0</tt> means the socket will use only IPv4. When IPv6 is\r
+enabled, a socket will connect to, or accept connections from, both\r
+IPv4 and IPv6 hosts.</p></div>\r
+<div class="hdlist"><table>\r
+<tr>\r
+<td class="hdlist1">\r
+Default value\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+0\r
+</p>\r
+</td>\r
+</tr>\r
+</table></div>\r
+</div>\r
</div>\r
</div>\r
<div class="sect1">\r
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Pieter Hintjens <<a href="mailto:ph@imatix.com">ph@imatix.com</a>></p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-10-25 17:30:40 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
[horizontal]
Default value:: 1024
+ZMQ_IPV6: Set IPv6 option
+~~~~~~~~~~~~~~~~~~~~~~~~~
+The 'ZMQ_IPV6' argument sets the IPv6 value for all sockets created in
+the context from this point onwards. A value of `1` means IPv6 is
+enabled, while `0` means the socket will use only IPv4. When IPv6 is
+enabled, a socket will connect to, or accept connections from, both
+IPv4 and IPv6 hosts.
+
+[horizontal]
+Default value:: 0
+
RETURN VALUE
------------
AUTHORS
-------
-This 0MQ manual page was written by Pieter Hintjens <ph@imatix.com>
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
--- /dev/null
+'\" t
+.\" Title: zmq_ctx_term
+.\" Author: [see the "AUTHORS" section]
+.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
+.\" Date: 03/10/2014
+.\" Manual: 0MQ Manual
+.\" Source: 0MQ 4.0.1
+.\" Language: English
+.\"
+.TH "ZMQ_CTX_TERM" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+zmq_ctx_term \- destroy a 0MQ context
+.SH "SYNOPSIS"
+.sp
+\fBint zmq_ctx_term (void \fR\fB\fI*context\fR\fR\fB);\fR
+.SH "DESCRIPTION"
+.sp
+The \fIzmq_ctx_term()\fR function shall destroy the 0MQ context \fIcontext\fR\&.
+.sp
+Context termination is performed in the following steps:
+.sp
+.RS 4
+.ie n \{\
+\h'-04' 1.\h'+01'\c
+.\}
+.el \{\
+.sp -1
+.IP " 1." 4.2
+.\}
+Any blocking operations currently in progress on sockets open within
+\fIcontext\fR
+shall return immediately with an error code of ETERM\&. With the exception of
+\fIzmq_close()\fR, any further operations on sockets open within
+\fIcontext\fR
+shall fail with an error code of ETERM\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04' 2.\h'+01'\c
+.\}
+.el \{\
+.sp -1
+.IP " 2." 4.2
+.\}
+After interrupting all blocking calls,
+\fIzmq_ctx_term()\fR
+shall
+\fIblock\fR
+until the following conditions are satisfied:
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+All sockets open within
+\fIcontext\fR
+have been closed with
+\fIzmq_close()\fR\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+For each socket within
+\fIcontext\fR, all messages sent by the application with
+\fIzmq_send()\fR
+have either been physically transferred to a network peer, or the socket\(cqs linger period set with the
+\fIZMQ_LINGER\fR
+socket option has expired\&.
+.RE
+.RE
+.sp
+For further details regarding socket linger behavior refer to the \fIZMQ_LINGER\fR option in \fBzmq_setsockopt\fR(3)\&.
+.sp
+This function replaces the deprecated function \fBzmq_term\fR(3)\&.
+.SH "RETURN VALUE"
+.sp
+The \fIzmq_ctx_term()\fR function shall return zero if successful\&. Otherwise it shall return \-1 and set \fIerrno\fR to one of the values defined below\&.
+.SH "ERRORS"
+.PP
+\fBEFAULT\fR
+.RS 4
+The provided
+\fIcontext\fR
+was invalid\&.
+.RE
+.PP
+\fBEINTR\fR
+.RS 4
+Termination was interrupted by a signal\&. It can be restarted if needed\&.
+.RE
+.SH "SEE ALSO"
+.sp
+\fBzmq\fR(7) \fBzmq_init\fR(3) \fBzmq_close\fR(3) \fBzmq_setsockopt\fR(3)
+.SH "AUTHORS"
+.sp
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"\r
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">\r
+<head>\r
+<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />\r
+<meta name="generator" content="AsciiDoc 8.6.6" />\r
+<title>zmq_ctx_term(3)</title>\r
+<style type="text/css">\r
+/* Shared CSS for AsciiDoc xhtml11 and html5 backends */\r
+\r
+/* Default font. */\r
+body {\r
+ font-family: Georgia,serif;\r
+}\r
+\r
+/* Title font. */\r
+h1, h2, h3, h4, h5, h6,\r
+div.title, caption.title,\r
+thead, p.table.header,\r
+#toctitle,\r
+#author, #revnumber, #revdate, #revremark,\r
+#footer {\r
+ font-family: Arial,Helvetica,sans-serif;\r
+}\r
+\r
+body {\r
+ margin: 1em 5% 1em 5%;\r
+}\r
+\r
+a {\r
+ color: blue;\r
+ text-decoration: underline;\r
+}\r
+a:visited {\r
+ color: fuchsia;\r
+}\r
+\r
+em {\r
+ font-style: italic;\r
+ color: navy;\r
+}\r
+\r
+strong {\r
+ font-weight: bold;\r
+ color: #083194;\r
+}\r
+\r
+h1, h2, h3, h4, h5, h6 {\r
+ color: #527bbd;\r
+ margin-top: 1.2em;\r
+ margin-bottom: 0.5em;\r
+ line-height: 1.3;\r
+}\r
+\r
+h1, h2, h3 {\r
+ border-bottom: 2px solid silver;\r
+}\r
+h2 {\r
+ padding-top: 0.5em;\r
+}\r
+h3 {\r
+ float: left;\r
+}\r
+h3 + * {\r
+ clear: left;\r
+}\r
+h5 {\r
+ font-size: 1.0em;\r
+}\r
+\r
+div.sectionbody {\r
+ margin-left: 0;\r
+}\r
+\r
+hr {\r
+ border: 1px solid silver;\r
+}\r
+\r
+p {\r
+ margin-top: 0.5em;\r
+ margin-bottom: 0.5em;\r
+}\r
+\r
+ul, ol, li > p {\r
+ margin-top: 0;\r
+}\r
+ul > li { color: #aaa; }\r
+ul > li > * { color: black; }\r
+\r
+pre {\r
+ padding: 0;\r
+ margin: 0;\r
+}\r
+\r
+#author {\r
+ color: #527bbd;\r
+ font-weight: bold;\r
+ font-size: 1.1em;\r
+}\r
+#email {\r
+}\r
+#revnumber, #revdate, #revremark {\r
+}\r
+\r
+#footer {\r
+ font-size: small;\r
+ border-top: 2px solid silver;\r
+ padding-top: 0.5em;\r
+ margin-top: 4.0em;\r
+}\r
+#footer-text {\r
+ float: left;\r
+ padding-bottom: 0.5em;\r
+}\r
+#footer-badges {\r
+ float: right;\r
+ padding-bottom: 0.5em;\r
+}\r
+\r
+#preamble {\r
+ margin-top: 1.5em;\r
+ margin-bottom: 1.5em;\r
+}\r
+div.imageblock, div.exampleblock, div.verseblock,\r
+div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,\r
+div.admonitionblock {\r
+ margin-top: 1.0em;\r
+ margin-bottom: 1.5em;\r
+}\r
+div.admonitionblock {\r
+ margin-top: 2.0em;\r
+ margin-bottom: 2.0em;\r
+ margin-right: 10%;\r
+ color: #606060;\r
+}\r
+\r
+div.content { /* Block element content. */\r
+ padding: 0;\r
+}\r
+\r
+/* Block element titles. */\r
+div.title, caption.title {\r
+ color: #527bbd;\r
+ font-weight: bold;\r
+ text-align: left;\r
+ margin-top: 1.0em;\r
+ margin-bottom: 0.5em;\r
+}\r
+div.title + * {\r
+ margin-top: 0;\r
+}\r
+\r
+td div.title:first-child {\r
+ margin-top: 0.0em;\r
+}\r
+div.content div.title:first-child {\r
+ margin-top: 0.0em;\r
+}\r
+div.content + div.title {\r
+ margin-top: 0.0em;\r
+}\r
+\r
+div.sidebarblock > div.content {\r
+ background: #ffffee;\r
+ border: 1px solid #dddddd;\r
+ border-left: 4px solid #f0f0f0;\r
+ padding: 0.5em;\r
+}\r
+\r
+div.listingblock > div.content {\r
+ border: 1px solid #dddddd;\r
+ border-left: 5px solid #f0f0f0;\r
+ background: #f8f8f8;\r
+ padding: 0.5em;\r
+}\r
+\r
+div.quoteblock, div.verseblock {\r
+ padding-left: 1.0em;\r
+ margin-left: 1.0em;\r
+ margin-right: 10%;\r
+ border-left: 5px solid #f0f0f0;\r
+ color: #888;\r
+}\r
+\r
+div.quoteblock > div.attribution {\r
+ padding-top: 0.5em;\r
+ text-align: right;\r
+}\r
+\r
+div.verseblock > pre.content {\r
+ font-family: inherit;\r
+ font-size: inherit;\r
+}\r
+div.verseblock > div.attribution {\r
+ padding-top: 0.75em;\r
+ text-align: left;\r
+}\r
+/* DEPRECATED: Pre version 8.2.7 verse style literal block. */\r
+div.verseblock + div.attribution {\r
+ text-align: left;\r
+}\r
+\r
+div.admonitionblock .icon {\r
+ vertical-align: top;\r
+ font-size: 1.1em;\r
+ font-weight: bold;\r
+ text-decoration: underline;\r
+ color: #527bbd;\r
+ padding-right: 0.5em;\r
+}\r
+div.admonitionblock td.content {\r
+ padding-left: 0.5em;\r
+ border-left: 3px solid #dddddd;\r
+}\r
+\r
+div.exampleblock > div.content {\r
+ border-left: 3px solid #dddddd;\r
+ padding-left: 0.5em;\r
+}\r
+\r
+div.imageblock div.content { padding-left: 0; }\r
+span.image img { border-style: none; }\r
+a.image:visited { color: white; }\r
+\r
+dl {\r
+ margin-top: 0.8em;\r
+ margin-bottom: 0.8em;\r
+}\r
+dt {\r
+ margin-top: 0.5em;\r
+ margin-bottom: 0;\r
+ font-style: normal;\r
+ color: navy;\r
+}\r
+dd > *:first-child {\r
+ margin-top: 0.1em;\r
+}\r
+\r
+ul, ol {\r
+ list-style-position: outside;\r
+}\r
+ol.arabic {\r
+ list-style-type: decimal;\r
+}\r
+ol.loweralpha {\r
+ list-style-type: lower-alpha;\r
+}\r
+ol.upperalpha {\r
+ list-style-type: upper-alpha;\r
+}\r
+ol.lowerroman {\r
+ list-style-type: lower-roman;\r
+}\r
+ol.upperroman {\r
+ list-style-type: upper-roman;\r
+}\r
+\r
+div.compact ul, div.compact ol,\r
+div.compact p, div.compact p,\r
+div.compact div, div.compact div {\r
+ margin-top: 0.1em;\r
+ margin-bottom: 0.1em;\r
+}\r
+\r
+tfoot {\r
+ font-weight: bold;\r
+}\r
+td > div.verse {\r
+ white-space: pre;\r
+}\r
+\r
+div.hdlist {\r
+ margin-top: 0.8em;\r
+ margin-bottom: 0.8em;\r
+}\r
+div.hdlist tr {\r
+ padding-bottom: 15px;\r
+}\r
+dt.hdlist1.strong, td.hdlist1.strong {\r
+ font-weight: bold;\r
+}\r
+td.hdlist1 {\r
+ vertical-align: top;\r
+ font-style: normal;\r
+ padding-right: 0.8em;\r
+ color: navy;\r
+}\r
+td.hdlist2 {\r
+ vertical-align: top;\r
+}\r
+div.hdlist.compact tr {\r
+ margin: 0;\r
+ padding-bottom: 0;\r
+}\r
+\r
+.comment {\r
+ background: yellow;\r
+}\r
+\r
+.footnote, .footnoteref {\r
+ font-size: 0.8em;\r
+}\r
+\r
+span.footnote, span.footnoteref {\r
+ vertical-align: super;\r
+}\r
+\r
+#footnotes {\r
+ margin: 20px 0 20px 0;\r
+ padding: 7px 0 0 0;\r
+}\r
+\r
+#footnotes div.footnote {\r
+ margin: 0 0 5px 0;\r
+}\r
+\r
+#footnotes hr {\r
+ border: none;\r
+ border-top: 1px solid silver;\r
+ height: 1px;\r
+ text-align: left;\r
+ margin-left: 0;\r
+ width: 20%;\r
+ min-width: 100px;\r
+}\r
+\r
+div.colist td {\r
+ padding-right: 0.5em;\r
+ padding-bottom: 0.3em;\r
+ vertical-align: top;\r
+}\r
+div.colist td img {\r
+ margin-top: 0.3em;\r
+}\r
+\r
+@media print {\r
+ #footer-badges { display: none; }\r
+}\r
+\r
+#toc {\r
+ margin-bottom: 2.5em;\r
+}\r
+\r
+#toctitle {\r
+ color: #527bbd;\r
+ font-size: 1.1em;\r
+ font-weight: bold;\r
+ margin-top: 1.0em;\r
+ margin-bottom: 0.1em;\r
+}\r
+\r
+div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {\r
+ margin-top: 0;\r
+ margin-bottom: 0;\r
+}\r
+div.toclevel2 {\r
+ margin-left: 2em;\r
+ font-size: 0.9em;\r
+}\r
+div.toclevel3 {\r
+ margin-left: 4em;\r
+ font-size: 0.9em;\r
+}\r
+div.toclevel4 {\r
+ margin-left: 6em;\r
+ font-size: 0.9em;\r
+}\r
+\r
+span.aqua { color: aqua; }\r
+span.black { color: black; }\r
+span.blue { color: blue; }\r
+span.fuchsia { color: fuchsia; }\r
+span.gray { color: gray; }\r
+span.green { color: green; }\r
+span.lime { color: lime; }\r
+span.maroon { color: maroon; }\r
+span.navy { color: navy; }\r
+span.olive { color: olive; }\r
+span.purple { color: purple; }\r
+span.red { color: red; }\r
+span.silver { color: silver; }\r
+span.teal { color: teal; }\r
+span.white { color: white; }\r
+span.yellow { color: yellow; }\r
+\r
+span.aqua-background { background: aqua; }\r
+span.black-background { background: black; }\r
+span.blue-background { background: blue; }\r
+span.fuchsia-background { background: fuchsia; }\r
+span.gray-background { background: gray; }\r
+span.green-background { background: green; }\r
+span.lime-background { background: lime; }\r
+span.maroon-background { background: maroon; }\r
+span.navy-background { background: navy; }\r
+span.olive-background { background: olive; }\r
+span.purple-background { background: purple; }\r
+span.red-background { background: red; }\r
+span.silver-background { background: silver; }\r
+span.teal-background { background: teal; }\r
+span.white-background { background: white; }\r
+span.yellow-background { background: yellow; }\r
+\r
+span.big { font-size: 2em; }\r
+span.small { font-size: 0.6em; }\r
+\r
+span.underline { text-decoration: underline; }\r
+span.overline { text-decoration: overline; }\r
+span.line-through { text-decoration: line-through; }\r
+\r
+\r
+/*\r
+ * xhtml11 specific\r
+ *\r
+ * */\r
+\r
+tt {\r
+ font-family: monospace;\r
+ font-size: inherit;\r
+ color: navy;\r
+}\r
+\r
+div.tableblock {\r
+ margin-top: 1.0em;\r
+ margin-bottom: 1.5em;\r
+}\r
+div.tableblock > table {\r
+ border: 3px solid #527bbd;\r
+}\r
+thead, p.table.header {\r
+ font-weight: bold;\r
+ color: #527bbd;\r
+}\r
+p.table {\r
+ margin-top: 0;\r
+}\r
+/* Because the table frame attribute is overriden by CSS in most browsers. */\r
+div.tableblock > table[frame="void"] {\r
+ border-style: none;\r
+}\r
+div.tableblock > table[frame="hsides"] {\r
+ border-left-style: none;\r
+ border-right-style: none;\r
+}\r
+div.tableblock > table[frame="vsides"] {\r
+ border-top-style: none;\r
+ border-bottom-style: none;\r
+}\r
+\r
+\r
+/*\r
+ * html5 specific\r
+ *\r
+ * */\r
+\r
+.monospaced {\r
+ font-family: monospace;\r
+ font-size: inherit;\r
+ color: navy;\r
+}\r
+\r
+table.tableblock {\r
+ margin-top: 1.0em;\r
+ margin-bottom: 1.5em;\r
+}\r
+thead, p.tableblock.header {\r
+ font-weight: bold;\r
+ color: #527bbd;\r
+}\r
+p.tableblock {\r
+ margin-top: 0;\r
+}\r
+table.tableblock {\r
+ border-width: 3px;\r
+ border-spacing: 0px;\r
+ border-style: solid;\r
+ border-color: #527bbd;\r
+ border-collapse: collapse;\r
+}\r
+th.tableblock, td.tableblock {\r
+ border-width: 1px;\r
+ padding: 4px;\r
+ border-style: solid;\r
+ border-color: #527bbd;\r
+}\r
+\r
+table.tableblock.frame-topbot {\r
+ border-left-style: hidden;\r
+ border-right-style: hidden;\r
+}\r
+table.tableblock.frame-sides {\r
+ border-top-style: hidden;\r
+ border-bottom-style: hidden;\r
+}\r
+table.tableblock.frame-none {\r
+ border-style: hidden;\r
+}\r
+\r
+th.tableblock.halign-left, td.tableblock.halign-left {\r
+ text-align: left;\r
+}\r
+th.tableblock.halign-center, td.tableblock.halign-center {\r
+ text-align: center;\r
+}\r
+th.tableblock.halign-right, td.tableblock.halign-right {\r
+ text-align: right;\r
+}\r
+\r
+th.tableblock.valign-top, td.tableblock.valign-top {\r
+ vertical-align: top;\r
+}\r
+th.tableblock.valign-middle, td.tableblock.valign-middle {\r
+ vertical-align: middle;\r
+}\r
+th.tableblock.valign-bottom, td.tableblock.valign-bottom {\r
+ vertical-align: bottom;\r
+}\r
+\r
+\r
+/*\r
+ * manpage specific\r
+ *\r
+ * */\r
+\r
+body.manpage h1 {\r
+ padding-top: 0.5em;\r
+ padding-bottom: 0.5em;\r
+ border-top: 2px solid silver;\r
+ border-bottom: 2px solid silver;\r
+}\r
+body.manpage h2 {\r
+ border-style: none;\r
+}\r
+body.manpage div.sectionbody {\r
+ margin-left: 3em;\r
+}\r
+\r
+@media print {\r
+ body.manpage div#toc { display: none; }\r
+}\r
+</style>\r
+<script type="text/javascript">\r
+/*<+'])');\r
+ // Function that scans the DOM tree for header elements (the DOM2\r
+ // nodeIterator API would be a better technique but not supported by all\r
+ // browsers).\r
+ var iterate = function (el) {\r
+ for (var i = el.firstChild; i != null; i = i.nextSibling) {\r
+ if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {\r
+ var mo = re.exec(i.tagName);\r
+ if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {\r
+ result[result.length] = new TocEntry(i, getText(i), mo[1]-1);\r
+ }\r
+ iterate(i);\r
+ }\r
+ }\r
+ }\r
+ iterate(el);\r
+ return result;\r
+ }\r
+\r
+ var toc = document.getElementById("toc");\r
+ if (!toc) {\r
+ return;\r
+ }\r
+\r
+ // Delete existing TOC entries in case we're reloading the TOC.\r
+ var tocEntriesToRemove = [];\r
+ var i;\r
+ for (i = 0; i < toc.childNodes.length; i++) {\r
+ var entry = toc.childNodes[i];\r
+ if (entry.nodeName == 'div'\r
+ && entry.getAttribute("class")\r
+ && entry.getAttribute("class").match(/^toclevel/))\r
+ tocEntriesToRemove.push(entry);\r
+ }\r
+ for (i = 0; i < tocEntriesToRemove.length; i++) {\r
+ toc.removeChild(tocEntriesToRemove[i]);\r
+ }\r
+\r
+ // Rebuild TOC entries.\r
+ var entries = tocEntries(document.getElementById("content"), toclevels);\r
+ for (var i = 0; i < entries.length; ++i) {\r
+ var entry = entries[i];\r
+ if (entry.element.id == "")\r
+ entry.element.id = "_toc_" + i;\r
+ var a = document.createElement("a");\r
+ a.href = "#" + entry.element.id;\r
+ a.appendChild(document.createTextNode(entry.text));\r
+ var div = document.createElement("div");\r
+ div.appendChild(a);\r
+ div.className = "toclevel" + entry.toclevel;\r
+ toc.appendChild(div);\r
+ }\r
+ if (entries.length == 0)\r
+ toc.parentNode.removeChild(toc);\r
+},\r
+\r
+\r
+/////////////////////////////////////////////////////////////////////\r
+// Footnotes generator\r
+/////////////////////////////////////////////////////////////////////\r
+\r
+/* Based on footnote generation code from:\r
+ * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html\r
+ */\r
+\r
+footnotes: function () {\r
+ // Delete existing footnote entries in case we're reloading the footnodes.\r
+ var i;\r
+ var noteholder = document.getElementById("footnotes");\r
+ if (!noteholder) {\r
+ return;\r
+ }\r
+ var entriesToRemove = [];\r
+ for (i = 0; i < noteholder.childNodes.length; i++) {\r
+ var entry = noteholder.childNodes[i];\r
+ if (entry.nodeName == 'div' && entry.getAttribute("class") == "footnote")\r
+ entriesToRemove.push(entry);\r
+ }\r
+ for (i = 0; i < entriesToRemove.length; i++) {\r
+ noteholder.removeChild(entriesToRemove[i]);\r
+ }\r
+\r
+ // Rebuild footnote entries.\r
+ var cont = document.getElementById("content");\r
+ var spans = cont.getElementsByTagName("span");\r
+ var refs = {};\r
+ var n = 0;\r
+ for (i=0; i<spans.length; i++) {\r
+ if (spans[i].className == "footnote") {\r
+ n++;\r
+ var note = spans[i].getAttribute("data-note");\r
+ if (!note) {\r
+ // Use [\s\S] in place of . so multi-line matches work.\r
+ // Because JavaScript has no s (dotall) regex flag.\r
+ note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];\r
+ spans[i].innerHTML =\r
+ "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +\r
+ "' title='View footnote' class='footnote'>" + n + "</a>]";\r
+ spans[i].setAttribute("data-note", note);\r
+ }\r
+ noteholder.innerHTML +=\r
+ "<div class='footnote' id='_footnote_" + n + "'>" +\r
+ "<a href='#_footnoteref_" + n + "' title='Return to text'>" +\r
+ n + "</a>. " + note + "</div>";\r
+ var id =spans[i].getAttribute("id");\r
+ if (id != null) refs["#"+id] = n;\r
+ }\r
+ }\r
+ if (n == 0)\r
+ noteholder.parentNode.removeChild(noteholder);\r
+ else {\r
+ // Process footnoterefs.\r
+ for (i=0; i<spans.length; i++) {\r
+ if (spans[i].className == "footnoteref") {\r
+ var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");\r
+ href = href.match(/#.*/)[0]; // Because IE return full URL.\r
+ n = refs[href];\r
+ spans[i].innerHTML =\r
+ "[<a href='#_footnote_" + n +\r
+ "' title='View footnote' class='footnote'>" + n + "</a>]";\r
+ }\r
+ }\r
+ }\r
+},\r
+\r
+install: function(toclevels) {\r
+ var timerId;\r
+\r
+ function reinstall() {\r
+ asciidoc.footnotes();\r
+ if (toclevels) {\r
+ asciidoc.toc(toclevels);\r
+ }\r
+ }\r
+\r
+ function reinstallAndRemoveTimer() {\r
+ clearInterval(timerId);\r
+ reinstall();\r
+ }\r
+\r
+ timerId = setInterval(reinstall, 500);\r
+ if (document.addEventListener)\r
+ document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);\r
+ else\r
+ window.onload = reinstallAndRemoveTimer;\r
+}\r
+\r
+}\r
+asciidoc.install();\r
+/*]]>*/\r
+</script>\r
+</head>\r
+<body class="manpage">\r
+<div id="header">\r
+<h1>\r
+zmq_ctx_term(3) Manual Page\r
+</h1>\r
+<h2>NAME</h2>\r
+<div class="sectionbody">\r
+<p>zmq_ctx_term -\r
+ destroy a 0MQ context\r
+</p>\r
+</div>\r
+</div>\r
+<div id="content">\r
+<div class="sect1">\r
+<h2 id="_synopsis">SYNOPSIS</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p><strong>int zmq_ctx_term (void <em>*context</em>);</strong></p></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_description">DESCRIPTION</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>The <em>zmq_ctx_term()</em> function shall destroy the ØMQ context <em>context</em>.</p></div>\r
+<div class="paragraph"><p>Context termination is performed in the following steps:</p></div>\r
+<div class="olist arabic"><ol class="arabic">\r
+<li>\r
+<p>\r
+Any blocking operations currently in progress on sockets open within\r
+ <em>context</em> shall return immediately with an error code of ETERM. With the\r
+ exception of <em>zmq_close()</em>, any further operations on sockets open within\r
+ <em>context</em> shall fail with an error code of ETERM.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+After interrupting all blocking calls, <em>zmq_ctx_term()</em> shall <em>block</em> until the\r
+ following conditions are satisfied:\r
+</p>\r
+<div class="ulist"><ul>\r
+<li>\r
+<p>\r
+All sockets open within <em>context</em> have been closed with <em>zmq_close()</em>.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+For each socket within <em>context</em>, all messages sent by the application\r
+ with <em>zmq_send()</em> have either been physically transferred to a network\r
+ peer, or the socket’s linger period set with the <em>ZMQ_LINGER</em> socket\r
+ option has expired.\r
+</p>\r
+</li>\r
+</ul></div>\r
+</li>\r
+</ol></div>\r
+<div class="paragraph"><p>For further details regarding socket linger behavior refer to the <em>ZMQ_LINGER</em>\r
+option in <a href="zmq_setsockopt.html">zmq_setsockopt(3)</a>.</p></div>\r
+<div class="paragraph"><p>This function replaces the deprecated function <a href="zmq_term.html">zmq_term(3)</a>.</p></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_return_value">RETURN VALUE</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>The <em>zmq_ctx_term()</em> function shall return zero if successful. Otherwise\r
+it shall return <tt>-1</tt> and set <em>errno</em> to one of the values defined below.</p></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_errors">ERRORS</h2>\r
+<div class="sectionbody">\r
+<div class="dlist"><dl>\r
+<dt class="hdlist1">\r
+<strong>EFAULT</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+The provided <em>context</em> was invalid.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>EINTR</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+Termination was interrupted by a signal. It can be restarted if needed.\r
+</p>\r
+</dd>\r
+</dl></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_see_also">SEE ALSO</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p><a href="zmq.html">zmq(7)</a>\r
+<a href="zmq_init.html">zmq_init(3)</a>\r
+<a href="zmq_close.html">zmq_close(3)</a>\r
+<a href="zmq_setsockopt.html">zmq_setsockopt(3)</a></p></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_authors">AUTHORS</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
+</div>\r
+</div>\r
+</div>\r
+<div id="footnotes"><hr /></div>\r
+<div id="footer">\r
+<div id="footer-text">\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
+</div>\r
+</div>\r
+</body>\r
+</html>\r
--- /dev/null
+zmq_ctx_term(3)
+===============
+
+
+NAME
+----
+zmq_ctx_term - destroy a 0MQ context
+
+
+SYNOPSIS
+--------
+*int zmq_ctx_term (void '*context');*
+
+
+DESCRIPTION
+-----------
+The _zmq_ctx_term()_ function shall destroy the 0MQ context 'context'.
+
+Context termination is performed in the following steps:
+
+1. Any blocking operations currently in progress on sockets open within
+ 'context' shall return immediately with an error code of ETERM. With the
+ exception of _zmq_close()_, any further operations on sockets open within
+ 'context' shall fail with an error code of ETERM.
+
+2. After interrupting all blocking calls, _zmq_ctx_term()_ shall _block_ until the
+ following conditions are satisfied:
+
+ * All sockets open within 'context' have been closed with _zmq_close()_.
+
+ * For each socket within 'context', all messages sent by the application
+ with _zmq_send()_ have either been physically transferred to a network
+ peer, or the socket's linger period set with the _ZMQ_LINGER_ socket
+ option has expired.
+
+For further details regarding socket linger behavior refer to the _ZMQ_LINGER_
+option in linkzmq:zmq_setsockopt[3].
+
+This function replaces the deprecated function linkzmq:zmq_term[3].
+
+
+RETURN VALUE
+------------
+The _zmq_ctx_term()_ function shall return zero if successful. Otherwise
+it shall return `-1` and set 'errno' to one of the values defined below.
+
+
+ERRORS
+------
+*EFAULT*::
+The provided 'context' was invalid.
+*EINTR*::
+Termination was interrupted by a signal. It can be restarted if needed.
+
+
+SEE ALSO
+--------
+linkzmq:zmq[7]
+linkzmq:zmq_init[3]
+linkzmq:zmq_close[3]
+linkzmq:zmq_setsockopt[3]
+
+
+AUTHORS
+-------
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
--- /dev/null
+'\" t
+.\" Title: zmq_curve
+.\" Author: [see the "AUTHORS" section]
+.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
+.\" Date: 03/10/2014
+.\" Manual: 0MQ Manual
+.\" Source: 0MQ 4.0.1
+.\" Language: English
+.\"
+.TH "ZMQ_CURVE" "7" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+zmq_curve \- secure authentication and confidentiality
+.SH "SYNOPSIS"
+.sp
+The CURVE mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server\&. CURVE is intended for use on public networks\&. The CURVE mechanism is defined by this document: \m[blue]\fBhttp://rfc\&.zeromq\&.org/spec:25\fR\m[]\&.
+.SH "CLIENT AND SERVER ROLES"
+.sp
+A socket using CURVE can be either client or server, at any moment, but not both\&. The role is independent of bind/connect direction\&.
+.sp
+A socket can change roles at any point by setting new options\&. The role affects all zmq_connect and zmq_bind calls that follow it\&.
+.sp
+To become a CURVE server, the application sets the ZMQ_CURVE_SERVER option on the socket, and then sets the ZMQ_CURVE_SECRETKEY option to provide the socket with its long\-term secret key\&. The application does not provide the socket with its long\-term public key, which is used only by clients\&.
+.sp
+To become a CURVE client, the application sets the ZMQ_CURVE_SERVERKEY option with the long\-term public key of the server it intends to connect to, or accept connections from, next\&. The application then sets the ZMQ_CURVE_PUBLICKEY and ZMQ_CURVE_SECRETKEY options with its client long\-term key pair\&.
+.sp
+If the server does authentication it will be based on the client\(cqs long term public key\&.
+.SH "KEY ENCODING"
+.sp
+The standard representation for keys in source code is either 32 bytes of base 256 (binary) data, or 40 characters of base 85 data encoded using the Z85 algorithm defined by \m[blue]\fBhttp://rfc\&.zeromq\&.org/spec:32\fR\m[]\&.
+.sp
+The Z85 algorithm is designed to produce printable key strings for use in configuration files, the command line, and code\&. There is a reference implementation in C at \m[blue]\fBhttps://github\&.com/zeromq/rfc/tree/master/src\fR\m[]\&.
+.SH "TEST KEY VALUES"
+.sp
+For test cases, the client shall use this long\-term key pair (specified as hexadecimal and in Z85):
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+public:
+ BB88471D65E2659B30C55A5321CEBB5AAB2B70A398645C26DCA2B2FCB43FC518
+ Yne@$w\-vo<fVvi]a<NY6T1ed:M$fCG*[IaLV{hID
+
+secret:
+ 7BB864B489AFA3671FBE69101F94B38972F24816DFB01B51656B3FEC8DFD0888
+ D:)Q[IlAW!ahhC2ac:9*A}h:p?([4%wOTJ%JR%cs
+.fi
+.if n \{\
+.RE
+.\}
+.sp
+And the server shall use this long\-term key pair (specified as hexadecimal and in Z85):
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+public:
+ 54FCBA24E93249969316FB617C872BB0C1D1FF14800427C594CBFACF1BC2D652
+ rq:rM>}U?@Lns47E1%kR\&.o@n%FcmmsL/@{H8]yf7
+
+secret:
+ 8E0BDD697628B91D8F245587EE95C5B04D48963F79259877B49CD9063AEAD3B7
+ JTKVSB%%)wK0E\&.X)V>+}o?pNmC{O&4W4b!Ni{Lh6
+.fi
+.if n \{\
+.RE
+.\}
+.SH "SEE ALSO"
+.sp
+\fBzmq_z85_encode\fR(3) \fBzmq_z85_decode\fR(3) \fBzmq_setsockopt\fR(3) \fBzmq_null\fR(7) \fBzmq_plain\fR(7) \fBzmq\fR(7)
+.SH "AUTHORS"
+.sp
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"\r
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">\r
+<head>\r
+<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />\r
+<meta name="generator" content="AsciiDoc 8.6.6" />\r
+<title>zmq_curve(7)</title>\r
+<style type="text/css">\r
+/* Shared CSS for AsciiDoc xhtml11 and html5 backends */\r
+\r
+/* Default font. */\r
+body {\r
+ font-family: Georgia,serif;\r
+}\r
+\r
+/* Title font. */\r
+h1, h2, h3, h4, h5, h6,\r
+div.title, caption.title,\r
+thead, p.table.header,\r
+#toctitle,\r
+#author, #revnumber, #revdate, #revremark,\r
+#footer {\r
+ font-family: Arial,Helvetica,sans-serif;\r
+}\r
+\r
+body {\r
+ margin: 1em 5% 1em 5%;\r
+}\r
+\r
+a {\r
+ color: blue;\r
+ text-decoration: underline;\r
+}\r
+a:visited {\r
+ color: fuchsia;\r
+}\r
+\r
+em {\r
+ font-style: italic;\r
+ color: navy;\r
+}\r
+\r
+strong {\r
+ font-weight: bold;\r
+ color: #083194;\r
+}\r
+\r
+h1, h2, h3, h4, h5, h6 {\r
+ color: #527bbd;\r
+ margin-top: 1.2em;\r
+ margin-bottom: 0.5em;\r
+ line-height: 1.3;\r
+}\r
+\r
+h1, h2, h3 {\r
+ border-bottom: 2px solid silver;\r
+}\r
+h2 {\r
+ padding-top: 0.5em;\r
+}\r
+h3 {\r
+ float: left;\r
+}\r
+h3 + * {\r
+ clear: left;\r
+}\r
+h5 {\r
+ font-size: 1.0em;\r
+}\r
+\r
+div.sectionbody {\r
+ margin-left: 0;\r
+}\r
+\r
+hr {\r
+ border: 1px solid silver;\r
+}\r
+\r
+p {\r
+ margin-top: 0.5em;\r
+ margin-bottom: 0.5em;\r
+}\r
+\r
+ul, ol, li > p {\r
+ margin-top: 0;\r
+}\r
+ul > li { color: #aaa; }\r
+ul > li > * { color: black; }\r
+\r
+pre {\r
+ padding: 0;\r
+ margin: 0;\r
+}\r
+\r
+#author {\r
+ color: #527bbd;\r
+ font-weight: bold;\r
+ font-size: 1.1em;\r
+}\r
+#email {\r
+}\r
+#revnumber, #revdate, #revremark {\r
+}\r
+\r
+#footer {\r
+ font-size: small;\r
+ border-top: 2px solid silver;\r
+ padding-top: 0.5em;\r
+ margin-top: 4.0em;\r
+}\r
+#footer-text {\r
+ float: left;\r
+ padding-bottom: 0.5em;\r
+}\r
+#footer-badges {\r
+ float: right;\r
+ padding-bottom: 0.5em;\r
+}\r
+\r
+#preamble {\r
+ margin-top: 1.5em;\r
+ margin-bottom: 1.5em;\r
+}\r
+div.imageblock, div.exampleblock, div.verseblock,\r
+div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,\r
+div.admonitionblock {\r
+ margin-top: 1.0em;\r
+ margin-bottom: 1.5em;\r
+}\r
+div.admonitionblock {\r
+ margin-top: 2.0em;\r
+ margin-bottom: 2.0em;\r
+ margin-right: 10%;\r
+ color: #606060;\r
+}\r
+\r
+div.content { /* Block element content. */\r
+ padding: 0;\r
+}\r
+\r
+/* Block element titles. */\r
+div.title, caption.title {\r
+ color: #527bbd;\r
+ font-weight: bold;\r
+ text-align: left;\r
+ margin-top: 1.0em;\r
+ margin-bottom: 0.5em;\r
+}\r
+div.title + * {\r
+ margin-top: 0;\r
+}\r
+\r
+td div.title:first-child {\r
+ margin-top: 0.0em;\r
+}\r
+div.content div.title:first-child {\r
+ margin-top: 0.0em;\r
+}\r
+div.content + div.title {\r
+ margin-top: 0.0em;\r
+}\r
+\r
+div.sidebarblock > div.content {\r
+ background: #ffffee;\r
+ border: 1px solid #dddddd;\r
+ border-left: 4px solid #f0f0f0;\r
+ padding: 0.5em;\r
+}\r
+\r
+div.listingblock > div.content {\r
+ border: 1px solid #dddddd;\r
+ border-left: 5px solid #f0f0f0;\r
+ background: #f8f8f8;\r
+ padding: 0.5em;\r
+}\r
+\r
+div.quoteblock, div.verseblock {\r
+ padding-left: 1.0em;\r
+ margin-left: 1.0em;\r
+ margin-right: 10%;\r
+ border-left: 5px solid #f0f0f0;\r
+ color: #888;\r
+}\r
+\r
+div.quoteblock > div.attribution {\r
+ padding-top: 0.5em;\r
+ text-align: right;\r
+}\r
+\r
+div.verseblock > pre.content {\r
+ font-family: inherit;\r
+ font-size: inherit;\r
+}\r
+div.verseblock > div.attribution {\r
+ padding-top: 0.75em;\r
+ text-align: left;\r
+}\r
+/* DEPRECATED: Pre version 8.2.7 verse style literal block. */\r
+div.verseblock + div.attribution {\r
+ text-align: left;\r
+}\r
+\r
+div.admonitionblock .icon {\r
+ vertical-align: top;\r
+ font-size: 1.1em;\r
+ font-weight: bold;\r
+ text-decoration: underline;\r
+ color: #527bbd;\r
+ padding-right: 0.5em;\r
+}\r
+div.admonitionblock td.content {\r
+ padding-left: 0.5em;\r
+ border-left: 3px solid #dddddd;\r
+}\r
+\r
+div.exampleblock > div.content {\r
+ border-left: 3px solid #dddddd;\r
+ padding-left: 0.5em;\r
+}\r
+\r
+div.imageblock div.content { padding-left: 0; }\r
+span.image img { border-style: none; }\r
+a.image:visited { color: white; }\r
+\r
+dl {\r
+ margin-top: 0.8em;\r
+ margin-bottom: 0.8em;\r
+}\r
+dt {\r
+ margin-top: 0.5em;\r
+ margin-bottom: 0;\r
+ font-style: normal;\r
+ color: navy;\r
+}\r
+dd > *:first-child {\r
+ margin-top: 0.1em;\r
+}\r
+\r
+ul, ol {\r
+ list-style-position: outside;\r
+}\r
+ol.arabic {\r
+ list-style-type: decimal;\r
+}\r
+ol.loweralpha {\r
+ list-style-type: lower-alpha;\r
+}\r
+ol.upperalpha {\r
+ list-style-type: upper-alpha;\r
+}\r
+ol.lowerroman {\r
+ list-style-type: lower-roman;\r
+}\r
+ol.upperroman {\r
+ list-style-type: upper-roman;\r
+}\r
+\r
+div.compact ul, div.compact ol,\r
+div.compact p, div.compact p,\r
+div.compact div, div.compact div {\r
+ margin-top: 0.1em;\r
+ margin-bottom: 0.1em;\r
+}\r
+\r
+tfoot {\r
+ font-weight: bold;\r
+}\r
+td > div.verse {\r
+ white-space: pre;\r
+}\r
+\r
+div.hdlist {\r
+ margin-top: 0.8em;\r
+ margin-bottom: 0.8em;\r
+}\r
+div.hdlist tr {\r
+ padding-bottom: 15px;\r
+}\r
+dt.hdlist1.strong, td.hdlist1.strong {\r
+ font-weight: bold;\r
+}\r
+td.hdlist1 {\r
+ vertical-align: top;\r
+ font-style: normal;\r
+ padding-right: 0.8em;\r
+ color: navy;\r
+}\r
+td.hdlist2 {\r
+ vertical-align: top;\r
+}\r
+div.hdlist.compact tr {\r
+ margin: 0;\r
+ padding-bottom: 0;\r
+}\r
+\r
+.comment {\r
+ background: yellow;\r
+}\r
+\r
+.footnote, .footnoteref {\r
+ font-size: 0.8em;\r
+}\r
+\r
+span.footnote, span.footnoteref {\r
+ vertical-align: super;\r
+}\r
+\r
+#footnotes {\r
+ margin: 20px 0 20px 0;\r
+ padding: 7px 0 0 0;\r
+}\r
+\r
+#footnotes div.footnote {\r
+ margin: 0 0 5px 0;\r
+}\r
+\r
+#footnotes hr {\r
+ border: none;\r
+ border-top: 1px solid silver;\r
+ height: 1px;\r
+ text-align: left;\r
+ margin-left: 0;\r
+ width: 20%;\r
+ min-width: 100px;\r
+}\r
+\r
+div.colist td {\r
+ padding-right: 0.5em;\r
+ padding-bottom: 0.3em;\r
+ vertical-align: top;\r
+}\r
+div.colist td img {\r
+ margin-top: 0.3em;\r
+}\r
+\r
+@media print {\r
+ #footer-badges { display: none; }\r
+}\r
+\r
+#toc {\r
+ margin-bottom: 2.5em;\r
+}\r
+\r
+#toctitle {\r
+ color: #527bbd;\r
+ font-size: 1.1em;\r
+ font-weight: bold;\r
+ margin-top: 1.0em;\r
+ margin-bottom: 0.1em;\r
+}\r
+\r
+div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {\r
+ margin-top: 0;\r
+ margin-bottom: 0;\r
+}\r
+div.toclevel2 {\r
+ margin-left: 2em;\r
+ font-size: 0.9em;\r
+}\r
+div.toclevel3 {\r
+ margin-left: 4em;\r
+ font-size: 0.9em;\r
+}\r
+div.toclevel4 {\r
+ margin-left: 6em;\r
+ font-size: 0.9em;\r
+}\r
+\r
+span.aqua { color: aqua; }\r
+span.black { color: black; }\r
+span.blue { color: blue; }\r
+span.fuchsia { color: fuchsia; }\r
+span.gray { color: gray; }\r
+span.green { color: green; }\r
+span.lime { color: lime; }\r
+span.maroon { color: maroon; }\r
+span.navy { color: navy; }\r
+span.olive { color: olive; }\r
+span.purple { color: purple; }\r
+span.red { color: red; }\r
+span.silver { color: silver; }\r
+span.teal { color: teal; }\r
+span.white { color: white; }\r
+span.yellow { color: yellow; }\r
+\r
+span.aqua-background { background: aqua; }\r
+span.black-background { background: black; }\r
+span.blue-background { background: blue; }\r
+span.fuchsia-background { background: fuchsia; }\r
+span.gray-background { background: gray; }\r
+span.green-background { background: green; }\r
+span.lime-background { background: lime; }\r
+span.maroon-background { background: maroon; }\r
+span.navy-background { background: navy; }\r
+span.olive-background { background: olive; }\r
+span.purple-background { background: purple; }\r
+span.red-background { background: red; }\r
+span.silver-background { background: silver; }\r
+span.teal-background { background: teal; }\r
+span.white-background { background: white; }\r
+span.yellow-background { background: yellow; }\r
+\r
+span.big { font-size: 2em; }\r
+span.small { font-size: 0.6em; }\r
+\r
+span.underline { text-decoration: underline; }\r
+span.overline { text-decoration: overline; }\r
+span.line-through { text-decoration: line-through; }\r
+\r
+\r
+/*\r
+ * xhtml11 specific\r
+ *\r
+ * */\r
+\r
+tt {\r
+ font-family: monospace;\r
+ font-size: inherit;\r
+ color: navy;\r
+}\r
+\r
+div.tableblock {\r
+ margin-top: 1.0em;\r
+ margin-bottom: 1.5em;\r
+}\r
+div.tableblock > table {\r
+ border: 3px solid #527bbd;\r
+}\r
+thead, p.table.header {\r
+ font-weight: bold;\r
+ color: #527bbd;\r
+}\r
+p.table {\r
+ margin-top: 0;\r
+}\r
+/* Because the table frame attribute is overriden by CSS in most browsers. */\r
+div.tableblock > table[frame="void"] {\r
+ border-style: none;\r
+}\r
+div.tableblock > table[frame="hsides"] {\r
+ border-left-style: none;\r
+ border-right-style: none;\r
+}\r
+div.tableblock > table[frame="vsides"] {\r
+ border-top-style: none;\r
+ border-bottom-style: none;\r
+}\r
+\r
+\r
+/*\r
+ * html5 specific\r
+ *\r
+ * */\r
+\r
+.monospaced {\r
+ font-family: monospace;\r
+ font-size: inherit;\r
+ color: navy;\r
+}\r
+\r
+table.tableblock {\r
+ margin-top: 1.0em;\r
+ margin-bottom: 1.5em;\r
+}\r
+thead, p.tableblock.header {\r
+ font-weight: bold;\r
+ color: #527bbd;\r
+}\r
+p.tableblock {\r
+ margin-top: 0;\r
+}\r
+table.tableblock {\r
+ border-width: 3px;\r
+ border-spacing: 0px;\r
+ border-style: solid;\r
+ border-color: #527bbd;\r
+ border-collapse: collapse;\r
+}\r
+th.tableblock, td.tableblock {\r
+ border-width: 1px;\r
+ padding: 4px;\r
+ border-style: solid;\r
+ border-color: #527bbd;\r
+}\r
+\r
+table.tableblock.frame-topbot {\r
+ border-left-style: hidden;\r
+ border-right-style: hidden;\r
+}\r
+table.tableblock.frame-sides {\r
+ border-top-style: hidden;\r
+ border-bottom-style: hidden;\r
+}\r
+table.tableblock.frame-none {\r
+ border-style: hidden;\r
+}\r
+\r
+th.tableblock.halign-left, td.tableblock.halign-left {\r
+ text-align: left;\r
+}\r
+th.tableblock.halign-center, td.tableblock.halign-center {\r
+ text-align: center;\r
+}\r
+th.tableblock.halign-right, td.tableblock.halign-right {\r
+ text-align: right;\r
+}\r
+\r
+th.tableblock.valign-top, td.tableblock.valign-top {\r
+ vertical-align: top;\r
+}\r
+th.tableblock.valign-middle, td.tableblock.valign-middle {\r
+ vertical-align: middle;\r
+}\r
+th.tableblock.valign-bottom, td.tableblock.valign-bottom {\r
+ vertical-align: bottom;\r
+}\r
+\r
+\r
+/*\r
+ * manpage specific\r
+ *\r
+ * */\r
+\r
+body.manpage h1 {\r
+ padding-top: 0.5em;\r
+ padding-bottom: 0.5em;\r
+ border-top: 2px solid silver;\r
+ border-bottom: 2px solid silver;\r
+}\r
+body.manpage h2 {\r
+ border-style: none;\r
+}\r
+body.manpage div.sectionbody {\r
+ margin-left: 3em;\r
+}\r
+\r
+@media print {\r
+ body.manpage div#toc { display: none; }\r
+}\r
+</style>\r
+<script type="text/javascript">\r
+/*<+'])');\r
+ // Function that scans the DOM tree for header elements (the DOM2\r
+ // nodeIterator API would be a better technique but not supported by all\r
+ // browsers).\r
+ var iterate = function (el) {\r
+ for (var i = el.firstChild; i != null; i = i.nextSibling) {\r
+ if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {\r
+ var mo = re.exec(i.tagName);\r
+ if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {\r
+ result[result.length] = new TocEntry(i, getText(i), mo[1]-1);\r
+ }\r
+ iterate(i);\r
+ }\r
+ }\r
+ }\r
+ iterate(el);\r
+ return result;\r
+ }\r
+\r
+ var toc = document.getElementById("toc");\r
+ if (!toc) {\r
+ return;\r
+ }\r
+\r
+ // Delete existing TOC entries in case we're reloading the TOC.\r
+ var tocEntriesToRemove = [];\r
+ var i;\r
+ for (i = 0; i < toc.childNodes.length; i++) {\r
+ var entry = toc.childNodes[i];\r
+ if (entry.nodeName == 'div'\r
+ && entry.getAttribute("class")\r
+ && entry.getAttribute("class").match(/^toclevel/))\r
+ tocEntriesToRemove.push(entry);\r
+ }\r
+ for (i = 0; i < tocEntriesToRemove.length; i++) {\r
+ toc.removeChild(tocEntriesToRemove[i]);\r
+ }\r
+\r
+ // Rebuild TOC entries.\r
+ var entries = tocEntries(document.getElementById("content"), toclevels);\r
+ for (var i = 0; i < entries.length; ++i) {\r
+ var entry = entries[i];\r
+ if (entry.element.id == "")\r
+ entry.element.id = "_toc_" + i;\r
+ var a = document.createElement("a");\r
+ a.href = "#" + entry.element.id;\r
+ a.appendChild(document.createTextNode(entry.text));\r
+ var div = document.createElement("div");\r
+ div.appendChild(a);\r
+ div.className = "toclevel" + entry.toclevel;\r
+ toc.appendChild(div);\r
+ }\r
+ if (entries.length == 0)\r
+ toc.parentNode.removeChild(toc);\r
+},\r
+\r
+\r
+/////////////////////////////////////////////////////////////////////\r
+// Footnotes generator\r
+/////////////////////////////////////////////////////////////////////\r
+\r
+/* Based on footnote generation code from:\r
+ * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html\r
+ */\r
+\r
+footnotes: function () {\r
+ // Delete existing footnote entries in case we're reloading the footnodes.\r
+ var i;\r
+ var noteholder = document.getElementById("footnotes");\r
+ if (!noteholder) {\r
+ return;\r
+ }\r
+ var entriesToRemove = [];\r
+ for (i = 0; i < noteholder.childNodes.length; i++) {\r
+ var entry = noteholder.childNodes[i];\r
+ if (entry.nodeName == 'div' && entry.getAttribute("class") == "footnote")\r
+ entriesToRemove.push(entry);\r
+ }\r
+ for (i = 0; i < entriesToRemove.length; i++) {\r
+ noteholder.removeChild(entriesToRemove[i]);\r
+ }\r
+\r
+ // Rebuild footnote entries.\r
+ var cont = document.getElementById("content");\r
+ var spans = cont.getElementsByTagName("span");\r
+ var refs = {};\r
+ var n = 0;\r
+ for (i=0; i<spans.length; i++) {\r
+ if (spans[i].className == "footnote") {\r
+ n++;\r
+ var note = spans[i].getAttribute("data-note");\r
+ if (!note) {\r
+ // Use [\s\S] in place of . so multi-line matches work.\r
+ // Because JavaScript has no s (dotall) regex flag.\r
+ note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];\r
+ spans[i].innerHTML =\r
+ "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +\r
+ "' title='View footnote' class='footnote'>" + n + "</a>]";\r
+ spans[i].setAttribute("data-note", note);\r
+ }\r
+ noteholder.innerHTML +=\r
+ "<div class='footnote' id='_footnote_" + n + "'>" +\r
+ "<a href='#_footnoteref_" + n + "' title='Return to text'>" +\r
+ n + "</a>. " + note + "</div>";\r
+ var id =spans[i].getAttribute("id");\r
+ if (id != null) refs["#"+id] = n;\r
+ }\r
+ }\r
+ if (n == 0)\r
+ noteholder.parentNode.removeChild(noteholder);\r
+ else {\r
+ // Process footnoterefs.\r
+ for (i=0; i<spans.length; i++) {\r
+ if (spans[i].className == "footnoteref") {\r
+ var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");\r
+ href = href.match(/#.*/)[0]; // Because IE return full URL.\r
+ n = refs[href];\r
+ spans[i].innerHTML =\r
+ "[<a href='#_footnote_" + n +\r
+ "' title='View footnote' class='footnote'>" + n + "</a>]";\r
+ }\r
+ }\r
+ }\r
+},\r
+\r
+install: function(toclevels) {\r
+ var timerId;\r
+\r
+ function reinstall() {\r
+ asciidoc.footnotes();\r
+ if (toclevels) {\r
+ asciidoc.toc(toclevels);\r
+ }\r
+ }\r
+\r
+ function reinstallAndRemoveTimer() {\r
+ clearInterval(timerId);\r
+ reinstall();\r
+ }\r
+\r
+ timerId = setInterval(reinstall, 500);\r
+ if (document.addEventListener)\r
+ document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);\r
+ else\r
+ window.onload = reinstallAndRemoveTimer;\r
+}\r
+\r
+}\r
+asciidoc.install();\r
+/*]]>*/\r
+</script>\r
+</head>\r
+<body class="manpage">\r
+<div id="header">\r
+<h1>\r
+zmq_curve(7) Manual Page\r
+</h1>\r
+<h2>NAME</h2>\r
+<div class="sectionbody">\r
+<p>zmq_curve -\r
+ secure authentication and confidentiality\r
+</p>\r
+</div>\r
+</div>\r
+<div id="content">\r
+<div class="sect1">\r
+<h2 id="_synopsis">SYNOPSIS</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>The CURVE mechanism defines a mechanism for secure authentication and\r
+confidentiality for communications between a client and a server. CURVE\r
+is intended for use on public networks. The CURVE mechanism is defined\r
+by this document: <a href="http://rfc.zeromq.org/spec:25">http://rfc.zeromq.org/spec:25</a>.</p></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_client_and_server_roles">CLIENT AND SERVER ROLES</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>A socket using CURVE can be either client or server, at any moment, but\r
+not both. The role is independent of bind/connect direction.</p></div>\r
+<div class="paragraph"><p>A socket can change roles at any point by setting new options. The role\r
+affects all zmq_connect and zmq_bind calls that follow it.</p></div>\r
+<div class="paragraph"><p>To become a CURVE server, the application sets the ZMQ_CURVE_SERVER option\r
+on the socket, and then sets the ZMQ_CURVE_SECRETKEY option to provide the\r
+socket with its long-term secret key. The application does not provide the\r
+socket with its long-term public key, which is used only by clients.</p></div>\r
+<div class="paragraph"><p>To become a CURVE client, the application sets the ZMQ_CURVE_SERVERKEY\r
+option with the long-term public key of the server it intends to connect\r
+to, or accept connections from, next. The application then sets the\r
+ZMQ_CURVE_PUBLICKEY and ZMQ_CURVE_SECRETKEY options with its client\r
+long-term key pair.</p></div>\r
+<div class="paragraph"><p>If the server does authentication it will be based on the client’s long\r
+term public key.</p></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_key_encoding">KEY ENCODING</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>The standard representation for keys in source code is either 32 bytes of\r
+base 256 (binary) data, or 40 characters of base 85 data encoded using the\r
+Z85 algorithm defined by <a href="http://rfc.zeromq.org/spec:32">http://rfc.zeromq.org/spec:32</a>.</p></div>\r
+<div class="paragraph"><p>The Z85 algorithm is designed to produce printable key strings for use in\r
+configuration files, the command line, and code. There is a reference\r
+implementation in C at <a href="https://github.com/zeromq/rfc/tree/master/src">https://github.com/zeromq/rfc/tree/master/src</a>.</p></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_test_key_values">TEST KEY VALUES</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>For test cases, the client shall use this long-term key pair (specified\r
+as hexadecimal and in Z85):</p></div>\r
+<div class="listingblock">\r
+<div class="content">\r
+<pre><tt>public:\r
+ BB88471D65E2659B30C55A5321CEBB5AAB2B70A398645C26DCA2B2FCB43FC518\r
+ Yne@$w-vo<fVvi]a<NY6T1ed:M$fCG*[IaLV{hID\r
+\r
+secret:\r
+ 7BB864B489AFA3671FBE69101F94B38972F24816DFB01B51656B3FEC8DFD0888\r
+ D:)Q[IlAW!ahhC2ac:9*A}h:p?([4%wOTJ%JR%cs</tt></pre>\r
+</div></div>\r
+<div class="paragraph"><p>And the server shall use this long-term key pair (specified as hexadecimal\r
+and in Z85):</p></div>\r
+<div class="listingblock">\r
+<div class="content">\r
+<pre><tt>public:\r
+ 54FCBA24E93249969316FB617C872BB0C1D1FF14800427C594CBFACF1BC2D652\r
+ rq:rM>}U?@Lns47E1%kR.o@n%FcmmsL/@{H8]yf7\r
+\r
+secret:\r
+ 8E0BDD697628B91D8F245587EE95C5B04D48963F79259877B49CD9063AEAD3B7\r
+ JTKVSB%%)wK0E.X)V>+}o?pNmC{O&4W4b!Ni{Lh6</tt></pre>\r
+</div></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_see_also">SEE ALSO</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p><a href="zmq_z85_encode.html">zmq_z85_encode(3)</a>\r
+<a href="zmq_z85_decode.html">zmq_z85_decode(3)</a>\r
+<a href="zmq_setsockopt.html">zmq_setsockopt(3)</a>\r
+<a href="zmq_null.html">zmq_null(7)</a>\r
+<a href="zmq_plain.html">zmq_plain(7)</a>\r
+<a href="zmq.html">zmq(7)</a></p></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_authors">AUTHORS</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
+</div>\r
+</div>\r
+</div>\r
+<div id="footnotes"><hr /></div>\r
+<div id="footer">\r
+<div id="footer-text">\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
+</div>\r
+</div>\r
+</body>\r
+</html>\r
--- /dev/null
+zmq_curve(7)
+============
+
+
+NAME
+----
+zmq_curve - secure authentication and confidentiality
+
+
+SYNOPSIS
+--------
+The CURVE mechanism defines a mechanism for secure authentication and
+confidentiality for communications between a client and a server. CURVE
+is intended for use on public networks. The CURVE mechanism is defined
+by this document: <http://rfc.zeromq.org/spec:25>.
+
+
+CLIENT AND SERVER ROLES
+-----------------------
+A socket using CURVE can be either client or server, at any moment, but
+not both. The role is independent of bind/connect direction.
+
+A socket can change roles at any point by setting new options. The role
+affects all zmq_connect and zmq_bind calls that follow it.
+
+To become a CURVE server, the application sets the ZMQ_CURVE_SERVER option
+on the socket, and then sets the ZMQ_CURVE_SECRETKEY option to provide the
+socket with its long-term secret key. The application does not provide the
+socket with its long-term public key, which is used only by clients.
+
+To become a CURVE client, the application sets the ZMQ_CURVE_SERVERKEY
+option with the long-term public key of the server it intends to connect
+to, or accept connections from, next. The application then sets the
+ZMQ_CURVE_PUBLICKEY and ZMQ_CURVE_SECRETKEY options with its client
+long-term key pair.
+
+If the server does authentication it will be based on the client's long
+term public key.
+
+KEY ENCODING
+------------
+The standard representation for keys in source code is either 32 bytes of
+base 256 (binary) data, or 40 characters of base 85 data encoded using the
+Z85 algorithm defined by http://rfc.zeromq.org/spec:32.
+
+The Z85 algorithm is designed to produce printable key strings for use in
+configuration files, the command line, and code. There is a reference
+implementation in C at https://github.com/zeromq/rfc/tree/master/src.
+
+
+TEST KEY VALUES
+---------------
+For test cases, the client shall use this long-term key pair (specified
+as hexadecimal and in Z85):
+
+----
+public:
+ BB88471D65E2659B30C55A5321CEBB5AAB2B70A398645C26DCA2B2FCB43FC518
+ Yne@$w-vo<fVvi]a<NY6T1ed:M$fCG*[IaLV{hID
+
+secret:
+ 7BB864B489AFA3671FBE69101F94B38972F24816DFB01B51656B3FEC8DFD0888
+ D:)Q[IlAW!ahhC2ac:9*A}h:p?([4%wOTJ%JR%cs
+----
+
+And the server shall use this long-term key pair (specified as hexadecimal
+and in Z85):
+
+----
+public:
+ 54FCBA24E93249969316FB617C872BB0C1D1FF14800427C594CBFACF1BC2D652
+ rq:rM>}U?@Lns47E1%kR.o@n%FcmmsL/@{H8]yf7
+
+secret:
+ 8E0BDD697628B91D8F245587EE95C5B04D48963F79259877B49CD9063AEAD3B7
+ JTKVSB%%)wK0E.X)V>+}o?pNmC{O&4W4b!Ni{Lh6
+----
+
+SEE ALSO
+--------
+linkzmq:zmq_z85_encode[3]
+linkzmq:zmq_z85_decode[3]
+linkzmq:zmq_setsockopt[3]
+linkzmq:zmq_null[7]
+linkzmq:zmq_plain[7]
+linkzmq:zmq[7]
+
+
+AUTHORS
+-------
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
--- /dev/null
+'\" t
+.\" Title: zmq_curve_keypair
+.\" Author: [see the "AUTHORS" section]
+.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
+.\" Date: 03/10/2014
+.\" Manual: 0MQ Manual
+.\" Source: 0MQ 4.0.1
+.\" Language: English
+.\"
+.TH "ZMQ_CURVE_KEYPAIR" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+zmq_curve_keypair \- generate a new CURVE keypair
+.SH "SYNOPSIS"
+.sp
+\fBint zmq_curve_keypair (char *z85_public_key, char *z85_secret_key);\fR
+.SH "DESCRIPTION"
+.sp
+The \fIzmq_curve_keypair()\fR function shall return a newly generated random keypair consisting of a public key and a secret key\&. The caller provides two buffers, each at least 41 octets large, in which this method will store the keys\&. The keys are encoded using \fBzmq_z85_encode\fR(3)\&.
+.SH "RETURN VALUE"
+.sp
+The \fIzmq_curve_keypair()\fR function shall return 0 if successful, else it shall return \-1 and set \fIerrno\fR to one of the values defined below\&.
+.SH "ERRORS"
+.PP
+\fBENOTSUP\fR
+.RS 4
+The libzmq library was not built with cryptographic support (libsodium)\&.
+.RE
+.SH "EXAMPLE"
+.PP
+\fBGenerating a new CURVE keypair\fR.
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+char public_key [41];
+char secret_key [41];
+int rc = crypto_box_keypair (public_key, secret_key);
+assert (rc == 0);
+.fi
+.if n \{\
+.RE
+.\}
+.sp
+.SH "SEE ALSO"
+.sp
+\fBzmq_z85_decode\fR(3) \fBzmq_z85_encode\fR(3) \fBzmq_curve\fR(7)
+.SH "AUTHORS"
+.sp
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"\r
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">\r
+<head>\r
+<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />\r
+<meta name="generator" content="AsciiDoc 8.6.6" />\r
+<title>zmq_curve_keypair(3)</title>\r
+<style type="text/css">\r
+/* Shared CSS for AsciiDoc xhtml11 and html5 backends */\r
+\r
+/* Default font. */\r
+body {\r
+ font-family: Georgia,serif;\r
+}\r
+\r
+/* Title font. */\r
+h1, h2, h3, h4, h5, h6,\r
+div.title, caption.title,\r
+thead, p.table.header,\r
+#toctitle,\r
+#author, #revnumber, #revdate, #revremark,\r
+#footer {\r
+ font-family: Arial,Helvetica,sans-serif;\r
+}\r
+\r
+body {\r
+ margin: 1em 5% 1em 5%;\r
+}\r
+\r
+a {\r
+ color: blue;\r
+ text-decoration: underline;\r
+}\r
+a:visited {\r
+ color: fuchsia;\r
+}\r
+\r
+em {\r
+ font-style: italic;\r
+ color: navy;\r
+}\r
+\r
+strong {\r
+ font-weight: bold;\r
+ color: #083194;\r
+}\r
+\r
+h1, h2, h3, h4, h5, h6 {\r
+ color: #527bbd;\r
+ margin-top: 1.2em;\r
+ margin-bottom: 0.5em;\r
+ line-height: 1.3;\r
+}\r
+\r
+h1, h2, h3 {\r
+ border-bottom: 2px solid silver;\r
+}\r
+h2 {\r
+ padding-top: 0.5em;\r
+}\r
+h3 {\r
+ float: left;\r
+}\r
+h3 + * {\r
+ clear: left;\r
+}\r
+h5 {\r
+ font-size: 1.0em;\r
+}\r
+\r
+div.sectionbody {\r
+ margin-left: 0;\r
+}\r
+\r
+hr {\r
+ border: 1px solid silver;\r
+}\r
+\r
+p {\r
+ margin-top: 0.5em;\r
+ margin-bottom: 0.5em;\r
+}\r
+\r
+ul, ol, li > p {\r
+ margin-top: 0;\r
+}\r
+ul > li { color: #aaa; }\r
+ul > li > * { color: black; }\r
+\r
+pre {\r
+ padding: 0;\r
+ margin: 0;\r
+}\r
+\r
+#author {\r
+ color: #527bbd;\r
+ font-weight: bold;\r
+ font-size: 1.1em;\r
+}\r
+#email {\r
+}\r
+#revnumber, #revdate, #revremark {\r
+}\r
+\r
+#footer {\r
+ font-size: small;\r
+ border-top: 2px solid silver;\r
+ padding-top: 0.5em;\r
+ margin-top: 4.0em;\r
+}\r
+#footer-text {\r
+ float: left;\r
+ padding-bottom: 0.5em;\r
+}\r
+#footer-badges {\r
+ float: right;\r
+ padding-bottom: 0.5em;\r
+}\r
+\r
+#preamble {\r
+ margin-top: 1.5em;\r
+ margin-bottom: 1.5em;\r
+}\r
+div.imageblock, div.exampleblock, div.verseblock,\r
+div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,\r
+div.admonitionblock {\r
+ margin-top: 1.0em;\r
+ margin-bottom: 1.5em;\r
+}\r
+div.admonitionblock {\r
+ margin-top: 2.0em;\r
+ margin-bottom: 2.0em;\r
+ margin-right: 10%;\r
+ color: #606060;\r
+}\r
+\r
+div.content { /* Block element content. */\r
+ padding: 0;\r
+}\r
+\r
+/* Block element titles. */\r
+div.title, caption.title {\r
+ color: #527bbd;\r
+ font-weight: bold;\r
+ text-align: left;\r
+ margin-top: 1.0em;\r
+ margin-bottom: 0.5em;\r
+}\r
+div.title + * {\r
+ margin-top: 0;\r
+}\r
+\r
+td div.title:first-child {\r
+ margin-top: 0.0em;\r
+}\r
+div.content div.title:first-child {\r
+ margin-top: 0.0em;\r
+}\r
+div.content + div.title {\r
+ margin-top: 0.0em;\r
+}\r
+\r
+div.sidebarblock > div.content {\r
+ background: #ffffee;\r
+ border: 1px solid #dddddd;\r
+ border-left: 4px solid #f0f0f0;\r
+ padding: 0.5em;\r
+}\r
+\r
+div.listingblock > div.content {\r
+ border: 1px solid #dddddd;\r
+ border-left: 5px solid #f0f0f0;\r
+ background: #f8f8f8;\r
+ padding: 0.5em;\r
+}\r
+\r
+div.quoteblock, div.verseblock {\r
+ padding-left: 1.0em;\r
+ margin-left: 1.0em;\r
+ margin-right: 10%;\r
+ border-left: 5px solid #f0f0f0;\r
+ color: #888;\r
+}\r
+\r
+div.quoteblock > div.attribution {\r
+ padding-top: 0.5em;\r
+ text-align: right;\r
+}\r
+\r
+div.verseblock > pre.content {\r
+ font-family: inherit;\r
+ font-size: inherit;\r
+}\r
+div.verseblock > div.attribution {\r
+ padding-top: 0.75em;\r
+ text-align: left;\r
+}\r
+/* DEPRECATED: Pre version 8.2.7 verse style literal block. */\r
+div.verseblock + div.attribution {\r
+ text-align: left;\r
+}\r
+\r
+div.admonitionblock .icon {\r
+ vertical-align: top;\r
+ font-size: 1.1em;\r
+ font-weight: bold;\r
+ text-decoration: underline;\r
+ color: #527bbd;\r
+ padding-right: 0.5em;\r
+}\r
+div.admonitionblock td.content {\r
+ padding-left: 0.5em;\r
+ border-left: 3px solid #dddddd;\r
+}\r
+\r
+div.exampleblock > div.content {\r
+ border-left: 3px solid #dddddd;\r
+ padding-left: 0.5em;\r
+}\r
+\r
+div.imageblock div.content { padding-left: 0; }\r
+span.image img { border-style: none; }\r
+a.image:visited { color: white; }\r
+\r
+dl {\r
+ margin-top: 0.8em;\r
+ margin-bottom: 0.8em;\r
+}\r
+dt {\r
+ margin-top: 0.5em;\r
+ margin-bottom: 0;\r
+ font-style: normal;\r
+ color: navy;\r
+}\r
+dd > *:first-child {\r
+ margin-top: 0.1em;\r
+}\r
+\r
+ul, ol {\r
+ list-style-position: outside;\r
+}\r
+ol.arabic {\r
+ list-style-type: decimal;\r
+}\r
+ol.loweralpha {\r
+ list-style-type: lower-alpha;\r
+}\r
+ol.upperalpha {\r
+ list-style-type: upper-alpha;\r
+}\r
+ol.lowerroman {\r
+ list-style-type: lower-roman;\r
+}\r
+ol.upperroman {\r
+ list-style-type: upper-roman;\r
+}\r
+\r
+div.compact ul, div.compact ol,\r
+div.compact p, div.compact p,\r
+div.compact div, div.compact div {\r
+ margin-top: 0.1em;\r
+ margin-bottom: 0.1em;\r
+}\r
+\r
+tfoot {\r
+ font-weight: bold;\r
+}\r
+td > div.verse {\r
+ white-space: pre;\r
+}\r
+\r
+div.hdlist {\r
+ margin-top: 0.8em;\r
+ margin-bottom: 0.8em;\r
+}\r
+div.hdlist tr {\r
+ padding-bottom: 15px;\r
+}\r
+dt.hdlist1.strong, td.hdlist1.strong {\r
+ font-weight: bold;\r
+}\r
+td.hdlist1 {\r
+ vertical-align: top;\r
+ font-style: normal;\r
+ padding-right: 0.8em;\r
+ color: navy;\r
+}\r
+td.hdlist2 {\r
+ vertical-align: top;\r
+}\r
+div.hdlist.compact tr {\r
+ margin: 0;\r
+ padding-bottom: 0;\r
+}\r
+\r
+.comment {\r
+ background: yellow;\r
+}\r
+\r
+.footnote, .footnoteref {\r
+ font-size: 0.8em;\r
+}\r
+\r
+span.footnote, span.footnoteref {\r
+ vertical-align: super;\r
+}\r
+\r
+#footnotes {\r
+ margin: 20px 0 20px 0;\r
+ padding: 7px 0 0 0;\r
+}\r
+\r
+#footnotes div.footnote {\r
+ margin: 0 0 5px 0;\r
+}\r
+\r
+#footnotes hr {\r
+ border: none;\r
+ border-top: 1px solid silver;\r
+ height: 1px;\r
+ text-align: left;\r
+ margin-left: 0;\r
+ width: 20%;\r
+ min-width: 100px;\r
+}\r
+\r
+div.colist td {\r
+ padding-right: 0.5em;\r
+ padding-bottom: 0.3em;\r
+ vertical-align: top;\r
+}\r
+div.colist td img {\r
+ margin-top: 0.3em;\r
+}\r
+\r
+@media print {\r
+ #footer-badges { display: none; }\r
+}\r
+\r
+#toc {\r
+ margin-bottom: 2.5em;\r
+}\r
+\r
+#toctitle {\r
+ color: #527bbd;\r
+ font-size: 1.1em;\r
+ font-weight: bold;\r
+ margin-top: 1.0em;\r
+ margin-bottom: 0.1em;\r
+}\r
+\r
+div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {\r
+ margin-top: 0;\r
+ margin-bottom: 0;\r
+}\r
+div.toclevel2 {\r
+ margin-left: 2em;\r
+ font-size: 0.9em;\r
+}\r
+div.toclevel3 {\r
+ margin-left: 4em;\r
+ font-size: 0.9em;\r
+}\r
+div.toclevel4 {\r
+ margin-left: 6em;\r
+ font-size: 0.9em;\r
+}\r
+\r
+span.aqua { color: aqua; }\r
+span.black { color: black; }\r
+span.blue { color: blue; }\r
+span.fuchsia { color: fuchsia; }\r
+span.gray { color: gray; }\r
+span.green { color: green; }\r
+span.lime { color: lime; }\r
+span.maroon { color: maroon; }\r
+span.navy { color: navy; }\r
+span.olive { color: olive; }\r
+span.purple { color: purple; }\r
+span.red { color: red; }\r
+span.silver { color: silver; }\r
+span.teal { color: teal; }\r
+span.white { color: white; }\r
+span.yellow { color: yellow; }\r
+\r
+span.aqua-background { background: aqua; }\r
+span.black-background { background: black; }\r
+span.blue-background { background: blue; }\r
+span.fuchsia-background { background: fuchsia; }\r
+span.gray-background { background: gray; }\r
+span.green-background { background: green; }\r
+span.lime-background { background: lime; }\r
+span.maroon-background { background: maroon; }\r
+span.navy-background { background: navy; }\r
+span.olive-background { background: olive; }\r
+span.purple-background { background: purple; }\r
+span.red-background { background: red; }\r
+span.silver-background { background: silver; }\r
+span.teal-background { background: teal; }\r
+span.white-background { background: white; }\r
+span.yellow-background { background: yellow; }\r
+\r
+span.big { font-size: 2em; }\r
+span.small { font-size: 0.6em; }\r
+\r
+span.underline { text-decoration: underline; }\r
+span.overline { text-decoration: overline; }\r
+span.line-through { text-decoration: line-through; }\r
+\r
+\r
+/*\r
+ * xhtml11 specific\r
+ *\r
+ * */\r
+\r
+tt {\r
+ font-family: monospace;\r
+ font-size: inherit;\r
+ color: navy;\r
+}\r
+\r
+div.tableblock {\r
+ margin-top: 1.0em;\r
+ margin-bottom: 1.5em;\r
+}\r
+div.tableblock > table {\r
+ border: 3px solid #527bbd;\r
+}\r
+thead, p.table.header {\r
+ font-weight: bold;\r
+ color: #527bbd;\r
+}\r
+p.table {\r
+ margin-top: 0;\r
+}\r
+/* Because the table frame attribute is overriden by CSS in most browsers. */\r
+div.tableblock > table[frame="void"] {\r
+ border-style: none;\r
+}\r
+div.tableblock > table[frame="hsides"] {\r
+ border-left-style: none;\r
+ border-right-style: none;\r
+}\r
+div.tableblock > table[frame="vsides"] {\r
+ border-top-style: none;\r
+ border-bottom-style: none;\r
+}\r
+\r
+\r
+/*\r
+ * html5 specific\r
+ *\r
+ * */\r
+\r
+.monospaced {\r
+ font-family: monospace;\r
+ font-size: inherit;\r
+ color: navy;\r
+}\r
+\r
+table.tableblock {\r
+ margin-top: 1.0em;\r
+ margin-bottom: 1.5em;\r
+}\r
+thead, p.tableblock.header {\r
+ font-weight: bold;\r
+ color: #527bbd;\r
+}\r
+p.tableblock {\r
+ margin-top: 0;\r
+}\r
+table.tableblock {\r
+ border-width: 3px;\r
+ border-spacing: 0px;\r
+ border-style: solid;\r
+ border-color: #527bbd;\r
+ border-collapse: collapse;\r
+}\r
+th.tableblock, td.tableblock {\r
+ border-width: 1px;\r
+ padding: 4px;\r
+ border-style: solid;\r
+ border-color: #527bbd;\r
+}\r
+\r
+table.tableblock.frame-topbot {\r
+ border-left-style: hidden;\r
+ border-right-style: hidden;\r
+}\r
+table.tableblock.frame-sides {\r
+ border-top-style: hidden;\r
+ border-bottom-style: hidden;\r
+}\r
+table.tableblock.frame-none {\r
+ border-style: hidden;\r
+}\r
+\r
+th.tableblock.halign-left, td.tableblock.halign-left {\r
+ text-align: left;\r
+}\r
+th.tableblock.halign-center, td.tableblock.halign-center {\r
+ text-align: center;\r
+}\r
+th.tableblock.halign-right, td.tableblock.halign-right {\r
+ text-align: right;\r
+}\r
+\r
+th.tableblock.valign-top, td.tableblock.valign-top {\r
+ vertical-align: top;\r
+}\r
+th.tableblock.valign-middle, td.tableblock.valign-middle {\r
+ vertical-align: middle;\r
+}\r
+th.tableblock.valign-bottom, td.tableblock.valign-bottom {\r
+ vertical-align: bottom;\r
+}\r
+\r
+\r
+/*\r
+ * manpage specific\r
+ *\r
+ * */\r
+\r
+body.manpage h1 {\r
+ padding-top: 0.5em;\r
+ padding-bottom: 0.5em;\r
+ border-top: 2px solid silver;\r
+ border-bottom: 2px solid silver;\r
+}\r
+body.manpage h2 {\r
+ border-style: none;\r
+}\r
+body.manpage div.sectionbody {\r
+ margin-left: 3em;\r
+}\r
+\r
+@media print {\r
+ body.manpage div#toc { display: none; }\r
+}\r
+</style>\r
+<script type="text/javascript">\r
+/*<+'])');\r
+ // Function that scans the DOM tree for header elements (the DOM2\r
+ // nodeIterator API would be a better technique but not supported by all\r
+ // browsers).\r
+ var iterate = function (el) {\r
+ for (var i = el.firstChild; i != null; i = i.nextSibling) {\r
+ if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {\r
+ var mo = re.exec(i.tagName);\r
+ if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {\r
+ result[result.length] = new TocEntry(i, getText(i), mo[1]-1);\r
+ }\r
+ iterate(i);\r
+ }\r
+ }\r
+ }\r
+ iterate(el);\r
+ return result;\r
+ }\r
+\r
+ var toc = document.getElementById("toc");\r
+ if (!toc) {\r
+ return;\r
+ }\r
+\r
+ // Delete existing TOC entries in case we're reloading the TOC.\r
+ var tocEntriesToRemove = [];\r
+ var i;\r
+ for (i = 0; i < toc.childNodes.length; i++) {\r
+ var entry = toc.childNodes[i];\r
+ if (entry.nodeName == 'div'\r
+ && entry.getAttribute("class")\r
+ && entry.getAttribute("class").match(/^toclevel/))\r
+ tocEntriesToRemove.push(entry);\r
+ }\r
+ for (i = 0; i < tocEntriesToRemove.length; i++) {\r
+ toc.removeChild(tocEntriesToRemove[i]);\r
+ }\r
+\r
+ // Rebuild TOC entries.\r
+ var entries = tocEntries(document.getElementById("content"), toclevels);\r
+ for (var i = 0; i < entries.length; ++i) {\r
+ var entry = entries[i];\r
+ if (entry.element.id == "")\r
+ entry.element.id = "_toc_" + i;\r
+ var a = document.createElement("a");\r
+ a.href = "#" + entry.element.id;\r
+ a.appendChild(document.createTextNode(entry.text));\r
+ var div = document.createElement("div");\r
+ div.appendChild(a);\r
+ div.className = "toclevel" + entry.toclevel;\r
+ toc.appendChild(div);\r
+ }\r
+ if (entries.length == 0)\r
+ toc.parentNode.removeChild(toc);\r
+},\r
+\r
+\r
+/////////////////////////////////////////////////////////////////////\r
+// Footnotes generator\r
+/////////////////////////////////////////////////////////////////////\r
+\r
+/* Based on footnote generation code from:\r
+ * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html\r
+ */\r
+\r
+footnotes: function () {\r
+ // Delete existing footnote entries in case we're reloading the footnodes.\r
+ var i;\r
+ var noteholder = document.getElementById("footnotes");\r
+ if (!noteholder) {\r
+ return;\r
+ }\r
+ var entriesToRemove = [];\r
+ for (i = 0; i < noteholder.childNodes.length; i++) {\r
+ var entry = noteholder.childNodes[i];\r
+ if (entry.nodeName == 'div' && entry.getAttribute("class") == "footnote")\r
+ entriesToRemove.push(entry);\r
+ }\r
+ for (i = 0; i < entriesToRemove.length; i++) {\r
+ noteholder.removeChild(entriesToRemove[i]);\r
+ }\r
+\r
+ // Rebuild footnote entries.\r
+ var cont = document.getElementById("content");\r
+ var spans = cont.getElementsByTagName("span");\r
+ var refs = {};\r
+ var n = 0;\r
+ for (i=0; i<spans.length; i++) {\r
+ if (spans[i].className == "footnote") {\r
+ n++;\r
+ var note = spans[i].getAttribute("data-note");\r
+ if (!note) {\r
+ // Use [\s\S] in place of . so multi-line matches work.\r
+ // Because JavaScript has no s (dotall) regex flag.\r
+ note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];\r
+ spans[i].innerHTML =\r
+ "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +\r
+ "' title='View footnote' class='footnote'>" + n + "</a>]";\r
+ spans[i].setAttribute("data-note", note);\r
+ }\r
+ noteholder.innerHTML +=\r
+ "<div class='footnote' id='_footnote_" + n + "'>" +\r
+ "<a href='#_footnoteref_" + n + "' title='Return to text'>" +\r
+ n + "</a>. " + note + "</div>";\r
+ var id =spans[i].getAttribute("id");\r
+ if (id != null) refs["#"+id] = n;\r
+ }\r
+ }\r
+ if (n == 0)\r
+ noteholder.parentNode.removeChild(noteholder);\r
+ else {\r
+ // Process footnoterefs.\r
+ for (i=0; i<spans.length; i++) {\r
+ if (spans[i].className == "footnoteref") {\r
+ var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");\r
+ href = href.match(/#.*/)[0]; // Because IE return full URL.\r
+ n = refs[href];\r
+ spans[i].innerHTML =\r
+ "[<a href='#_footnote_" + n +\r
+ "' title='View footnote' class='footnote'>" + n + "</a>]";\r
+ }\r
+ }\r
+ }\r
+},\r
+\r
+install: function(toclevels) {\r
+ var timerId;\r
+\r
+ function reinstall() {\r
+ asciidoc.footnotes();\r
+ if (toclevels) {\r
+ asciidoc.toc(toclevels);\r
+ }\r
+ }\r
+\r
+ function reinstallAndRemoveTimer() {\r
+ clearInterval(timerId);\r
+ reinstall();\r
+ }\r
+\r
+ timerId = setInterval(reinstall, 500);\r
+ if (document.addEventListener)\r
+ document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);\r
+ else\r
+ window.onload = reinstallAndRemoveTimer;\r
+}\r
+\r
+}\r
+asciidoc.install();\r
+/*]]>*/\r
+</script>\r
+</head>\r
+<body class="manpage">\r
+<div id="header">\r
+<h1>\r
+zmq_curve_keypair(3) Manual Page\r
+</h1>\r
+<h2>NAME</h2>\r
+<div class="sectionbody">\r
+<p>zmq_curve_keypair -\r
+ generate a new CURVE keypair\r
+</p>\r
+</div>\r
+</div>\r
+<div id="content">\r
+<div class="sect1">\r
+<h2 id="_synopsis">SYNOPSIS</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p><strong>int zmq_curve_keypair (char *z85_public_key, char *z85_secret_key);</strong></p></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_description">DESCRIPTION</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>The <em>zmq_curve_keypair()</em> function shall return a newly generated random\r
+keypair consisting of a public key and a secret key. The caller provides\r
+two buffers, each at least 41 octets large, in which this method will\r
+store the keys. The keys are encoded using <a href="zmq_z85_encode.html">zmq_z85_encode(3)</a>.</p></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_return_value">RETURN VALUE</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>The <em>zmq_curve_keypair()</em> function shall return 0 if successful, else it\r
+shall return <tt>-1</tt> and set <em>errno</em> to one of the values defined below.</p></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_errors">ERRORS</h2>\r
+<div class="sectionbody">\r
+<div class="dlist"><dl>\r
+<dt class="hdlist1">\r
+<strong>ENOTSUP</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+The libzmq library was not built with cryptographic support (libsodium).\r
+</p>\r
+</dd>\r
+</dl></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_example">EXAMPLE</h2>\r
+<div class="sectionbody">\r
+<div class="listingblock">\r
+<div class="title">Generating a new CURVE keypair</div>\r
+<div class="content">\r
+<pre><tt>char public_key [41];\r
+char secret_key [41];\r
+int rc = crypto_box_keypair (public_key, secret_key);\r
+assert (rc == 0);</tt></pre>\r
+</div></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_see_also">SEE ALSO</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p><a href="zmq_z85_decode.html">zmq_z85_decode(3)</a>\r
+<a href="zmq_z85_encode.html">zmq_z85_encode(3)</a>\r
+<a href="zmq_curve.html">zmq_curve(7)</a></p></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_authors">AUTHORS</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
+</div>\r
+</div>\r
+</div>\r
+<div id="footnotes"><hr /></div>\r
+<div id="footer">\r
+<div id="footer-text">\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
+</div>\r
+</div>\r
+</body>\r
+</html>\r
--- /dev/null
+zmq_curve_keypair(3)
+====================
+
+
+NAME
+----
+zmq_curve_keypair - generate a new CURVE keypair
+
+
+SYNOPSIS
+--------
+*int zmq_curve_keypair (char *z85_public_key, char *z85_secret_key);*
+
+
+DESCRIPTION
+-----------
+The _zmq_curve_keypair()_ function shall return a newly generated random
+keypair consisting of a public key and a secret key. The caller provides
+two buffers, each at least 41 octets large, in which this method will
+store the keys. The keys are encoded using linkzmq:zmq_z85_encode[3].
+
+
+RETURN VALUE
+------------
+The _zmq_curve_keypair()_ function shall return 0 if successful, else it
+shall return `-1` and set 'errno' to one of the values defined below.
+
+
+ERRORS
+------
+*ENOTSUP*::
+The libzmq library was not built with cryptographic support (libsodium).
+
+
+EXAMPLE
+-------
+.Generating a new CURVE keypair
+----
+char public_key [41];
+char secret_key [41];
+int rc = crypto_box_keypair (public_key, secret_key);
+assert (rc == 0);
+----
+
+
+SEE ALSO
+--------
+linkzmq:zmq_z85_decode[3]
+linkzmq:zmq_z85_encode[3]
+linkzmq:zmq_curve[7]
+
+
+AUTHORS
+-------
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_disconnect
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.1
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_DISCONNECT" "3" "11/23/2012" "0MQ 3\&.2\&.1" "0MQ Manual"
+.TH "ZMQ_DISCONNECT" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
\fIsocket\fR
was invalid\&.
.RE
+.PP
+\fBENOENT\fR
+.RS 4
+The provided endpoint is not connected\&.
+.RE
.SH "EXAMPLE"
.PP
\fBConnecting a subscriber socket to an in-process and a TCP transport\fR.
\fBzmq_connect\fR(3) \fBzmq_socket\fR(3) \fBzmq\fR(7)
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Martin Sustrik <\m[blue]\fBsustrik@250bpm\&.com\fR\m[]\&\s-2\u[1]\d\s+2>, Martin Lucina <\m[blue]\fBmato@kotelna\&.sk\fR\m[]\&\s-2\u[2]\d\s+2> and Ian Barber <\m[blue]\fBian\&.barber@gmail\&.com\fR\m[]\&\s-2\u[3]\d\s+2>
-.SH "NOTES"
-.IP " 1." 4
-sustrik@250bpm.com
-.RS 4
-\%mailto:sustrik@250bpm.com
-.RE
-.IP " 2." 4
-mato@kotelna.sk
-.RS 4
-\%mailto:mato@kotelna.sk
-.RE
-.IP " 3." 4
-ian.barber@gmail.com
-.RS 4
-\%mailto:ian.barber@gmail.com
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
The provided <em>socket</em> was invalid.\r
</p>\r
</dd>\r
+<dt class="hdlist1">\r
+<strong>ENOENT</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+The provided endpoint is not connected.\r
+</p>\r
+</dd>\r
</dl></div>\r
</div>\r
</div>\r
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Martin Sustrik <<a href="mailto:sustrik@250bpm.com">sustrik@250bpm.com</a>>,\r
-Martin Lucina <<a href="mailto:mato@kotelna.sk">mato@kotelna.sk</a>> and Ian Barber <<a href="mailto:ian.barber@gmail.com">ian.barber@gmail.com</a>></p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-10-25 17:30:40 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
The 0MQ 'context' associated with the specified 'socket' was terminated.
*ENOTSOCK*::
The provided 'socket' was invalid.
+*ENOENT*::
+The provided endpoint is not connected.
EXAMPLE
AUTHORS
-------
-This 0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com>,
-Martin Lucina <mato@kotelna.sk> and Ian Barber <ian.barber@gmail.com>
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_pgm
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.2
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_PGM" "7" "11/23/2012" "0MQ 3\&.2\&.2" "0MQ Manual"
+.TH "ZMQ_PGM" "7" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.sp -1
.IP \(bu 2.3
.\}
-The primary IPv4 address assigned to the interface, in it\(cqs numeric representation\&.
+The primary IPv4 address assigned to the interface, in its numeric representation\&.
.RE
.if n \{\
.sp
.sp .5v
.RE
.sp
-A \fImulticast address\fR is specified by an IPv4 multicast address in it\(cqs numeric representation\&.
+A \fImulticast address\fR is specified by an IPv4 multicast address in its numeric representation\&.
.SH "WIRE FORMAT"
.sp
Consecutive PGM datagrams are interpreted by 0MQ as a single continuous stream of data where 0MQ messages are not necessarily aligned with PGM datagram boundaries and a single 0MQ message may span several PGM datagrams\&. This stream of data consists of 0MQ messages encapsulated in \fIframes\fR as described in \fBzmq_tcp\fR(7)\&.
\fBzmq_connect\fR(3) \fBzmq_setsockopt\fR(3) \fBzmq_tcp\fR(7) \fBzmq_ipc\fR(7) \fBzmq_inproc\fR(7) \fBzmq\fR(7)
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Pieter Hintjens <\m[blue]\fBph@imatix\&.com\fR\m[]\&\s-2\u[1]\d\s+2>, Martin Sustrik <\m[blue]\fBsustrik@250bpm\&.com\fR\m[]\&\s-2\u[2]\d\s+2> and Martin Lucina <\m[blue]\fBmato@kotelna\&.sk\fR\m[]\&\s-2\u[3]\d\s+2>\&.
-.SH "NOTES"
-.IP " 1." 4
-ph@imatix.com
-.RS 4
-\%mailto:ph@imatix.com
-.RE
-.IP " 2." 4
-sustrik@250bpm.com
-.RS 4
-\%mailto:sustrik@250bpm.com
-.RE
-.IP " 3." 4
-mato@kotelna.sk
-.RS 4
-\%mailto:mato@kotelna.sk
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
</li>\r
<li>\r
<p>\r
-The primary IPv4 address assigned to the interface, in it’s numeric\r
+The primary IPv4 address assigned to the interface, in its numeric\r
representation.\r
</p>\r
</li>\r
will be selected.</td>\r
</tr></table>\r
</div>\r
-<div class="paragraph"><p>A <em>multicast address</em> is specified by an IPv4 multicast address in it’s numeric\r
+<div class="paragraph"><p>A <em>multicast address</em> is specified by an IPv4 multicast address in its numeric\r
representation.</p></div>\r
</div>\r
</div>\r
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Pieter Hintjens <<a href="mailto:ph@imatix.com">ph@imatix.com</a>>,\r
-Martin Sustrik <<a href="mailto:sustrik@250bpm.com">sustrik@250bpm.com</a>> and Martin Lucina <<a href="mailto:mato@kotelna.sk">mato@kotelna.sk</a>>.</p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-11-14 10:09:14 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
An 'interface' may be specified by either of the following:
* The interface name as defined by the operating system.
-* The primary IPv4 address assigned to the interface, in it's numeric
+* The primary IPv4 address assigned to the interface, in its numeric
representation.
NOTE: Interface names are not standardised in any way and should be assumed to
'interface'. The 'interface' part can be omitted, in that case the default one
will be selected.
-A 'multicast address' is specified by an IPv4 multicast address in it's numeric
+A 'multicast address' is specified by an IPv4 multicast address in its numeric
representation.
linkzmq:zmq_inproc[7]
linkzmq:zmq[7]
+
AUTHORS
-------
-This 0MQ manual page was written by Pieter Hintjens <ph@imatix.com>,
-Martin Sustrik <sustrik@250bpm.com> and Martin Lucina <mato@kotelna.sk>.
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_errno
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.1
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_ERRNO" "3" "11/23/2012" "0MQ 3\&.2\&.1" "0MQ Manual"
+.TH "ZMQ_ERRNO" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
\fBzmq\fR(7)
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Martin Sustrik <\m[blue]\fBsustrik@250bpm\&.com\fR\m[]\&\s-2\u[1]\d\s+2> and Martin Lucina <\m[blue]\fBmato@kotelna\&.sk\fR\m[]\&\s-2\u[2]\d\s+2>\&.
-.SH "NOTES"
-.IP " 1." 4
-sustrik@250bpm.com
-.RS 4
-\%mailto:sustrik@250bpm.com
-.RE
-.IP " 2." 4
-mato@kotelna.sk
-.RS 4
-\%mailto:mato@kotelna.sk
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Martin Sustrik <<a href="mailto:sustrik@250bpm.com">sustrik@250bpm.com</a>> and\r
-Martin Lucina <<a href="mailto:mato@kotelna.sk">mato@kotelna.sk</a>>.</p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-10-25 17:30:40 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
AUTHORS
-------
-This 0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
-Martin Lucina <mato@kotelna.sk>.
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_getsockopt
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.2
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_GETSOCKOPT" "3" "11/23/2012" "0MQ 3\&.2\&.2" "0MQ Manual"
+.TH "ZMQ_GETSOCKOPT" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.sp 1
.SS "ZMQ_SNDHWM: Retrieves high water mark for outbound messages"
.sp
-The \fIZMQ_SNDHWM\fR option shall return the high water mark for outbound messages on the specified \fIsocket\fR\&. The high water mark is a hard limit on the maximum number of outstanding messages 0MQ shall queue in memory for any single peer that the specified \fIsocket\fR is communicating with\&.
+The \fIZMQ_SNDHWM\fR option shall return the high water mark for outbound messages on the specified \fIsocket\fR\&. The high water mark is a hard limit on the maximum number of outstanding messages 0MQ shall queue in memory for any single peer that the specified \fIsocket\fR is communicating with\&. A value of zero means no limit\&.
.sp
If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, 0MQ shall take appropriate action such as blocking or dropping sent messages\&. Refer to the individual socket descriptions in \fBzmq_socket\fR(3) for details on the exact action taken for each socket type\&.
.TS
.sp 1
.SS "ZMQ_RCVHWM: Retrieve high water mark for inbound messages"
.sp
-The \fIZMQ_RCVHWM\fR option shall return the high water mark for inbound messages on the specified \fIsocket\fR\&. The high water mark is a hard limit on the maximum number of outstanding messages 0MQ shall queue in memory for any single peer that the specified \fIsocket\fR is communicating with\&.
+The \fIZMQ_RCVHWM\fR option shall return the high water mark for inbound messages on the specified \fIsocket\fR\&. The high water mark is a hard limit on the maximum number of outstanding messages 0MQ shall queue in memory for any single peer that the specified \fIsocket\fR is communicating with\&. A value of zero means no limit\&.
.sp
If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, 0MQ shall take appropriate action such as blocking or dropping sent messages\&. Refer to the individual socket descriptions in \fBzmq_socket\fR(3) for details on the exact action taken for each socket type\&.
.TS
T}
.TE
.sp 1
-.SS "ZMQ_IDENTITY: Set socket identity"
+.SS "ZMQ_IDENTITY: Retrieve socket identity"
.sp
The \fIZMQ_IDENTITY\fR option shall retrieve the identity of the specified \fIsocket\fR\&. Socket identity is used only by request/reply pattern\&. Namely, it can be used in tandem with ROUTER socket to route messages to the peer with specific identity\&.
.sp
Applicable socket types
T}:T{
.sp
-all
+ZMQ_REP, ZMQ_REQ, ZMQ_ROUTER, ZMQ_DEALER\&.
T}
.TE
.sp 1
T}
.TE
.sp 1
+.SS "ZMQ_IPV6: Retrieve IPv6 socket status"
+.sp
+Retrieve the IPv6 option for the socket\&. A value of 1 means IPv6 is enabled on the socket, while 0 means the socket will use only IPv4\&. When IPv6 is enabled the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts\&.
+.TS
+tab(:);
+lt lt
+lt lt
+lt lt
+lt lt.
+T{
+.sp
+Option value type
+T}:T{
+.sp
+int
+T}
+T{
+.sp
+Option value unit
+T}:T{
+.sp
+boolean
+T}
+T{
+.sp
+Default value
+T}:T{
+.sp
+0 (false)
+T}
+T{
+.sp
+Applicable socket types
+T}:T{
+.sp
+all, when using TCP transports\&.
+T}
+.TE
+.sp 1
.SS "ZMQ_IPV4ONLY: Retrieve IPv4\-only socket override status"
.sp
-Retrieve the underlying native socket type\&. A value of 1 will use IPv4 sockets, while the value of 0 will use IPv6 sockets\&. An IPv6 socket lets applications connect to and accept connections from both IPv4 and IPv6 hosts\&.
+Retrieve the IPv4\-only option for the socket\&. This option is deprecated\&. Please use the ZMQ_IPV6 option\&.
.TS
tab(:);
lt lt
T}
.TE
.sp 1
-.SS "ZMQ_DELAY_ATTACH_ON_CONNECT: Retrieve attach\-on\-connect value"
+.SS "ZMQ_IMMEDIATE: Retrieve attach\-on\-connect value"
.sp
Retrieve the state of the attach on connect value\&. If set to 1, will delay the attachment of a pipe on connect until the underlying connection has completed\&. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection\&.
.TS
Option value type
T}:T{
.sp
-character string
+NULL\-terminated character string
T}
T{
.sp
.sp 1
.SS "ZMQ_TCP_KEEPALIVE_IDLE: Override TCP_KEEPCNT(or TCP_KEEPALIVE on some OS)"
.sp
-Override \fITCP_KEEPCNT\fR(or \fITCP_KEEPALIVE\fR on some OS) socket option(where supported by OS)\&. The default value of \-1 means to skip any overrides and leave it to OS default\&.
+Override \fITCP_KEEPCNT\fR(or \fITCP_KEEPALIVE\fR on some OS) socket option (where supported by OS)\&. The default value of \-1 means to skip any overrides and leave it to OS default\&.
.TS
tab(:);
lt lt
T}
.TE
.sp 1
+.SS "ZMQ_MECHANISM: Retrieve current security mechanism"
+.sp
+The \fIZMQ_MECHANISM\fR option shall retrieve the current security mechanism for the socket\&.
+.TS
+tab(:);
+lt lt
+lt lt
+lt lt
+lt lt.
+T{
+.sp
+Option value type
+T}:T{
+.sp
+int
+T}
+T{
+.sp
+Option value unit
+T}:T{
+.sp
+ZMQ_NULL, ZMQ_PLAIN, or ZMQ_CURVE
+T}
+T{
+.sp
+Default value
+T}:T{
+.sp
+ZMQ_NULL
+T}
+T{
+.sp
+Applicable socket types
+T}:T{
+.sp
+all, when using TCP or IPC transports
+T}
+.TE
+.sp 1
+.SS "ZMQ_PLAIN_SERVER: Retrieve current PLAIN server role"
+.sp
+Returns the \fIZMQ_PLAIN_SERVER\fR option, if any, previously set on the socket\&.
+.TS
+tab(:);
+lt lt
+lt lt
+lt lt
+lt lt.
+T{
+.sp
+Option value type
+T}:T{
+.sp
+int
+T}
+T{
+.sp
+Option value unit
+T}:T{
+.sp
+0, 1
+T}
+T{
+.sp
+Default value
+T}:T{
+.sp
+int
+T}
+T{
+.sp
+Applicable socket types
+T}:T{
+.sp
+all, when using TCP or IPC transports
+T}
+.TE
+.sp 1
+.SS "ZMQ_PLAIN_USERNAME: Retrieve current PLAIN username"
+.sp
+The \fIZMQ_PLAIN_USERNAME\fR option shall retrieve the last username set for the PLAIN security mechanism\&. The returned value shall be a NULL\-terminated string and MAY be empty\&. The returned size SHALL include the terminating null byte\&.
+.TS
+tab(:);
+lt lt
+lt lt
+lt lt
+lt lt.
+T{
+.sp
+Option value type
+T}:T{
+.sp
+NULL\-terminated character string
+T}
+T{
+.sp
+Option value unit
+T}:T{
+.sp
+N/A
+T}
+T{
+.sp
+Default value
+T}:T{
+.sp
+null string
+T}
+T{
+.sp
+Applicable socket types
+T}:T{
+.sp
+all, when using TCP or IPC transports
+T}
+.TE
+.sp 1
+.SS "ZMQ_PLAIN_PASSWORD: Retrieve current password"
+.sp
+The \fIZMQ_PLAIN_PASSWORD\fR option shall retrieve the last password set for the PLAIN security mechanism\&. The returned value shall be a NULL\-terminated string and MAY be empty\&. The returned size SHALL include the terminating null byte\&.
+.TS
+tab(:);
+lt lt
+lt lt
+lt lt
+lt lt.
+T{
+.sp
+Option value type
+T}:T{
+.sp
+NULL\-terminated character string
+T}
+T{
+.sp
+Option value unit
+T}:T{
+.sp
+N/A
+T}
+T{
+.sp
+Default value
+T}:T{
+.sp
+null string
+T}
+T{
+.sp
+Applicable socket types
+T}:T{
+.sp
+all, when using TCP or IPC transports
+T}
+.TE
+.sp 1
+.SS "ZMQ_CURVE_PUBLICKEY: Retrieve current CURVE public key"
+.sp
+Retrieves the current long term public key for the socket\&. You can provide either a 32 byte buffer, to retrieve the binary key value, or a 41 byte buffer, to retrieve the key in a printable Z85 format\&. NOTE: to fetch a printable key, the buffer must be 41 bytes large to hold the 40\-char key value and one null byte\&.
+.TS
+tab(:);
+lt lt
+lt lt
+lt lt
+lt lt.
+T{
+.sp
+Option value type
+T}:T{
+.sp
+binary data or Z85 text string
+T}
+T{
+.sp
+Option value size
+T}:T{
+.sp
+32 or 41
+T}
+T{
+.sp
+Default value
+T}:T{
+.sp
+null
+T}
+T{
+.sp
+Applicable socket types
+T}:T{
+.sp
+all, when using TCP transport
+T}
+.TE
+.sp 1
+.SS "ZMQ_CURVE_SECRETKEY: Retrieve current CURVE secret key"
+.sp
+Retrieves the current long term secret key for the socket\&. You can provide either a 32 byte buffer, to retrieve the binary key value, or a 41 byte buffer, to retrieve the key in a printable Z85 format\&.
+.TS
+tab(:);
+lt lt
+lt lt
+lt lt
+lt lt.
+T{
+.sp
+Option value type
+T}:T{
+.sp
+binary data or Z85 text string
+T}
+T{
+.sp
+Option value size
+T}:T{
+.sp
+32 or 41
+T}
+T{
+.sp
+Default value
+T}:T{
+.sp
+null
+T}
+T{
+.sp
+Applicable socket types
+T}:T{
+.sp
+all, when using TCP transport
+T}
+.TE
+.sp 1
+.SS "ZMQ_CURVE_SERVERKEY: Retrieve current CURVE server key"
+.sp
+Retrieves the current server key for the client socket\&. You can provide either a 32 byte buffer, to retrieve the binary key value, or a 40 byte buffer, to retrieve the key in a printable Z85 format\&.
+.TS
+tab(:);
+lt lt
+lt lt
+lt lt
+lt lt.
+T{
+.sp
+Option value type
+T}:T{
+.sp
+binary data or Z85 text string
+T}
+T{
+.sp
+Option value size
+T}:T{
+.sp
+32 or 41
+T}
+T{
+.sp
+Default value
+T}:T{
+.sp
+null
+T}
+T{
+.sp
+Applicable socket types
+T}:T{
+.sp
+all, when using TCP transport
+T}
+.TE
+.sp 1
+.SS "ZMQ_ZAP_DOMAIN: Retrieve RFC 27 authentication domain"
+.sp
+The \fIZMQ_ZAP_DOMAIN\fR option shall retrieve the last ZAP domain set for the socket\&. The returned value shall be a NULL\-terminated string and MAY be empty\&. The returned size SHALL include the terminating null byte\&.
+.TS
+tab(:);
+lt lt
+lt lt
+lt lt
+lt lt.
+T{
+.sp
+Option value type
+T}:T{
+.sp
+character string
+T}
+T{
+.sp
+Option value unit
+T}:T{
+.sp
+N/A
+T}
+T{
+.sp
+Default value
+T}:T{
+.sp
+not set
+T}
+T{
+.sp
+Applicable socket types
+T}:T{
+.sp
+all, when using TCP transport
+T}
+.TE
+.sp 1
.SH "RETURN VALUE"
.sp
The \fIzmq_getsockopt()\fR function shall return zero if successful\&. Otherwise it shall return \-1 and set \fIerrno\fR to one of the values defined below\&.
\fBzmq_setsockopt\fR(3) \fBzmq_socket\fR(3) \fBzmq\fR(7)
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Martin Sustrik <\m[blue]\fBsustrik@250bpm\&.com\fR\m[]\&\s-2\u[1]\d\s+2> and Martin Lucina <\m[blue]\fBmato@kotelna\&.sk\fR\m[]\&\s-2\u[2]\d\s+2>\&.
-.SH "NOTES"
-.IP " 1." 4
-sustrik@250bpm.com
-.RS 4
-\%mailto:sustrik@250bpm.com
-.RE
-.IP " 2." 4
-mato@kotelna.sk
-.RS 4
-\%mailto:mato@kotelna.sk
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
<div class="paragraph"><p>The <em>ZMQ_SNDHWM</em> option shall return the high water mark for outbound messages\r
on the specified <em>socket</em>. The high water mark is a hard limit on the maximum\r
number of outstanding messages ØMQ shall queue in memory for any single peer\r
-that the specified <em>socket</em> is communicating with.</p></div>\r
+that the specified <em>socket</em> is communicating with. A value of zero means no\r
+limit.</p></div>\r
<div class="paragraph"><p>If this limit has been reached the socket shall enter an exceptional state and\r
depending on the socket type, ØMQ shall take appropriate action such as\r
blocking or dropping sent messages. Refer to the individual socket descriptions\r
<div class="paragraph"><p>The <em>ZMQ_RCVHWM</em> option shall return the high water mark for inbound messages on\r
the specified <em>socket</em>. The high water mark is a hard limit on the maximum\r
number of outstanding messages ØMQ shall queue in memory for any single peer\r
-that the specified <em>socket</em> is communicating with.</p></div>\r
+that the specified <em>socket</em> is communicating with. A value of zero means no\r
+limit.</p></div>\r
<div class="paragraph"><p>If this limit has been reached the socket shall enter an exceptional state and\r
depending on the socket type, ØMQ shall take appropriate action such as\r
blocking or dropping sent messages. Refer to the individual socket descriptions\r
</table></div>\r
</div>\r
<div class="sect2">\r
-<h3 id="_zmq_identity_set_socket_identity">ZMQ_IDENTITY: Set socket identity</h3>\r
+<h3 id="_zmq_identity_retrieve_socket_identity">ZMQ_IDENTITY: Retrieve socket identity</h3>\r
<div class="paragraph"><p>The <em>ZMQ_IDENTITY</em> option shall retrieve the identity of the specified <em>socket</em>.\r
Socket identity is used only by request/reply pattern. Namely, it can be used\r
in tandem with ROUTER socket to route messages to the peer with specific\r
</td>\r
<td class="hdlist2">\r
<p style="margin-top: 0;">\r
-all\r
+ZMQ_REP, ZMQ_REQ, ZMQ_ROUTER, ZMQ_DEALER.\r
</p>\r
</td>\r
</tr>\r
</table></div>\r
</div>\r
<div class="sect2">\r
+<h3 id="_zmq_ipv6_retrieve_ipv6_socket_status">ZMQ_IPV6: Retrieve IPv6 socket status</h3>\r
+<div class="paragraph"><p>Retrieve the IPv6 option for the socket. A value of <tt>1</tt> means IPv6 is\r
+enabled on the socket, while <tt>0</tt> means the socket will use only IPv4.\r
+When IPv6 is enabled the socket will connect to, or accept connections\r
+from, both IPv4 and IPv6 hosts.</p></div>\r
+<div class="hdlist"><table>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value type\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+int\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value unit\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+boolean\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Default value\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+0 (false)\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Applicable socket types\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+all, when using TCP transports.\r
+</p>\r
+</td>\r
+</tr>\r
+</table></div>\r
+</div>\r
+<div class="sect2">\r
<h3 id="_zmq_ipv4only_retrieve_ipv4_only_socket_override_status">ZMQ_IPV4ONLY: Retrieve IPv4-only socket override status</h3>\r
-<div class="paragraph"><p>Retrieve the underlying native socket type. A value of <tt>1</tt> will use IPv4\r
-sockets, while the value of <tt>0</tt> will use IPv6 sockets. An IPv6 socket\r
-lets applications connect to and accept connections from both IPv4 and IPv6\r
-hosts.</p></div>\r
+<div class="paragraph"><p>Retrieve the IPv4-only option for the socket. This option is deprecated.\r
+Please use the ZMQ_IPV6 option.</p></div>\r
<div class="hdlist"><table>\r
<tr>\r
<td class="hdlist1">\r
</table></div>\r
</div>\r
<div class="sect2">\r
-<h3 id="_zmq_delay_attach_on_connect_retrieve_attach_on_connect_value">ZMQ_DELAY_ATTACH_ON_CONNECT: Retrieve attach-on-connect value</h3>\r
+<h3 id="_zmq_immediate_retrieve_attach_on_connect_value">ZMQ_IMMEDIATE: Retrieve attach-on-connect value</h3>\r
<div class="paragraph"><p>Retrieve the state of the attach on connect value. If set to <tt>1</tt>, will delay the\r
attachment of a pipe on connect until the underlying connection has completed.\r
This will cause the socket to block if there are no other connections, but will\r
</td>\r
<td class="hdlist2">\r
<p style="margin-top: 0;">\r
-character string\r
+NULL-terminated character string\r
</p>\r
</td>\r
</tr>\r
</div>\r
<div class="sect2">\r
<h3 id="_zmq_tcp_keepalive_idle_override_tcp_keepcnt_or_tcp_keepalive_on_some_os">ZMQ_TCP_KEEPALIVE_IDLE: Override TCP_KEEPCNT(or TCP_KEEPALIVE on some OS)</h3>\r
-<div class="paragraph"><p>Override <em>TCP_KEEPCNT</em>(or <em>TCP_KEEPALIVE</em> on some OS) socket option(where supported by OS).\r
-The default value of <tt>-1</tt> means to skip any overrides and leave it to OS default.</p></div>\r
+<div class="paragraph"><p>Override <em>TCP_KEEPCNT</em>(or <em>TCP_KEEPALIVE</em> on some OS) socket option (where\r
+supported by OS). The default value of <tt>-1</tt> means to skip any overrides and\r
+leave it to OS default.</p></div>\r
<div class="hdlist"><table>\r
<tr>\r
<td class="hdlist1">\r
</tr>\r
</table></div>\r
</div>\r
+<div class="sect2">\r
+<h3 id="_zmq_mechanism_retrieve_current_security_mechanism">ZMQ_MECHANISM: Retrieve current security mechanism</h3>\r
+<div class="paragraph"><p>The <em>ZMQ_MECHANISM</em> option shall retrieve the current security mechanism\r
+for the socket.</p></div>\r
+<div class="hdlist"><table>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value type\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+int\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value unit\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+ZMQ_NULL, ZMQ_PLAIN, or ZMQ_CURVE\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Default value\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+ZMQ_NULL\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Applicable socket types\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+all, when using TCP or IPC transports\r
+</p>\r
+</td>\r
+</tr>\r
+</table></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_zmq_plain_server_retrieve_current_plain_server_role">ZMQ_PLAIN_SERVER: Retrieve current PLAIN server role</h3>\r
+<div class="paragraph"><p>Returns the <em>ZMQ_PLAIN_SERVER</em> option, if any, previously set on the socket.</p></div>\r
+<div class="hdlist"><table>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value type\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+int\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value unit\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+0, 1\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Default value\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+int\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Applicable socket types\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+all, when using TCP or IPC transports\r
+</p>\r
+</td>\r
+</tr>\r
+</table></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_zmq_plain_username_retrieve_current_plain_username">ZMQ_PLAIN_USERNAME: Retrieve current PLAIN username</h3>\r
+<div class="paragraph"><p>The <em>ZMQ_PLAIN_USERNAME</em> option shall retrieve the last username set for\r
+the PLAIN security mechanism. The returned value shall be a NULL-terminated\r
+string and MAY be empty. The returned size SHALL include the terminating\r
+null byte.</p></div>\r
+<div class="hdlist"><table>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value type\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+NULL-terminated character string\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value unit\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+N/A\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Default value\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+null string\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Applicable socket types\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+all, when using TCP or IPC transports\r
+</p>\r
+</td>\r
+</tr>\r
+</table></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_zmq_plain_password_retrieve_current_password">ZMQ_PLAIN_PASSWORD: Retrieve current password</h3>\r
+<div class="paragraph"><p>The <em>ZMQ_PLAIN_PASSWORD</em> option shall retrieve the last password set for\r
+the PLAIN security mechanism. The returned value shall be a NULL-terminated\r
+string and MAY be empty. The returned size SHALL include the terminating\r
+null byte.</p></div>\r
+<div class="hdlist"><table>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value type\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+NULL-terminated character string\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value unit\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+N/A\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Default value\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+null string\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Applicable socket types\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+all, when using TCP or IPC transports\r
+</p>\r
+</td>\r
+</tr>\r
+</table></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_zmq_curve_publickey_retrieve_current_curve_public_key">ZMQ_CURVE_PUBLICKEY: Retrieve current CURVE public key</h3>\r
+<div class="paragraph"><p>Retrieves the current long term public key for the socket. You can\r
+provide either a 32 byte buffer, to retrieve the binary key value, or\r
+a 41 byte buffer, to retrieve the key in a printable Z85 format.\r
+NOTE: to fetch a printable key, the buffer must be 41 bytes large\r
+to hold the 40-char key value and one null byte.</p></div>\r
+<div class="hdlist"><table>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value type\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+binary data or Z85 text string\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value size\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+32 or 41\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Default value\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+null\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Applicable socket types\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+all, when using TCP transport\r
+</p>\r
+</td>\r
+</tr>\r
+</table></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_zmq_curve_secretkey_retrieve_current_curve_secret_key">ZMQ_CURVE_SECRETKEY: Retrieve current CURVE secret key</h3>\r
+<div class="paragraph"><p>Retrieves the current long term secret key for the socket. You can\r
+provide either a 32 byte buffer, to retrieve the binary key value, or\r
+a 41 byte buffer, to retrieve the key in a printable Z85 format.</p></div>\r
+<div class="hdlist"><table>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value type\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+binary data or Z85 text string\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value size\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+32 or 41\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Default value\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+null\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Applicable socket types\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+all, when using TCP transport\r
+</p>\r
+</td>\r
+</tr>\r
+</table></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_zmq_curve_serverkey_retrieve_current_curve_server_key">ZMQ_CURVE_SERVERKEY: Retrieve current CURVE server key</h3>\r
+<div class="paragraph"><p>Retrieves the current server key for the client socket. You can\r
+provide either a 32 byte buffer, to retrieve the binary key value, or\r
+a 40 byte buffer, to retrieve the key in a printable Z85 format.</p></div>\r
+<div class="hdlist"><table>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value type\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+binary data or Z85 text string\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value size\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+32 or 41\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Default value\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+null\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Applicable socket types\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+all, when using TCP transport\r
+</p>\r
+</td>\r
+</tr>\r
+</table></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_zmq_zap_domain_retrieve_rfc_27_authentication_domain">ZMQ_ZAP_DOMAIN: Retrieve RFC 27 authentication domain</h3>\r
+<div class="paragraph"><p>The <em>ZMQ_ZAP_DOMAIN</em> option shall retrieve the last ZAP domain set for\r
+the socket. The returned value shall be a NULL-terminated string and MAY\r
+be empty. The returned size SHALL include the terminating null byte.</p></div>\r
+<div class="hdlist"><table>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value type\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+character string\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value unit\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+N/A\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Default value\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+not set\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Applicable socket types\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+all, when using TCP transport\r
+</p>\r
+</td>\r
+</tr>\r
+</table></div>\r
+</div>\r
</div>\r
</div>\r
<div class="sect1">\r
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Martin Sustrik <<a href="mailto:sustrik@250bpm.com">sustrik@250bpm.com</a>> and\r
-Martin Lucina <<a href="mailto:mato@kotelna.sk">mato@kotelna.sk</a>>.</p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-11-14 10:09:14 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
The 'ZMQ_SNDHWM' option shall return the high water mark for outbound messages
on the specified 'socket'. The high water mark is a hard limit on the maximum
number of outstanding messages 0MQ shall queue in memory for any single peer
-that the specified 'socket' is communicating with.
+that the specified 'socket' is communicating with. A value of zero means no
+limit.
If this limit has been reached the socket shall enter an exceptional state and
depending on the socket type, 0MQ shall take appropriate action such as
The 'ZMQ_RCVHWM' option shall return the high water mark for inbound messages on
the specified 'socket'. The high water mark is a hard limit on the maximum
number of outstanding messages 0MQ shall queue in memory for any single peer
-that the specified 'socket' is communicating with.
+that the specified 'socket' is communicating with. A value of zero means no
+limit.
If this limit has been reached the socket shall enter an exceptional state and
depending on the socket type, 0MQ shall take appropriate action such as
Applicable socket types:: N/A
-ZMQ_IDENTITY: Set socket identity
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ZMQ_IDENTITY: Retrieve socket identity
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_IDENTITY' option shall retrieve the identity of the specified 'socket'.
Socket identity is used only by request/reply pattern. Namely, it can be used
in tandem with ROUTER socket to route messages to the peer with specific
Option value type:: binary data
Option value unit:: N/A
Default value:: NULL
-Applicable socket types:: all
+Applicable socket types:: ZMQ_REP, ZMQ_REQ, ZMQ_ROUTER, ZMQ_DEALER.
ZMQ_RATE: Retrieve multicast data rate
ZMQ_RECONNECT_IVL_MAX: Retrieve maximum reconnection interval
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-The 'ZMQ_RECONNECT_IVL_MAX' option shall retrieve the maximum reconnection
-interval for the specified 'socket'. This is the maximum period 0MQ shall wait
-between attempts to reconnect. On each reconnect attempt, the previous interval
-shall be doubled untill ZMQ_RECONNECT_IVL_MAX is reached. This allows for
-exponential backoff strategy. Default value means no exponential backoff is
+The 'ZMQ_RECONNECT_IVL_MAX' option shall retrieve the maximum reconnection
+interval for the specified 'socket'. This is the maximum period 0MQ shall wait
+between attempts to reconnect. On each reconnect attempt, the previous interval
+shall be doubled untill ZMQ_RECONNECT_IVL_MAX is reached. This allows for
+exponential backoff strategy. Default value means no exponential backoff is
performed and reconnect interval calculations are only based on
ZMQ_RECONNECT_IVL.
Applicable socket types:: all
+ZMQ_IPV6: Retrieve IPv6 socket status
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Retrieve the IPv6 option for the socket. A value of `1` means IPv6 is
+enabled on the socket, while `0` means the socket will use only IPv4.
+When IPv6 is enabled the socket will connect to, or accept connections
+from, both IPv4 and IPv6 hosts.
+
+[horizontal]
+Option value type:: int
+Option value unit:: boolean
+Default value:: 0 (false)
+Applicable socket types:: all, when using TCP transports.
+
+
ZMQ_IPV4ONLY: Retrieve IPv4-only socket override status
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Retrieve the underlying native socket type. A value of `1` will use IPv4
-sockets, while the value of `0` will use IPv6 sockets. An IPv6 socket
-lets applications connect to and accept connections from both IPv4 and IPv6
-hosts.
+Retrieve the IPv4-only option for the socket. This option is deprecated.
+Please use the ZMQ_IPV6 option.
[horizontal]
Option value type:: int
Applicable socket types:: all, when using TCP transports.
-ZMQ_DELAY_ATTACH_ON_CONNECT: Retrieve attach-on-connect value
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ZMQ_IMMEDIATE: Retrieve attach-on-connect value
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Retrieve the state of the attach on connect value. If set to `1`, will delay the
attachment of a pipe on connect until the underlying connection has completed.
This will cause the socket to block if there are no other connections, but will
written to, the underlying socket; applications must retrieve the actual event
state with a subsequent retrieval of the 'ZMQ_EVENTS' option.
-NOTE: The returned file descriptor is also used internally by the 'zmq_send'
-and 'zmq_recv' functions. As the descriptor is edge triggered, applications
-must update the state of 'ZMQ_EVENTS' after each invocation of 'zmq_send'
-or 'zmq_recv'.To be more explicit: after calling 'zmq_send' the socket may
-become readable (and vice versa) without triggering a read event on the
+NOTE: The returned file descriptor is also used internally by the 'zmq_send'
+and 'zmq_recv' functions. As the descriptor is edge triggered, applications
+must update the state of 'ZMQ_EVENTS' after each invocation of 'zmq_send'
+or 'zmq_recv'.To be more explicit: after calling 'zmq_send' the socket may
+become readable (and vice versa) without triggering a read event on the
file descriptor.
CAUTION: The returned file descriptor is intended for use with a 'poll' or
ZMQ_LAST_ENDPOINT: Retrieve the last endpoint set
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-The 'ZMQ_LAST_ENDPOINT' option shall retrieve the last endpoint bound for
+The 'ZMQ_LAST_ENDPOINT' option shall retrieve the last endpoint bound for
TCP and IPC transports. The returned value will be a string in the form of
a ZMQ DSN. Note that if the TCP host is INADDR_ANY, indicated by a *, then
the returned address will be 0.0.0.0 (for IPv4).
[horizontal]
-Option value type:: character string
+Option value type:: NULL-terminated character string
Option value unit:: N/A
Default value:: NULL
Applicable socket types:: all, when binding TCP or IPC transports
ZMQ_TCP_KEEPALIVE_IDLE: Override TCP_KEEPCNT(or TCP_KEEPALIVE on some OS)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Override 'TCP_KEEPCNT'(or 'TCP_KEEPALIVE' on some OS) socket option(where supported by OS).
-The default value of `-1` means to skip any overrides and leave it to OS default.
+Override 'TCP_KEEPCNT'(or 'TCP_KEEPALIVE' on some OS) socket option (where
+supported by OS). The default value of `-1` means to skip any overrides and
+leave it to OS default.
[horizontal]
Option value type:: int
Default value:: -1 (leave to OS default)
Applicable socket types:: all, when using TCP transports.
+
+ZMQ_MECHANISM: Retrieve current security mechanism
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The 'ZMQ_MECHANISM' option shall retrieve the current security mechanism
+for the socket.
+
+[horizontal]
+Option value type:: int
+Option value unit:: ZMQ_NULL, ZMQ_PLAIN, or ZMQ_CURVE
+Default value:: ZMQ_NULL
+Applicable socket types:: all, when using TCP or IPC transports
+
+
+ZMQ_PLAIN_SERVER: Retrieve current PLAIN server role
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Returns the 'ZMQ_PLAIN_SERVER' option, if any, previously set on the socket.
+
+[horizontal]
+Option value type:: int
+Option value unit:: 0, 1
+Default value:: int
+Applicable socket types:: all, when using TCP or IPC transports
+
+
+ZMQ_PLAIN_USERNAME: Retrieve current PLAIN username
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The 'ZMQ_PLAIN_USERNAME' option shall retrieve the last username set for
+the PLAIN security mechanism. The returned value shall be a NULL-terminated
+string and MAY be empty. The returned size SHALL include the terminating
+null byte.
+
+[horizontal]
+Option value type:: NULL-terminated character string
+Option value unit:: N/A
+Default value:: null string
+Applicable socket types:: all, when using TCP or IPC transports
+
+
+ZMQ_PLAIN_PASSWORD: Retrieve current password
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The 'ZMQ_PLAIN_PASSWORD' option shall retrieve the last password set for
+the PLAIN security mechanism. The returned value shall be a NULL-terminated
+string and MAY be empty. The returned size SHALL include the terminating
+null byte.
+
+[horizontal]
+Option value type:: NULL-terminated character string
+Option value unit:: N/A
+Default value:: null string
+Applicable socket types:: all, when using TCP or IPC transports
+
+
+ZMQ_CURVE_PUBLICKEY: Retrieve current CURVE public key
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Retrieves the current long term public key for the socket. You can
+provide either a 32 byte buffer, to retrieve the binary key value, or
+a 41 byte buffer, to retrieve the key in a printable Z85 format.
+NOTE: to fetch a printable key, the buffer must be 41 bytes large
+to hold the 40-char key value and one null byte.
+
+[horizontal]
+Option value type:: binary data or Z85 text string
+Option value size:: 32 or 41
+Default value:: null
+Applicable socket types:: all, when using TCP transport
+
+
+ZMQ_CURVE_SECRETKEY: Retrieve current CURVE secret key
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Retrieves the current long term secret key for the socket. You can
+provide either a 32 byte buffer, to retrieve the binary key value, or
+a 41 byte buffer, to retrieve the key in a printable Z85 format.
+
+[horizontal]
+Option value type:: binary data or Z85 text string
+Option value size:: 32 or 41
+Default value:: null
+Applicable socket types:: all, when using TCP transport
+
+
+ZMQ_CURVE_SERVERKEY: Retrieve current CURVE server key
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Retrieves the current server key for the client socket. You can
+provide either a 32 byte buffer, to retrieve the binary key value, or
+a 40 byte buffer, to retrieve the key in a printable Z85 format.
+
+[horizontal]
+Option value type:: binary data or Z85 text string
+Option value size:: 32 or 41
+Default value:: null
+Applicable socket types:: all, when using TCP transport
+
+
+ZMQ_ZAP_DOMAIN: Retrieve RFC 27 authentication domain
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The 'ZMQ_ZAP_DOMAIN' option shall retrieve the last ZAP domain set for
+the socket. The returned value shall be a NULL-terminated string and MAY
+be empty. The returned size SHALL include the terminating null byte.
+
+[horizontal]
+Option value type:: character string
+Option value unit:: N/A
+Default value:: not set
+Applicable socket types:: all, when using TCP transport
+
+
RETURN VALUE
------------
The _zmq_getsockopt()_ function shall return zero if successful. Otherwise it
AUTHORS
-------
-This 0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
-Martin Lucina <mato@kotelna.sk>.
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_init
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.1
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_INIT" "3" "11/23/2012" "0MQ 3\&.2\&.1" "0MQ Manual"
+.TH "ZMQ_INIT" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
\fBzmq\fR(7) \fBzmq_term\fR(3)
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Martin Sustrik <\m[blue]\fBsustrik@250bpm\&.com\fR\m[]\&\s-2\u[1]\d\s+2> and Martin Lucina <\m[blue]\fBmato@kotelna\&.sk\fR\m[]\&\s-2\u[2]\d\s+2>\&.
-.SH "NOTES"
-.IP " 1." 4
-sustrik@250bpm.com
-.RS 4
-\%mailto:sustrik@250bpm.com
-.RE
-.IP " 2." 4
-mato@kotelna.sk
-.RS 4
-\%mailto:mato@kotelna.sk
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Martin Sustrik <<a href="mailto:sustrik@250bpm.com">sustrik@250bpm.com</a>> and\r
-Martin Lucina <<a href="mailto:mato@kotelna.sk">mato@kotelna.sk</a>>.</p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-10-25 17:30:40 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
AUTHORS
-------
-This 0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
-Martin Lucina <mato@kotelna.sk>.
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_inproc
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.2
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_INPROC" "7" "11/23/2012" "0MQ 3\&.2\&.2" "0MQ Manual"
+.TH "ZMQ_INPROC" "7" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
\fBzmq_bind\fR(3) \fBzmq_connect\fR(3) \fBzmq_ipc\fR(7) \fBzmq_tcp\fR(7) \fBzmq_pgm\fR(7) \fBzmq\fR(7)
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Pieter Hintjens <\m[blue]\fBph@imatix\&.com\fR\m[]\&\s-2\u[1]\d\s+2>, Martin Sustrik <\m[blue]\fBsustrik@250bpm\&.com\fR\m[]\&\s-2\u[2]\d\s+2> and Martin Lucina <\m[blue]\fBmato@kotelna\&.sk\fR\m[]\&\s-2\u[3]\d\s+2>\&.
-.SH "NOTES"
-.IP " 1." 4
-ph@imatix.com
-.RS 4
-\%mailto:ph@imatix.com
-.RE
-.IP " 2." 4
-sustrik@250bpm.com
-.RS 4
-\%mailto:sustrik@250bpm.com
-.RE
-.IP " 3." 4
-mato@kotelna.sk
-.RS 4
-\%mailto:mato@kotelna.sk
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Pieter Hintjens <<a href="mailto:ph@imatix.com">ph@imatix.com</a>>,\r
-Martin Sustrik <<a href="mailto:sustrik@250bpm.com">sustrik@250bpm.com</a>> and Martin Lucina <<a href="mailto:mato@kotelna.sk">mato@kotelna.sk</a>>.</p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-11-14 10:09:14 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
AUTHORS
-------
-This 0MQ manual page was written by Pieter Hintjens <ph@imatix.com>,
-Martin Sustrik <sustrik@250bpm.com> and Martin Lucina <mato@kotelna.sk>.
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_ipc
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.2
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_IPC" "7" "11/23/2012" "0MQ 3\&.2\&.2" "0MQ Manual"
+.TH "ZMQ_IPC" "7" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.ps -1
.br
.sp
-any existing binding to the same endpoint shall be overridden\&. In this behavior, the \fIipc\fR transport is not consistent with the \fItcp\fR or \fIinproc\fR transports\&.
+any existing binding to the same endpoint shall be overridden\&. That is, if a second process binds to an endpoint already bound by a process, this will succeed and the first process will lose its binding\&. In this behavior, the \fIipc\fR transport is not consistent with the \fItcp\fR or \fIinproc\fR transports\&.
+.sp .5v
+.RE
+.if n \{\
+.sp
+.\}
+.RS 4
+.it 1 an-trap
+.nr an-no-space-flag 1
+.nr an-break-flag 1
+.br
+.ps +1
+\fBNote\fR
+.ps -1
+.br
+.sp
+the endpoint pathname must be writable by the process\&. When the endpoint starts with \fI/\fR, e\&.g\&., ipc:///pathname, this will be an \fIabsolute\fR pathname\&. If the endpoint specifies a directory that does not exist, the bind shall fail\&.
+.sp .5v
+.RE
+.if n \{\
+.sp
+.\}
+.RS 4
+.it 1 an-trap
+.nr an-no-space-flag 1
+.nr an-break-flag 1
+.br
+.ps +1
+\fBNote\fR
+.ps -1
+.br
+.sp
+on Linux only, when the endpoint pathname starts with @, the abstract namespace shall be used\&. The abstract namespace is independent of the filesystem and if a process attempts to bind an endpoint already bound by a process, it will fail\&. See unix(7) for details\&.
.sp .5v
.RE
.SS "Connecting a socket"
\fBzmq_bind\fR(3) \fBzmq_connect\fR(3) \fBzmq_inproc\fR(7) \fBzmq_tcp\fR(7) \fBzmq_pgm\fR(7) \fBzmq_getsockopt\fR(3) \fBzmq\fR(7)
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Pieter Hintjens <\m[blue]\fBph@imatix\&.com\fR\m[]\&\s-2\u[1]\d\s+2>, Martin Sustrik <\m[blue]\fBsustrik@250bpm\&.com\fR\m[]\&\s-2\u[2]\d\s+2> and Martin Lucina <\m[blue]\fBmato@kotelna\&.sk\fR\m[]\&\s-2\u[3]\d\s+2>\&.
-.SH "NOTES"
-.IP " 1." 4
-ph@imatix.com
-.RS 4
-\%mailto:ph@imatix.com
-.RE
-.IP " 2." 4
-sustrik@250bpm.com
-.RS 4
-\%mailto:sustrik@250bpm.com
-.RE
-.IP " 3." 4
-mato@kotelna.sk
-.RS 4
-\%mailto:mato@kotelna.sk
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
<td class="icon">\r
<div class="title">Note</div>\r
</td>\r
-<td class="content">any existing binding to the same endpoint shall be overridden. In this\r
-behavior, the <em>ipc</em> transport is not consistent with the <em>tcp</em> or <em>inproc</em>\r
-transports.</td>\r
+<td class="content">any existing binding to the same endpoint shall be overridden. That is,\r
+if a second process binds to an endpoint already bound by a process, this\r
+will succeed and the first process will lose its binding. In this behavior,\r
+the <em>ipc</em> transport is not consistent with the <em>tcp</em> or <em>inproc</em> transports.</td>\r
+</tr></table>\r
+</div>\r
+<div class="admonitionblock">\r
+<table><tr>\r
+<td class="icon">\r
+<div class="title">Note</div>\r
+</td>\r
+<td class="content">the endpoint pathname must be writable by the process. When the endpoint\r
+starts with <em>/</em>, e.g., <tt>ipc:///pathname</tt>, this will be an <em>absolute</em> pathname.\r
+If the endpoint specifies a directory that does not exist, the bind shall fail.</td>\r
+</tr></table>\r
+</div>\r
+<div class="admonitionblock">\r
+<table><tr>\r
+<td class="icon">\r
+<div class="title">Note</div>\r
+</td>\r
+<td class="content">on Linux only, when the endpoint pathname starts with <tt>@</tt>, the abstract\r
+namespace shall be used. The abstract namespace is independent of the\r
+filesystem and if a process attempts to bind an endpoint already bound by a\r
+process, it will fail. See unix(7) for details.</td>\r
</tr></table>\r
</div>\r
</div>\r
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Pieter Hintjens <<a href="mailto:ph@imatix.com">ph@imatix.com</a>>,\r
-Martin Sustrik <<a href="mailto:sustrik@250bpm.com">sustrik@250bpm.com</a>> and Martin Lucina <<a href="mailto:mato@kotelna.sk">mato@kotelna.sk</a>>.</p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-11-14 10:09:14 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
pathname. The caller should retrieve this pathname using the ZMQ_LAST_ENDPOINT
socket option. See linkzmq:zmq_getsockopt[3] for details.
-NOTE: any existing binding to the same endpoint shall be overridden. In this
-behavior, the 'ipc' transport is not consistent with the 'tcp' or 'inproc'
-transports.
+NOTE: any existing binding to the same endpoint shall be overridden. That is,
+if a second process binds to an endpoint already bound by a process, this
+will succeed and the first process will lose its binding. In this behavior,
+the 'ipc' transport is not consistent with the 'tcp' or 'inproc' transports.
+
+NOTE: the endpoint pathname must be writable by the process. When the endpoint
+starts with '/', e.g., `ipc:///pathname`, this will be an _absolute_ pathname.
+If the endpoint specifies a directory that does not exist, the bind shall fail.
+
+NOTE: on Linux only, when the endpoint pathname starts with `@`, the abstract
+namespace shall be used. The abstract namespace is independent of the
+filesystem and if a process attempts to bind an endpoint already bound by a
+process, it will fail. See unix(7) for details.
Connecting a socket
~~~~~~~~~~~~~~~~~~~
AUTHORS
-------
-This 0MQ manual page was written by Pieter Hintjens <ph@imatix.com>,
-Martin Sustrik <sustrik@250bpm.com> and Martin Lucina <mato@kotelna.sk>.
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_msg_close
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.1
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_MSG_CLOSE" "3" "11/23/2012" "0MQ 3\&.2\&.1" "0MQ Manual"
+.TH "ZMQ_MSG_CLOSE" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.sp
The \fIzmq_msg_close()\fR function shall inform the 0MQ infrastructure that any resources associated with the message object referenced by \fImsg\fR are no longer required and may be released\&. Actual release of resources associated with the message object shall be postponed by 0MQ until all users of the message or underlying data buffer have indicated it is no longer required\&.
.sp
-Applications should ensure that \fIzmq_msg_close()\fR is called once a message is no longer required, otherwise memory leaks may occur\&.
+Applications should ensure that \fIzmq_msg_close()\fR is called once a message is no longer required, otherwise memory leaks may occur\&. Note that this is NOT necessary after a successful \fIzmq_msg_send()\fR\&.
.if n \{\
.sp
.\}
\fBzmq_msg_init\fR(3) \fBzmq_msg_init_size\fR(3) \fBzmq_msg_init_data\fR(3) \fBzmq_msg_data\fR(3) \fBzmq_msg_size\fR(3) \fBzmq\fR(7)
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Martin Sustrik <\m[blue]\fBsustrik@250bpm\&.com\fR\m[]\&\s-2\u[1]\d\s+2> and Martin Lucina <\m[blue]\fBmato@kotelna\&.sk\fR\m[]\&\s-2\u[2]\d\s+2>\&.
-.SH "NOTES"
-.IP " 1." 4
-sustrik@250bpm.com
-.RS 4
-\%mailto:sustrik@250bpm.com
-.RE
-.IP " 2." 4
-mato@kotelna.sk
-.RS 4
-\%mailto:mato@kotelna.sk
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
message object shall be postponed by ØMQ until all users of the message or\r
underlying data buffer have indicated it is no longer required.</p></div>\r
<div class="paragraph"><p>Applications should ensure that <em>zmq_msg_close()</em> is called once a message is\r
-no longer required, otherwise memory leaks may occur.</p></div>\r
+no longer required, otherwise memory leaks may occur. Note that this is NOT\r
+necessary after a successful <em>zmq_msg_send()</em>.</p></div>\r
<div class="admonitionblock">\r
<table><tr>\r
<td class="icon">\r
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Martin Sustrik <<a href="mailto:sustrik@250bpm.com">sustrik@250bpm.com</a>> and\r
-Martin Lucina <<a href="mailto:mato@kotelna.sk">mato@kotelna.sk</a>>.</p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-10-25 17:30:40 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
underlying data buffer have indicated it is no longer required.
Applications should ensure that _zmq_msg_close()_ is called once a message is
-no longer required, otherwise memory leaks may occur.
+no longer required, otherwise memory leaks may occur. Note that this is NOT
+necessary after a successful _zmq_msg_send()_.
CAUTION: Never access 'zmq_msg_t' members directly, instead always use the
_zmq_msg_ family of functions.
AUTHORS
-------
-This 0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
-Martin Lucina <mato@kotelna.sk>.
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_msg_copy
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.1
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_MSG_COPY" "3" "11/23/2012" "0MQ 3\&.2\&.1" "0MQ Manual"
+.TH "ZMQ_MSG_COPY" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
\fBzmq_msg_move\fR(3) \fBzmq_msg_init\fR(3) \fBzmq_msg_init_size\fR(3) \fBzmq_msg_init_data\fR(3) \fBzmq_msg_close\fR(3) \fBzmq\fR(7)
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Martin Sustrik <\m[blue]\fBsustrik@250bpm\&.com\fR\m[]\&\s-2\u[1]\d\s+2> and Martin Lucina <\m[blue]\fBmato@kotelna\&.sk\fR\m[]\&\s-2\u[2]\d\s+2>\&.
-.SH "NOTES"
-.IP " 1." 4
-sustrik@250bpm.com
-.RS 4
-\%mailto:sustrik@250bpm.com
-.RE
-.IP " 2." 4
-mato@kotelna.sk
-.RS 4
-\%mailto:mato@kotelna.sk
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Martin Sustrik <<a href="mailto:sustrik@250bpm.com">sustrik@250bpm.com</a>> and\r
-Martin Lucina <<a href="mailto:mato@kotelna.sk">mato@kotelna.sk</a>>.</p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-10-25 17:30:40 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
AUTHORS
-------
-This 0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
-Martin Lucina <mato@kotelna.sk>.
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_msg_data
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.1
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_MSG_DATA" "3" "11/23/2012" "0MQ 3\&.2\&.1" "0MQ Manual"
+.TH "ZMQ_MSG_DATA" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
\fBzmq_msg_size\fR(3) \fBzmq_msg_init\fR(3) \fBzmq_msg_init_size\fR(3) \fBzmq_msg_init_data\fR(3) \fBzmq_msg_close\fR(3) \fBzmq\fR(7)
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Martin Sustrik <\m[blue]\fBsustrik@250bpm\&.com\fR\m[]\&\s-2\u[1]\d\s+2> and Martin Lucina <\m[blue]\fBmato@kotelna\&.sk\fR\m[]\&\s-2\u[2]\d\s+2>\&.
-.SH "NOTES"
-.IP " 1." 4
-sustrik@250bpm.com
-.RS 4
-\%mailto:sustrik@250bpm.com
-.RE
-.IP " 2." 4
-mato@kotelna.sk
-.RS 4
-\%mailto:mato@kotelna.sk
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Martin Sustrik <<a href="mailto:sustrik@250bpm.com">sustrik@250bpm.com</a>> and\r
-Martin Lucina <<a href="mailto:mato@kotelna.sk">mato@kotelna.sk</a>>.</p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-10-25 17:30:40 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
AUTHORS
-------
-This 0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
-Martin Lucina <mato@kotelna.sk>.
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_msg_get
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.1
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_MSG_GET" "3" "11/23/2012" "0MQ 3\&.2\&.1" "0MQ Manual"
+.TH "ZMQ_MSG_GET" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.RS 4
.\}
.nf
+zmq_msg_t frame;
while (true) {
// Create an empty 0MQ message to hold the message frame
int rc = zmq_msg_init (&frame);
assert (rc == 0);
// Block until a message is available to be received from socket
- rc = zmq_recvmsg (socket, &frame, 0);
+ rc = zmq_msg_recv (socket, &frame, 0);
assert (rc != \-1);
if (zmq_msg_get (&frame, ZMQ_MORE))
fprintf (stderr, "more\en");
fprintf (stderr, "end\en");
break;
}
- zmq_msg_close (frame);
+ zmq_msg_close (&frame);
}
.fi
.if n \{\
\fBzmq_msg_set\fR(3) \fBzmq_msg_init\fR(3) \fBzmq_msg_close\fR(3) \fBzmq\fR(7)
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Chuck Remes <\m[blue]\fBcremes@mac\&.com\fR\m[]\&\s-2\u[1]\d\s+2> and Pieter Hintjens <\m[blue]\fBph@imatix\&.com\fR\m[]\&\s-2\u[2]\d\s+2>\&.
-.SH "NOTES"
-.IP " 1." 4
-cremes@mac.com
-.RS 4
-\%mailto:cremes@mac.com
-.RE
-.IP " 2." 4
-ph@imatix.com
-.RS 4
-\%mailto:ph@imatix.com
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
<div class="listingblock">\r
<div class="title">Receiving a multi-frame message</div>\r
<div class="content">\r
-<pre><tt>while (true) {\r
+<pre><tt>zmq_msg_t frame;\r
+while (true) {\r
// Create an empty 0MQ message to hold the message frame\r
int rc = zmq_msg_init (&frame);\r
assert (rc == 0);\r
// Block until a message is available to be received from socket\r
- rc = zmq_recvmsg (socket, &frame, 0);\r
+ rc = zmq_msg_recv (socket, &frame, 0);\r
assert (rc != -1);\r
if (zmq_msg_get (&frame, ZMQ_MORE))\r
fprintf (stderr, "more\n");\r
fprintf (stderr, "end\n");\r
break;\r
}\r
- zmq_msg_close (frame);\r
+ zmq_msg_close (&frame);\r
}</tt></pre>\r
</div></div>\r
</div>\r
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Chuck Remes <<a href="mailto:cremes@mac.com">cremes@mac.com</a>> and Pieter\r
-Hintjens <<a href="mailto:ph@imatix.com">ph@imatix.com</a>>.</p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-10-25 17:30:40 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
-------
.Receiving a multi-frame message
----
+zmq_msg_t frame;
while (true) {
// Create an empty 0MQ message to hold the message frame
int rc = zmq_msg_init (&frame);
assert (rc == 0);
// Block until a message is available to be received from socket
- rc = zmq_recvmsg (socket, &frame, 0);
+ rc = zmq_msg_recv (socket, &frame, 0);
assert (rc != -1);
if (zmq_msg_get (&frame, ZMQ_MORE))
fprintf (stderr, "more\n");
fprintf (stderr, "end\n");
break;
}
- zmq_msg_close (frame);
+ zmq_msg_close (&frame);
}
----
AUTHORS
-------
-This 0MQ manual page was written by Chuck Remes <cremes@mac.com> and Pieter
-Hintjens <ph@imatix.com>.
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_msg_init
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.1
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_MSG_INIT" "3" "11/23/2012" "0MQ 3\&.2\&.1" "0MQ Manual"
+.TH "ZMQ_MSG_INIT" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
\fBzmq_msg_init_size\fR(3) \fBzmq_msg_init_data\fR(3) \fBzmq_msg_close\fR(3) \fBzmq_msg_data\fR(3) \fBzmq_msg_size\fR(3) \fBzmq\fR(7)
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Martin Sustrik <\m[blue]\fBsustrik@250bpm\&.com\fR\m[]\&\s-2\u[1]\d\s+2> and Martin Lucina <\m[blue]\fBmato@kotelna\&.sk\fR\m[]\&\s-2\u[2]\d\s+2>\&.
-.SH "NOTES"
-.IP " 1." 4
-sustrik@250bpm.com
-.RS 4
-\%mailto:sustrik@250bpm.com
-.RE
-.IP " 2." 4
-mato@kotelna.sk
-.RS 4
-\%mailto:mato@kotelna.sk
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Martin Sustrik <<a href="mailto:sustrik@250bpm.com">sustrik@250bpm.com</a>> and\r
-Martin Lucina <<a href="mailto:mato@kotelna.sk">mato@kotelna.sk</a>>.</p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-10-25 17:30:40 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
AUTHORS
-------
-This 0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
-Martin Lucina <mato@kotelna.sk>.
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_msg_init_data
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.1
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_MSG_INIT_DATA" "3" "11/23/2012" "0MQ 3\&.2\&.1" "0MQ Manual"
+.TH "ZMQ_MSG_INIT_DATA" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
\fBzmq_msg_init_size\fR(3) \fBzmq_msg_init\fR(3) \fBzmq_msg_close\fR(3) \fBzmq_msg_data\fR(3) \fBzmq_msg_size\fR(3) \fBzmq\fR(7)
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Martin Sustrik <\m[blue]\fBsustrik@250bpm\&.com\fR\m[]\&\s-2\u[1]\d\s+2> and Martin Lucina <\m[blue]\fBmato@kotelna\&.sk\fR\m[]\&\s-2\u[2]\d\s+2>\&.
-.SH "NOTES"
-.IP " 1." 4
-sustrik@250bpm.com
-.RS 4
-\%mailto:sustrik@250bpm.com
-.RE
-.IP " 2." 4
-mato@kotelna.sk
-.RS 4
-\%mailto:mato@kotelna.sk
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Martin Sustrik <<a href="mailto:sustrik@250bpm.com">sustrik@250bpm.com</a>> and\r
-Martin Lucina <<a href="mailto:mato@kotelna.sk">mato@kotelna.sk</a>>.</p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-10-25 17:30:40 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
AUTHORS
-------
-This 0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
-Martin Lucina <mato@kotelna.sk>.
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_msg_init_size
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.1
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_MSG_INIT_SIZE" "3" "11/23/2012" "0MQ 3\&.2\&.1" "0MQ Manual"
+.TH "ZMQ_MSG_INIT_SIZE" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
\fBzmq_msg_init_data\fR(3) \fBzmq_msg_init\fR(3) \fBzmq_msg_close\fR(3) \fBzmq_msg_data\fR(3) \fBzmq_msg_size\fR(3) \fBzmq\fR(7)
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Martin Sustrik <\m[blue]\fBsustrik@250bpm\&.com\fR\m[]\&\s-2\u[1]\d\s+2> and Martin Lucina <\m[blue]\fBmato@kotelna\&.sk\fR\m[]\&\s-2\u[2]\d\s+2>\&.
-.SH "NOTES"
-.IP " 1." 4
-sustrik@250bpm.com
-.RS 4
-\%mailto:sustrik@250bpm.com
-.RE
-.IP " 2." 4
-mato@kotelna.sk
-.RS 4
-\%mailto:mato@kotelna.sk
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Martin Sustrik <<a href="mailto:sustrik@250bpm.com">sustrik@250bpm.com</a>> and\r
-Martin Lucina <<a href="mailto:mato@kotelna.sk">mato@kotelna.sk</a>>.</p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-10-25 17:30:40 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
AUTHORS
-------
-This 0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
-Martin Lucina <mato@kotelna.sk>.
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_msg_more
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.1
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_MSG_MORE" "3" "11/23/2012" "0MQ 3\&.2\&.1" "0MQ Manual"
+.TH "ZMQ_MSG_MORE" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
\fBint zmq_msg_more (zmq_msg_t \fR\fB\fI*message\fR\fR\fB);\fR
.SH "DESCRIPTION"
.sp
-The \fIzmq_msg_more()\fR function indicates whether this is part of a multi\-part message, and there are further parts to receive\&.
+The \fIzmq_msg_more()\fR function indicates whether this is part of a multi\-part message, and there are further parts to receive\&. This method can safely be called after \fIzmq_msg_close()\fR\&. This method is identical to \fIzmq_msg_get()\fR with an argument of ZMQ_MORE\&.
.SH "RETURN VALUE"
.sp
The \fIzmq_msg_more()\fR function shall return zero if this is the final part of a multi\-part message, or the only part of a single\-part message\&. It shall return 1 if there are further parts to receive\&.
int rc = zmq_msg_init (&part);
assert (rc == 0);
// Block until a message is available to be received from socket
- rc = zmq_recvmsg (socket, &part, 0);
+ rc = zmq_msg_recv (socket, &part, 0);
assert (rc != \-1);
if (zmq_msg_more (&part))
fprintf (stderr, "more\en");
fprintf (stderr, "end\en");
break;
}
- zmq_msg_close (part);
+ zmq_msg_close (&part);
}
.fi
.if n \{\
\fBzmq_msg_get\fR(3) \fBzmq_msg_set\fR(3) \fBzmq_msg_init\fR(3) \fBzmq_msg_close\fR(3) \fBzmq\fR(7)
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Chuck Remes <\m[blue]\fBcremes@mac\&.com\fR\m[]\&\s-2\u[1]\d\s+2> and Pieter Hintjens <\m[blue]\fBph@imatix\&.com\fR\m[]\&\s-2\u[2]\d\s+2>\&.
-.SH "NOTES"
-.IP " 1." 4
-cremes@mac.com
-.RS 4
-\%mailto:cremes@mac.com
-.RE
-.IP " 2." 4
-ph@imatix.com
-.RS 4
-\%mailto:ph@imatix.com
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
<h2 id="_description">DESCRIPTION</h2>\r
<div class="sectionbody">\r
<div class="paragraph"><p>The <em>zmq_msg_more()</em> function indicates whether this is part of a multi-part\r
-message, and there are further parts to receive.</p></div>\r
+message, and there are further parts to receive. This method can safely be\r
+called after <em>zmq_msg_close()</em>. This method is identical to <em>zmq_msg_get()</em>\r
+with an argument of ZMQ_MORE.</p></div>\r
</div>\r
</div>\r
<div class="sect1">\r
int rc = zmq_msg_init (&part);\r
assert (rc == 0);\r
// Block until a message is available to be received from socket\r
- rc = zmq_recvmsg (socket, &part, 0);\r
+ rc = zmq_msg_recv (socket, &part, 0);\r
assert (rc != -1);\r
if (zmq_msg_more (&part))\r
fprintf (stderr, "more\n");\r
fprintf (stderr, "end\n");\r
break;\r
}\r
- zmq_msg_close (part);\r
+ zmq_msg_close (&part);\r
}</tt></pre>\r
</div></div>\r
</div>\r
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Chuck Remes <<a href="mailto:cremes@mac.com">cremes@mac.com</a>> and Pieter\r
-Hintjens <<a href="mailto:ph@imatix.com">ph@imatix.com</a>>.</p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-10-25 17:30:40 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
DESCRIPTION
-----------
The _zmq_msg_more()_ function indicates whether this is part of a multi-part
-message, and there are further parts to receive.
+message, and there are further parts to receive. This method can safely be
+called after _zmq_msg_close()_. This method is identical to _zmq_msg_get()_
+with an argument of ZMQ_MORE.
RETURN VALUE
int rc = zmq_msg_init (&part);
assert (rc == 0);
// Block until a message is available to be received from socket
- rc = zmq_recvmsg (socket, &part, 0);
+ rc = zmq_msg_recv (socket, &part, 0);
assert (rc != -1);
if (zmq_msg_more (&part))
fprintf (stderr, "more\n");
fprintf (stderr, "end\n");
break;
}
- zmq_msg_close (part);
+ zmq_msg_close (&part);
}
----
AUTHORS
-------
-This 0MQ manual page was written by Chuck Remes <cremes@mac.com> and Pieter
-Hintjens <ph@imatix.com>.
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_msg_move
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.1
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_MSG_MOVE" "3" "11/23/2012" "0MQ 3\&.2\&.1" "0MQ Manual"
+.TH "ZMQ_MSG_MOVE" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
\fBzmq_msg_copy\fR(3) \fBzmq_msg_init\fR(3) \fBzmq_msg_init_size\fR(3) \fBzmq_msg_init_data\fR(3) \fBzmq_msg_close\fR(3) \fBzmq\fR(7)
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Martin Sustrik <\m[blue]\fBsustrik@250bpm\&.com\fR\m[]\&\s-2\u[1]\d\s+2> and Martin Lucina <\m[blue]\fBmato@kotelna\&.sk\fR\m[]\&\s-2\u[2]\d\s+2>\&.
-.SH "NOTES"
-.IP " 1." 4
-sustrik@250bpm.com
-.RS 4
-\%mailto:sustrik@250bpm.com
-.RE
-.IP " 2." 4
-mato@kotelna.sk
-.RS 4
-\%mailto:mato@kotelna.sk
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Martin Sustrik <<a href="mailto:sustrik@250bpm.com">sustrik@250bpm.com</a>> and\r
-Martin Lucina <<a href="mailto:mato@kotelna.sk">mato@kotelna.sk</a>>.</p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-10-25 17:30:40 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
AUTHORS
-------
-This 0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
-Martin Lucina <mato@kotelna.sk>.
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_msg_recv
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.1
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_MSG_RECV" "3" "11/23/2012" "0MQ 3\&.2\&.1" "0MQ Manual"
+.TH "ZMQ_MSG_RECV" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\}
.nf
int64_t more;
-size_t more_size = sizeof more;
+size_t more_size = sizeof (more);
do {
/* Create an empty 0MQ message to hold the message part */
zmq_msg_t part;
\fBzmq_recv\fR(3) \fBzmq_send\fR(3) \fBzmq_msg_send\fR(3) \fBzmq_getsockopt\fR(3) \fBzmq_socket\fR(7) \fBzmq\fR(7)
.SH "AUTHORS"
.sp
-This man page was written by Martin Sustrik <\m[blue]\fBsustrik@250bpm\&.com\fR\m[]\&\s-2\u[1]\d\s+2>, Martin Lucina <\m[blue]\fBmartin@lucina\&.net\fR\m[]\&\s-2\u[2]\d\s+2>, and Pieter Hintjens <\m[blue]\fBph@imatix\&.com\fR\m[]\&\s-2\u[3]\d\s+2>\&.
-.SH "NOTES"
-.IP " 1." 4
-sustrik@250bpm.com
-.RS 4
-\%mailto:sustrik@250bpm.com
-.RE
-.IP " 2." 4
-martin@lucina.net
-.RS 4
-\%mailto:martin@lucina.net
-.RE
-.IP " 3." 4
-ph@imatix.com
-.RS 4
-\%mailto:ph@imatix.com
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
<div class="title">Receiving a multi-part message</div>\r
<div class="content">\r
<pre><tt>int64_t more;\r
-size_t more_size = sizeof more;\r
+size_t more_size = sizeof (more);\r
do {\r
/* Create an empty 0MQ message to hold the message part */\r
zmq_msg_t part;\r
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This man page was written by Martin Sustrik <<a href="mailto:sustrik@250bpm.com">sustrik@250bpm.com</a>>, Martin\r
-Lucina <<a href="mailto:martin@lucina.net">martin@lucina.net</a>>, and Pieter Hintjens <<a href="mailto:ph@imatix.com">ph@imatix.com</a>>.</p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-10-25 17:30:40 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
.Receiving a multi-part message
----
int64_t more;
-size_t more_size = sizeof more;
+size_t more_size = sizeof (more);
do {
/* Create an empty 0MQ message to hold the message part */
zmq_msg_t part;
AUTHORS
-------
-This man page was written by Martin Sustrik <sustrik@250bpm.com>, Martin
-Lucina <martin@lucina.net>, and Pieter Hintjens <ph@imatix.com>.
-
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_msg_send
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.1
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_MSG_SEND" "3" "11/23/2012" "0MQ 3\&.2\&.1" "0MQ Manual"
+.TH "ZMQ_MSG_SEND" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.PP
\fBZMQ_DONTWAIT\fR
.RS 4
-Specifies that the operation should be performed in non\-blocking mode\&. If the message cannot be queued on the
+For socket types (DEALER, PUSH) that block when there are no available peers (or all peers have full high\-water mark), specifies that the operation should be performed in non\-blocking mode\&. If the message cannot be queued on the
\fIsocket\fR, the
\fIzmq_msg_send()\fR
function shall fail with
.ps -1
.br
.sp
-A successful invocation of \fIzmq_msg_send()\fR does not indicate that the message has been transmitted to the network, only that it has been queued on the \fIsocket\fR and 0MQ has assumed responsibility for the message\&.
+A successful invocation of \fIzmq_msg_send()\fR does not indicate that the message has been transmitted to the network, only that it has been queued on the \fIsocket\fR and 0MQ has assumed responsibility for the message\&. You do not need to call \fIzmq_msg_close()\fR after a successful \fIzmq_msg_send()\fR\&.
.sp .5v
.RE
.SS "Multi\-part messages"
.RS 4
Invalid message\&.
.RE
+.PP
+\fBEHOSTUNREACH\fR
+.RS 4
+The message cannot be routed\&.
+.RE
.SH "EXAMPLE"
.PP
\fBFilling in a message and sending it to a socket\fR.
\fBzmq_recv\fR(3) \fBzmq_send\fR(3) \fBzmq_msg_recv\fR(3) \fBzmq_socket\fR(7) \fBzmq\fR(7)
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Martin Sustrik <\m[blue]\fBsustrik@250bpm\&.com\fR\m[]\&\s-2\u[1]\d\s+2> and Martin Lucina <\m[blue]\fBmato@kotelna\&.sk\fR\m[]\&\s-2\u[2]\d\s+2>, and Pieter Hintjens <\m[blue]\fBph@imatix\&.com\fR\m[]\&\s-2\u[3]\d\s+2>\&.
-.SH "NOTES"
-.IP " 1." 4
-sustrik@250bpm.com
-.RS 4
-\%mailto:sustrik@250bpm.com
-.RE
-.IP " 2." 4
-mato@kotelna.sk
-.RS 4
-\%mailto:mato@kotelna.sk
-.RE
-.IP " 3." 4
-ph@imatix.com
-.RS 4
-\%mailto:ph@imatix.com
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
</dt>\r
<dd>\r
<p>\r
-Specifies that the operation should be performed in non-blocking mode. If the\r
-message cannot be queued on the <em>socket</em>, the <em>zmq_msg_send()</em> function shall\r
-fail with <em>errno</em> set to EAGAIN.\r
+For socket types (DEALER, PUSH) that block when there are no available peers\r
+(or all peers have full high-water mark), specifies that the operation should\r
+be performed in non-blocking mode. If the message cannot be queued on the\r
+<em>socket</em>, the <em>zmq_msg_send()</em> function shall fail with <em>errno</em> set to EAGAIN.\r
</p>\r
</dd>\r
<dt class="hdlist1">\r
</td>\r
<td class="content">A successful invocation of <em>zmq_msg_send()</em> does not indicate that the\r
message has been transmitted to the network, only that it has been queued on\r
-the <em>socket</em> and ØMQ has assumed responsibility for the message.</td>\r
+the <em>socket</em> and ØMQ has assumed responsibility for the message. You do not need\r
+to call <em>zmq_msg_close()</em> after a successful <em>zmq_msg_send()</em>.</td>\r
</tr></table>\r
</div>\r
<div class="sect2">\r
Invalid message.\r
</p>\r
</dd>\r
+<dt class="hdlist1">\r
+<strong>EHOSTUNREACH</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+The message cannot be routed.\r
+</p>\r
+</dd>\r
</dl></div>\r
</div>\r
</div>\r
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Martin Sustrik <<a href="mailto:sustrik@250bpm.com">sustrik@250bpm.com</a>> and\r
-Martin Lucina <<a href="mailto:mato@kotelna.sk">mato@kotelna.sk</a>>, and Pieter Hintjens <<a href="mailto:ph@imatix.com">ph@imatix.com</a>>.</p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-10-25 17:30:40 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
'flags' argument is a combination of the flags defined below:
*ZMQ_DONTWAIT*::
-Specifies that the operation should be performed in non-blocking mode. If the
-message cannot be queued on the 'socket', the _zmq_msg_send()_ function shall
-fail with 'errno' set to EAGAIN.
+For socket types (DEALER, PUSH) that block when there are no available peers
+(or all peers have full high-water mark), specifies that the operation should
+be performed in non-blocking mode. If the message cannot be queued on the
+'socket', the _zmq_msg_send()_ function shall fail with 'errno' set to EAGAIN.
*ZMQ_SNDMORE*::
Specifies that the message being sent is a multi-part message, and that further
NOTE: A successful invocation of _zmq_msg_send()_ does not indicate that the
message has been transmitted to the network, only that it has been queued on
-the 'socket' and 0MQ has assumed responsibility for the message.
+the 'socket' and 0MQ has assumed responsibility for the message. You do not need
+to call _zmq_msg_close()_ after a successful _zmq_msg_send()_.
Multi-part messages
sent.
*EFAULT*::
Invalid message.
+*EHOSTUNREACH*::
+The message cannot be routed.
EXAMPLE
AUTHORS
-------
-This 0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
-Martin Lucina <mato@kotelna.sk>, and Pieter Hintjens <ph@imatix.com>.
-
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_msg_set
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.1
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_MSG_SET" "3" "11/23/2012" "0MQ 3\&.2\&.1" "0MQ Manual"
+.TH "ZMQ_MSG_SET" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
\fBzmq_msg_get\fR(3) \fBzmq\fR(7)
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Pieter Hintjens <\m[blue]\fBph@imatix\&.com\fR\m[]\&\s-2\u[1]\d\s+2>\&.
-.SH "NOTES"
-.IP " 1." 4
-ph@imatix.com
-.RS 4
-\%mailto:ph@imatix.com
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Pieter Hintjens <<a href="mailto:ph@imatix.com">ph@imatix.com</a>>.</p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-10-25 17:30:40 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
AUTHORS
-------
-This 0MQ manual page was written by Pieter Hintjens <ph@imatix.com>.
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_msg_size
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.1
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_MSG_SIZE" "3" "11/23/2012" "0MQ 3\&.2\&.1" "0MQ Manual"
+.TH "ZMQ_MSG_SIZE" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
\fBzmq_msg_data\fR(3) \fBzmq_msg_init\fR(3) \fBzmq_msg_init_size\fR(3) \fBzmq_msg_init_data\fR(3) \fBzmq_msg_close\fR(3) \fBzmq\fR(7)
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Martin Sustrik <\m[blue]\fBsustrik@250bpm\&.com\fR\m[]\&\s-2\u[1]\d\s+2>, Martin Lucina <\m[blue]\fBmato@kotelna\&.sk\fR\m[]\&\s-2\u[2]\d\s+2>, and Pieter Hintjens <\m[blue]\fBph@imatix\&.com\fR\m[]\&\s-2\u[3]\d\s+2>\&.
-.SH "NOTES"
-.IP " 1." 4
-sustrik@250bpm.com
-.RS 4
-\%mailto:sustrik@250bpm.com
-.RE
-.IP " 2." 4
-mato@kotelna.sk
-.RS 4
-\%mailto:mato@kotelna.sk
-.RE
-.IP " 3." 4
-ph@imatix.com
-.RS 4
-\%mailto:ph@imatix.com
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Martin Sustrik <<a href="mailto:sustrik@250bpm.com">sustrik@250bpm.com</a>>,\r
-Martin Lucina <<a href="mailto:mato@kotelna.sk">mato@kotelna.sk</a>>, and Pieter Hintjens <<a href="mailto:ph@imatix.com">ph@imatix.com</a>>.</p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-10-25 17:30:40 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
AUTHORS
-------
-This 0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com>,
-Martin Lucina <mato@kotelna.sk>, and Pieter Hintjens <ph@imatix.com>.
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
--- /dev/null
+'\" t
+.\" Title: zmq_null
+.\" Author: [see the "AUTHORS" section]
+.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
+.\" Date: 03/10/2014
+.\" Manual: 0MQ Manual
+.\" Source: 0MQ 4.0.1
+.\" Language: English
+.\"
+.TH "ZMQ_NULL" "7" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+zmq_null \- no security or confidentiality
+.SH "SYNOPSIS"
+.sp
+The NULL mechanism is defined by the ZMTP 3\&.0 specification: \m[blue]\fBhttp://rfc\&.zeromq\&.org/spec:23\fR\m[]\&. This is the default security mechanism for ZeroMQ sockets\&.
+.SH "SEE ALSO"
+.sp
+\fBzmq_plain\fR(7) \fBzmq_curve\fR(7) \fBzmq\fR(7)
+.SH "AUTHORS"
+.sp
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"\r
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">\r
+<head>\r
+<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />\r
+<meta name="generator" content="AsciiDoc 8.6.6" />\r
+<title>zmq_null(7)</title>\r
+<style type="text/css">\r
+/* Shared CSS for AsciiDoc xhtml11 and html5 backends */\r
+\r
+/* Default font. */\r
+body {\r
+ font-family: Georgia,serif;\r
+}\r
+\r
+/* Title font. */\r
+h1, h2, h3, h4, h5, h6,\r
+div.title, caption.title,\r
+thead, p.table.header,\r
+#toctitle,\r
+#author, #revnumber, #revdate, #revremark,\r
+#footer {\r
+ font-family: Arial,Helvetica,sans-serif;\r
+}\r
+\r
+body {\r
+ margin: 1em 5% 1em 5%;\r
+}\r
+\r
+a {\r
+ color: blue;\r
+ text-decoration: underline;\r
+}\r
+a:visited {\r
+ color: fuchsia;\r
+}\r
+\r
+em {\r
+ font-style: italic;\r
+ color: navy;\r
+}\r
+\r
+strong {\r
+ font-weight: bold;\r
+ color: #083194;\r
+}\r
+\r
+h1, h2, h3, h4, h5, h6 {\r
+ color: #527bbd;\r
+ margin-top: 1.2em;\r
+ margin-bottom: 0.5em;\r
+ line-height: 1.3;\r
+}\r
+\r
+h1, h2, h3 {\r
+ border-bottom: 2px solid silver;\r
+}\r
+h2 {\r
+ padding-top: 0.5em;\r
+}\r
+h3 {\r
+ float: left;\r
+}\r
+h3 + * {\r
+ clear: left;\r
+}\r
+h5 {\r
+ font-size: 1.0em;\r
+}\r
+\r
+div.sectionbody {\r
+ margin-left: 0;\r
+}\r
+\r
+hr {\r
+ border: 1px solid silver;\r
+}\r
+\r
+p {\r
+ margin-top: 0.5em;\r
+ margin-bottom: 0.5em;\r
+}\r
+\r
+ul, ol, li > p {\r
+ margin-top: 0;\r
+}\r
+ul > li { color: #aaa; }\r
+ul > li > * { color: black; }\r
+\r
+pre {\r
+ padding: 0;\r
+ margin: 0;\r
+}\r
+\r
+#author {\r
+ color: #527bbd;\r
+ font-weight: bold;\r
+ font-size: 1.1em;\r
+}\r
+#email {\r
+}\r
+#revnumber, #revdate, #revremark {\r
+}\r
+\r
+#footer {\r
+ font-size: small;\r
+ border-top: 2px solid silver;\r
+ padding-top: 0.5em;\r
+ margin-top: 4.0em;\r
+}\r
+#footer-text {\r
+ float: left;\r
+ padding-bottom: 0.5em;\r
+}\r
+#footer-badges {\r
+ float: right;\r
+ padding-bottom: 0.5em;\r
+}\r
+\r
+#preamble {\r
+ margin-top: 1.5em;\r
+ margin-bottom: 1.5em;\r
+}\r
+div.imageblock, div.exampleblock, div.verseblock,\r
+div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,\r
+div.admonitionblock {\r
+ margin-top: 1.0em;\r
+ margin-bottom: 1.5em;\r
+}\r
+div.admonitionblock {\r
+ margin-top: 2.0em;\r
+ margin-bottom: 2.0em;\r
+ margin-right: 10%;\r
+ color: #606060;\r
+}\r
+\r
+div.content { /* Block element content. */\r
+ padding: 0;\r
+}\r
+\r
+/* Block element titles. */\r
+div.title, caption.title {\r
+ color: #527bbd;\r
+ font-weight: bold;\r
+ text-align: left;\r
+ margin-top: 1.0em;\r
+ margin-bottom: 0.5em;\r
+}\r
+div.title + * {\r
+ margin-top: 0;\r
+}\r
+\r
+td div.title:first-child {\r
+ margin-top: 0.0em;\r
+}\r
+div.content div.title:first-child {\r
+ margin-top: 0.0em;\r
+}\r
+div.content + div.title {\r
+ margin-top: 0.0em;\r
+}\r
+\r
+div.sidebarblock > div.content {\r
+ background: #ffffee;\r
+ border: 1px solid #dddddd;\r
+ border-left: 4px solid #f0f0f0;\r
+ padding: 0.5em;\r
+}\r
+\r
+div.listingblock > div.content {\r
+ border: 1px solid #dddddd;\r
+ border-left: 5px solid #f0f0f0;\r
+ background: #f8f8f8;\r
+ padding: 0.5em;\r
+}\r
+\r
+div.quoteblock, div.verseblock {\r
+ padding-left: 1.0em;\r
+ margin-left: 1.0em;\r
+ margin-right: 10%;\r
+ border-left: 5px solid #f0f0f0;\r
+ color: #888;\r
+}\r
+\r
+div.quoteblock > div.attribution {\r
+ padding-top: 0.5em;\r
+ text-align: right;\r
+}\r
+\r
+div.verseblock > pre.content {\r
+ font-family: inherit;\r
+ font-size: inherit;\r
+}\r
+div.verseblock > div.attribution {\r
+ padding-top: 0.75em;\r
+ text-align: left;\r
+}\r
+/* DEPRECATED: Pre version 8.2.7 verse style literal block. */\r
+div.verseblock + div.attribution {\r
+ text-align: left;\r
+}\r
+\r
+div.admonitionblock .icon {\r
+ vertical-align: top;\r
+ font-size: 1.1em;\r
+ font-weight: bold;\r
+ text-decoration: underline;\r
+ color: #527bbd;\r
+ padding-right: 0.5em;\r
+}\r
+div.admonitionblock td.content {\r
+ padding-left: 0.5em;\r
+ border-left: 3px solid #dddddd;\r
+}\r
+\r
+div.exampleblock > div.content {\r
+ border-left: 3px solid #dddddd;\r
+ padding-left: 0.5em;\r
+}\r
+\r
+div.imageblock div.content { padding-left: 0; }\r
+span.image img { border-style: none; }\r
+a.image:visited { color: white; }\r
+\r
+dl {\r
+ margin-top: 0.8em;\r
+ margin-bottom: 0.8em;\r
+}\r
+dt {\r
+ margin-top: 0.5em;\r
+ margin-bottom: 0;\r
+ font-style: normal;\r
+ color: navy;\r
+}\r
+dd > *:first-child {\r
+ margin-top: 0.1em;\r
+}\r
+\r
+ul, ol {\r
+ list-style-position: outside;\r
+}\r
+ol.arabic {\r
+ list-style-type: decimal;\r
+}\r
+ol.loweralpha {\r
+ list-style-type: lower-alpha;\r
+}\r
+ol.upperalpha {\r
+ list-style-type: upper-alpha;\r
+}\r
+ol.lowerroman {\r
+ list-style-type: lower-roman;\r
+}\r
+ol.upperroman {\r
+ list-style-type: upper-roman;\r
+}\r
+\r
+div.compact ul, div.compact ol,\r
+div.compact p, div.compact p,\r
+div.compact div, div.compact div {\r
+ margin-top: 0.1em;\r
+ margin-bottom: 0.1em;\r
+}\r
+\r
+tfoot {\r
+ font-weight: bold;\r
+}\r
+td > div.verse {\r
+ white-space: pre;\r
+}\r
+\r
+div.hdlist {\r
+ margin-top: 0.8em;\r
+ margin-bottom: 0.8em;\r
+}\r
+div.hdlist tr {\r
+ padding-bottom: 15px;\r
+}\r
+dt.hdlist1.strong, td.hdlist1.strong {\r
+ font-weight: bold;\r
+}\r
+td.hdlist1 {\r
+ vertical-align: top;\r
+ font-style: normal;\r
+ padding-right: 0.8em;\r
+ color: navy;\r
+}\r
+td.hdlist2 {\r
+ vertical-align: top;\r
+}\r
+div.hdlist.compact tr {\r
+ margin: 0;\r
+ padding-bottom: 0;\r
+}\r
+\r
+.comment {\r
+ background: yellow;\r
+}\r
+\r
+.footnote, .footnoteref {\r
+ font-size: 0.8em;\r
+}\r
+\r
+span.footnote, span.footnoteref {\r
+ vertical-align: super;\r
+}\r
+\r
+#footnotes {\r
+ margin: 20px 0 20px 0;\r
+ padding: 7px 0 0 0;\r
+}\r
+\r
+#footnotes div.footnote {\r
+ margin: 0 0 5px 0;\r
+}\r
+\r
+#footnotes hr {\r
+ border: none;\r
+ border-top: 1px solid silver;\r
+ height: 1px;\r
+ text-align: left;\r
+ margin-left: 0;\r
+ width: 20%;\r
+ min-width: 100px;\r
+}\r
+\r
+div.colist td {\r
+ padding-right: 0.5em;\r
+ padding-bottom: 0.3em;\r
+ vertical-align: top;\r
+}\r
+div.colist td img {\r
+ margin-top: 0.3em;\r
+}\r
+\r
+@media print {\r
+ #footer-badges { display: none; }\r
+}\r
+\r
+#toc {\r
+ margin-bottom: 2.5em;\r
+}\r
+\r
+#toctitle {\r
+ color: #527bbd;\r
+ font-size: 1.1em;\r
+ font-weight: bold;\r
+ margin-top: 1.0em;\r
+ margin-bottom: 0.1em;\r
+}\r
+\r
+div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {\r
+ margin-top: 0;\r
+ margin-bottom: 0;\r
+}\r
+div.toclevel2 {\r
+ margin-left: 2em;\r
+ font-size: 0.9em;\r
+}\r
+div.toclevel3 {\r
+ margin-left: 4em;\r
+ font-size: 0.9em;\r
+}\r
+div.toclevel4 {\r
+ margin-left: 6em;\r
+ font-size: 0.9em;\r
+}\r
+\r
+span.aqua { color: aqua; }\r
+span.black { color: black; }\r
+span.blue { color: blue; }\r
+span.fuchsia { color: fuchsia; }\r
+span.gray { color: gray; }\r
+span.green { color: green; }\r
+span.lime { color: lime; }\r
+span.maroon { color: maroon; }\r
+span.navy { color: navy; }\r
+span.olive { color: olive; }\r
+span.purple { color: purple; }\r
+span.red { color: red; }\r
+span.silver { color: silver; }\r
+span.teal { color: teal; }\r
+span.white { color: white; }\r
+span.yellow { color: yellow; }\r
+\r
+span.aqua-background { background: aqua; }\r
+span.black-background { background: black; }\r
+span.blue-background { background: blue; }\r
+span.fuchsia-background { background: fuchsia; }\r
+span.gray-background { background: gray; }\r
+span.green-background { background: green; }\r
+span.lime-background { background: lime; }\r
+span.maroon-background { background: maroon; }\r
+span.navy-background { background: navy; }\r
+span.olive-background { background: olive; }\r
+span.purple-background { background: purple; }\r
+span.red-background { background: red; }\r
+span.silver-background { background: silver; }\r
+span.teal-background { background: teal; }\r
+span.white-background { background: white; }\r
+span.yellow-background { background: yellow; }\r
+\r
+span.big { font-size: 2em; }\r
+span.small { font-size: 0.6em; }\r
+\r
+span.underline { text-decoration: underline; }\r
+span.overline { text-decoration: overline; }\r
+span.line-through { text-decoration: line-through; }\r
+\r
+\r
+/*\r
+ * xhtml11 specific\r
+ *\r
+ * */\r
+\r
+tt {\r
+ font-family: monospace;\r
+ font-size: inherit;\r
+ color: navy;\r
+}\r
+\r
+div.tableblock {\r
+ margin-top: 1.0em;\r
+ margin-bottom: 1.5em;\r
+}\r
+div.tableblock > table {\r
+ border: 3px solid #527bbd;\r
+}\r
+thead, p.table.header {\r
+ font-weight: bold;\r
+ color: #527bbd;\r
+}\r
+p.table {\r
+ margin-top: 0;\r
+}\r
+/* Because the table frame attribute is overriden by CSS in most browsers. */\r
+div.tableblock > table[frame="void"] {\r
+ border-style: none;\r
+}\r
+div.tableblock > table[frame="hsides"] {\r
+ border-left-style: none;\r
+ border-right-style: none;\r
+}\r
+div.tableblock > table[frame="vsides"] {\r
+ border-top-style: none;\r
+ border-bottom-style: none;\r
+}\r
+\r
+\r
+/*\r
+ * html5 specific\r
+ *\r
+ * */\r
+\r
+.monospaced {\r
+ font-family: monospace;\r
+ font-size: inherit;\r
+ color: navy;\r
+}\r
+\r
+table.tableblock {\r
+ margin-top: 1.0em;\r
+ margin-bottom: 1.5em;\r
+}\r
+thead, p.tableblock.header {\r
+ font-weight: bold;\r
+ color: #527bbd;\r
+}\r
+p.tableblock {\r
+ margin-top: 0;\r
+}\r
+table.tableblock {\r
+ border-width: 3px;\r
+ border-spacing: 0px;\r
+ border-style: solid;\r
+ border-color: #527bbd;\r
+ border-collapse: collapse;\r
+}\r
+th.tableblock, td.tableblock {\r
+ border-width: 1px;\r
+ padding: 4px;\r
+ border-style: solid;\r
+ border-color: #527bbd;\r
+}\r
+\r
+table.tableblock.frame-topbot {\r
+ border-left-style: hidden;\r
+ border-right-style: hidden;\r
+}\r
+table.tableblock.frame-sides {\r
+ border-top-style: hidden;\r
+ border-bottom-style: hidden;\r
+}\r
+table.tableblock.frame-none {\r
+ border-style: hidden;\r
+}\r
+\r
+th.tableblock.halign-left, td.tableblock.halign-left {\r
+ text-align: left;\r
+}\r
+th.tableblock.halign-center, td.tableblock.halign-center {\r
+ text-align: center;\r
+}\r
+th.tableblock.halign-right, td.tableblock.halign-right {\r
+ text-align: right;\r
+}\r
+\r
+th.tableblock.valign-top, td.tableblock.valign-top {\r
+ vertical-align: top;\r
+}\r
+th.tableblock.valign-middle, td.tableblock.valign-middle {\r
+ vertical-align: middle;\r
+}\r
+th.tableblock.valign-bottom, td.tableblock.valign-bottom {\r
+ vertical-align: bottom;\r
+}\r
+\r
+\r
+/*\r
+ * manpage specific\r
+ *\r
+ * */\r
+\r
+body.manpage h1 {\r
+ padding-top: 0.5em;\r
+ padding-bottom: 0.5em;\r
+ border-top: 2px solid silver;\r
+ border-bottom: 2px solid silver;\r
+}\r
+body.manpage h2 {\r
+ border-style: none;\r
+}\r
+body.manpage div.sectionbody {\r
+ margin-left: 3em;\r
+}\r
+\r
+@media print {\r
+ body.manpage div#toc { display: none; }\r
+}\r
+</style>\r
+<script type="text/javascript">\r
+/*<+'])');\r
+ // Function that scans the DOM tree for header elements (the DOM2\r
+ // nodeIterator API would be a better technique but not supported by all\r
+ // browsers).\r
+ var iterate = function (el) {\r
+ for (var i = el.firstChild; i != null; i = i.nextSibling) {\r
+ if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {\r
+ var mo = re.exec(i.tagName);\r
+ if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {\r
+ result[result.length] = new TocEntry(i, getText(i), mo[1]-1);\r
+ }\r
+ iterate(i);\r
+ }\r
+ }\r
+ }\r
+ iterate(el);\r
+ return result;\r
+ }\r
+\r
+ var toc = document.getElementById("toc");\r
+ if (!toc) {\r
+ return;\r
+ }\r
+\r
+ // Delete existing TOC entries in case we're reloading the TOC.\r
+ var tocEntriesToRemove = [];\r
+ var i;\r
+ for (i = 0; i < toc.childNodes.length; i++) {\r
+ var entry = toc.childNodes[i];\r
+ if (entry.nodeName == 'div'\r
+ && entry.getAttribute("class")\r
+ && entry.getAttribute("class").match(/^toclevel/))\r
+ tocEntriesToRemove.push(entry);\r
+ }\r
+ for (i = 0; i < tocEntriesToRemove.length; i++) {\r
+ toc.removeChild(tocEntriesToRemove[i]);\r
+ }\r
+\r
+ // Rebuild TOC entries.\r
+ var entries = tocEntries(document.getElementById("content"), toclevels);\r
+ for (var i = 0; i < entries.length; ++i) {\r
+ var entry = entries[i];\r
+ if (entry.element.id == "")\r
+ entry.element.id = "_toc_" + i;\r
+ var a = document.createElement("a");\r
+ a.href = "#" + entry.element.id;\r
+ a.appendChild(document.createTextNode(entry.text));\r
+ var div = document.createElement("div");\r
+ div.appendChild(a);\r
+ div.className = "toclevel" + entry.toclevel;\r
+ toc.appendChild(div);\r
+ }\r
+ if (entries.length == 0)\r
+ toc.parentNode.removeChild(toc);\r
+},\r
+\r
+\r
+/////////////////////////////////////////////////////////////////////\r
+// Footnotes generator\r
+/////////////////////////////////////////////////////////////////////\r
+\r
+/* Based on footnote generation code from:\r
+ * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html\r
+ */\r
+\r
+footnotes: function () {\r
+ // Delete existing footnote entries in case we're reloading the footnodes.\r
+ var i;\r
+ var noteholder = document.getElementById("footnotes");\r
+ if (!noteholder) {\r
+ return;\r
+ }\r
+ var entriesToRemove = [];\r
+ for (i = 0; i < noteholder.childNodes.length; i++) {\r
+ var entry = noteholder.childNodes[i];\r
+ if (entry.nodeName == 'div' && entry.getAttribute("class") == "footnote")\r
+ entriesToRemove.push(entry);\r
+ }\r
+ for (i = 0; i < entriesToRemove.length; i++) {\r
+ noteholder.removeChild(entriesToRemove[i]);\r
+ }\r
+\r
+ // Rebuild footnote entries.\r
+ var cont = document.getElementById("content");\r
+ var spans = cont.getElementsByTagName("span");\r
+ var refs = {};\r
+ var n = 0;\r
+ for (i=0; i<spans.length; i++) {\r
+ if (spans[i].className == "footnote") {\r
+ n++;\r
+ var note = spans[i].getAttribute("data-note");\r
+ if (!note) {\r
+ // Use [\s\S] in place of . so multi-line matches work.\r
+ // Because JavaScript has no s (dotall) regex flag.\r
+ note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];\r
+ spans[i].innerHTML =\r
+ "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +\r
+ "' title='View footnote' class='footnote'>" + n + "</a>]";\r
+ spans[i].setAttribute("data-note", note);\r
+ }\r
+ noteholder.innerHTML +=\r
+ "<div class='footnote' id='_footnote_" + n + "'>" +\r
+ "<a href='#_footnoteref_" + n + "' title='Return to text'>" +\r
+ n + "</a>. " + note + "</div>";\r
+ var id =spans[i].getAttribute("id");\r
+ if (id != null) refs["#"+id] = n;\r
+ }\r
+ }\r
+ if (n == 0)\r
+ noteholder.parentNode.removeChild(noteholder);\r
+ else {\r
+ // Process footnoterefs.\r
+ for (i=0; i<spans.length; i++) {\r
+ if (spans[i].className == "footnoteref") {\r
+ var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");\r
+ href = href.match(/#.*/)[0]; // Because IE return full URL.\r
+ n = refs[href];\r
+ spans[i].innerHTML =\r
+ "[<a href='#_footnote_" + n +\r
+ "' title='View footnote' class='footnote'>" + n + "</a>]";\r
+ }\r
+ }\r
+ }\r
+},\r
+\r
+install: function(toclevels) {\r
+ var timerId;\r
+\r
+ function reinstall() {\r
+ asciidoc.footnotes();\r
+ if (toclevels) {\r
+ asciidoc.toc(toclevels);\r
+ }\r
+ }\r
+\r
+ function reinstallAndRemoveTimer() {\r
+ clearInterval(timerId);\r
+ reinstall();\r
+ }\r
+\r
+ timerId = setInterval(reinstall, 500);\r
+ if (document.addEventListener)\r
+ document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);\r
+ else\r
+ window.onload = reinstallAndRemoveTimer;\r
+}\r
+\r
+}\r
+asciidoc.install();\r
+/*]]>*/\r
+</script>\r
+</head>\r
+<body class="manpage">\r
+<div id="header">\r
+<h1>\r
+zmq_null(7) Manual Page\r
+</h1>\r
+<h2>NAME</h2>\r
+<div class="sectionbody">\r
+<p>zmq_null -\r
+ no security or confidentiality\r
+</p>\r
+</div>\r
+</div>\r
+<div id="content">\r
+<div class="sect1">\r
+<h2 id="_synopsis">SYNOPSIS</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>The NULL mechanism is defined by the ZMTP 3.0 specification:\r
+<a href="http://rfc.zeromq.org/spec:23">http://rfc.zeromq.org/spec:23</a>. This is the default security mechanism\r
+for ZeroMQ sockets.</p></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_see_also">SEE ALSO</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p><a href="zmq_plain.html">zmq_plain(7)</a>\r
+<a href="zmq_curve.html">zmq_curve(7)</a>\r
+<a href="zmq.html">zmq(7)</a></p></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_authors">AUTHORS</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
+</div>\r
+</div>\r
+</div>\r
+<div id="footnotes"><hr /></div>\r
+<div id="footer">\r
+<div id="footer-text">\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
+</div>\r
+</div>\r
+</body>\r
+</html>\r
--- /dev/null
+zmq_null(7)
+===========
+
+
+NAME
+----
+zmq_null - no security or confidentiality
+
+
+SYNOPSIS
+--------
+The NULL mechanism is defined by the ZMTP 3.0 specification:
+<http://rfc.zeromq.org/spec:23>. This is the default security mechanism
+for ZeroMQ sockets.
+
+
+SEE ALSO
+--------
+linkzmq:zmq_plain[7]
+linkzmq:zmq_curve[7]
+linkzmq:zmq[7]
+
+
+AUTHORS
+-------
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_pgm
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.2
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_PGM" "7" "11/23/2012" "0MQ 3\&.2\&.2" "0MQ Manual"
+.TH "ZMQ_PGM" "7" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.sp -1
.IP \(bu 2.3
.\}
-The primary IPv4 address assigned to the interface, in it\(cqs numeric representation\&.
+The primary IPv4 address assigned to the interface, in its numeric representation\&.
.RE
.if n \{\
.sp
.sp .5v
.RE
.sp
-A \fImulticast address\fR is specified by an IPv4 multicast address in it\(cqs numeric representation\&.
+A \fImulticast address\fR is specified by an IPv4 multicast address in its numeric representation\&.
.SH "WIRE FORMAT"
.sp
Consecutive PGM datagrams are interpreted by 0MQ as a single continuous stream of data where 0MQ messages are not necessarily aligned with PGM datagram boundaries and a single 0MQ message may span several PGM datagrams\&. This stream of data consists of 0MQ messages encapsulated in \fIframes\fR as described in \fBzmq_tcp\fR(7)\&.
\fBzmq_connect\fR(3) \fBzmq_setsockopt\fR(3) \fBzmq_tcp\fR(7) \fBzmq_ipc\fR(7) \fBzmq_inproc\fR(7) \fBzmq\fR(7)
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Pieter Hintjens <\m[blue]\fBph@imatix\&.com\fR\m[]\&\s-2\u[1]\d\s+2>, Martin Sustrik <\m[blue]\fBsustrik@250bpm\&.com\fR\m[]\&\s-2\u[2]\d\s+2> and Martin Lucina <\m[blue]\fBmato@kotelna\&.sk\fR\m[]\&\s-2\u[3]\d\s+2>\&.
-.SH "NOTES"
-.IP " 1." 4
-ph@imatix.com
-.RS 4
-\%mailto:ph@imatix.com
-.RE
-.IP " 2." 4
-sustrik@250bpm.com
-.RS 4
-\%mailto:sustrik@250bpm.com
-.RE
-.IP " 3." 4
-mato@kotelna.sk
-.RS 4
-\%mailto:mato@kotelna.sk
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
</li>\r
<li>\r
<p>\r
-The primary IPv4 address assigned to the interface, in it’s numeric\r
+The primary IPv4 address assigned to the interface, in its numeric\r
representation.\r
</p>\r
</li>\r
will be selected.</td>\r
</tr></table>\r
</div>\r
-<div class="paragraph"><p>A <em>multicast address</em> is specified by an IPv4 multicast address in it’s numeric\r
+<div class="paragraph"><p>A <em>multicast address</em> is specified by an IPv4 multicast address in its numeric\r
representation.</p></div>\r
</div>\r
</div>\r
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Pieter Hintjens <<a href="mailto:ph@imatix.com">ph@imatix.com</a>>,\r
-Martin Sustrik <<a href="mailto:sustrik@250bpm.com">sustrik@250bpm.com</a>> and Martin Lucina <<a href="mailto:mato@kotelna.sk">mato@kotelna.sk</a>>.</p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-11-14 10:09:14 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
An 'interface' may be specified by either of the following:
* The interface name as defined by the operating system.
-* The primary IPv4 address assigned to the interface, in it's numeric
+* The primary IPv4 address assigned to the interface, in its numeric
representation.
NOTE: Interface names are not standardised in any way and should be assumed to
'interface'. The 'interface' part can be omitted, in that case the default one
will be selected.
-A 'multicast address' is specified by an IPv4 multicast address in it's numeric
+A 'multicast address' is specified by an IPv4 multicast address in its numeric
representation.
linkzmq:zmq_inproc[7]
linkzmq:zmq[7]
+
AUTHORS
-------
-This 0MQ manual page was written by Pieter Hintjens <ph@imatix.com>,
-Martin Sustrik <sustrik@250bpm.com> and Martin Lucina <mato@kotelna.sk>.
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
--- /dev/null
+'\" t
+.\" Title: zmq_plain
+.\" Author: [see the "AUTHORS" section]
+.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
+.\" Date: 03/10/2014
+.\" Manual: 0MQ Manual
+.\" Source: 0MQ 4.0.1
+.\" Language: English
+.\"
+.TH "ZMQ_PLAIN" "7" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+zmq_plain \- clear\-text authentication
+.SH "SYNOPSIS"
+.sp
+The PLAIN mechanism defines a simple username/password mechanism that lets a server authenticate a client\&. PLAIN makes no attempt at security or confidentiality\&. It is intended for use on internal networks where security requirements are low\&. The PLAIN mechanism is defined by this document: \m[blue]\fBhttp://rfc\&.zeromq\&.org/spec:24\fR\m[]\&.
+.SH "USAGE"
+.sp
+To use PLAIN, the server shall set the ZMQ_PLAIN_SERVER option, and the client shall set the ZMQ_PLAIN_USERNAME and ZMQ_PLAIN_PASSWORD socket options\&. Which peer binds, and which connects, is not relevant\&.
+.SH "SEE ALSO"
+.sp
+\fBzmq_setsockopt\fR(3) \fBzmq_null\fR(7) \fBzmq_curve\fR(7) \fBzmq\fR(7)
+.SH "AUTHORS"
+.sp
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"\r
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">\r
+<head>\r
+<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />\r
+<meta name="generator" content="AsciiDoc 8.6.6" />\r
+<title>zmq_plain(7)</title>\r
+<style type="text/css">\r
+/* Shared CSS for AsciiDoc xhtml11 and html5 backends */\r
+\r
+/* Default font. */\r
+body {\r
+ font-family: Georgia,serif;\r
+}\r
+\r
+/* Title font. */\r
+h1, h2, h3, h4, h5, h6,\r
+div.title, caption.title,\r
+thead, p.table.header,\r
+#toctitle,\r
+#author, #revnumber, #revdate, #revremark,\r
+#footer {\r
+ font-family: Arial,Helvetica,sans-serif;\r
+}\r
+\r
+body {\r
+ margin: 1em 5% 1em 5%;\r
+}\r
+\r
+a {\r
+ color: blue;\r
+ text-decoration: underline;\r
+}\r
+a:visited {\r
+ color: fuchsia;\r
+}\r
+\r
+em {\r
+ font-style: italic;\r
+ color: navy;\r
+}\r
+\r
+strong {\r
+ font-weight: bold;\r
+ color: #083194;\r
+}\r
+\r
+h1, h2, h3, h4, h5, h6 {\r
+ color: #527bbd;\r
+ margin-top: 1.2em;\r
+ margin-bottom: 0.5em;\r
+ line-height: 1.3;\r
+}\r
+\r
+h1, h2, h3 {\r
+ border-bottom: 2px solid silver;\r
+}\r
+h2 {\r
+ padding-top: 0.5em;\r
+}\r
+h3 {\r
+ float: left;\r
+}\r
+h3 + * {\r
+ clear: left;\r
+}\r
+h5 {\r
+ font-size: 1.0em;\r
+}\r
+\r
+div.sectionbody {\r
+ margin-left: 0;\r
+}\r
+\r
+hr {\r
+ border: 1px solid silver;\r
+}\r
+\r
+p {\r
+ margin-top: 0.5em;\r
+ margin-bottom: 0.5em;\r
+}\r
+\r
+ul, ol, li > p {\r
+ margin-top: 0;\r
+}\r
+ul > li { color: #aaa; }\r
+ul > li > * { color: black; }\r
+\r
+pre {\r
+ padding: 0;\r
+ margin: 0;\r
+}\r
+\r
+#author {\r
+ color: #527bbd;\r
+ font-weight: bold;\r
+ font-size: 1.1em;\r
+}\r
+#email {\r
+}\r
+#revnumber, #revdate, #revremark {\r
+}\r
+\r
+#footer {\r
+ font-size: small;\r
+ border-top: 2px solid silver;\r
+ padding-top: 0.5em;\r
+ margin-top: 4.0em;\r
+}\r
+#footer-text {\r
+ float: left;\r
+ padding-bottom: 0.5em;\r
+}\r
+#footer-badges {\r
+ float: right;\r
+ padding-bottom: 0.5em;\r
+}\r
+\r
+#preamble {\r
+ margin-top: 1.5em;\r
+ margin-bottom: 1.5em;\r
+}\r
+div.imageblock, div.exampleblock, div.verseblock,\r
+div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,\r
+div.admonitionblock {\r
+ margin-top: 1.0em;\r
+ margin-bottom: 1.5em;\r
+}\r
+div.admonitionblock {\r
+ margin-top: 2.0em;\r
+ margin-bottom: 2.0em;\r
+ margin-right: 10%;\r
+ color: #606060;\r
+}\r
+\r
+div.content { /* Block element content. */\r
+ padding: 0;\r
+}\r
+\r
+/* Block element titles. */\r
+div.title, caption.title {\r
+ color: #527bbd;\r
+ font-weight: bold;\r
+ text-align: left;\r
+ margin-top: 1.0em;\r
+ margin-bottom: 0.5em;\r
+}\r
+div.title + * {\r
+ margin-top: 0;\r
+}\r
+\r
+td div.title:first-child {\r
+ margin-top: 0.0em;\r
+}\r
+div.content div.title:first-child {\r
+ margin-top: 0.0em;\r
+}\r
+div.content + div.title {\r
+ margin-top: 0.0em;\r
+}\r
+\r
+div.sidebarblock > div.content {\r
+ background: #ffffee;\r
+ border: 1px solid #dddddd;\r
+ border-left: 4px solid #f0f0f0;\r
+ padding: 0.5em;\r
+}\r
+\r
+div.listingblock > div.content {\r
+ border: 1px solid #dddddd;\r
+ border-left: 5px solid #f0f0f0;\r
+ background: #f8f8f8;\r
+ padding: 0.5em;\r
+}\r
+\r
+div.quoteblock, div.verseblock {\r
+ padding-left: 1.0em;\r
+ margin-left: 1.0em;\r
+ margin-right: 10%;\r
+ border-left: 5px solid #f0f0f0;\r
+ color: #888;\r
+}\r
+\r
+div.quoteblock > div.attribution {\r
+ padding-top: 0.5em;\r
+ text-align: right;\r
+}\r
+\r
+div.verseblock > pre.content {\r
+ font-family: inherit;\r
+ font-size: inherit;\r
+}\r
+div.verseblock > div.attribution {\r
+ padding-top: 0.75em;\r
+ text-align: left;\r
+}\r
+/* DEPRECATED: Pre version 8.2.7 verse style literal block. */\r
+div.verseblock + div.attribution {\r
+ text-align: left;\r
+}\r
+\r
+div.admonitionblock .icon {\r
+ vertical-align: top;\r
+ font-size: 1.1em;\r
+ font-weight: bold;\r
+ text-decoration: underline;\r
+ color: #527bbd;\r
+ padding-right: 0.5em;\r
+}\r
+div.admonitionblock td.content {\r
+ padding-left: 0.5em;\r
+ border-left: 3px solid #dddddd;\r
+}\r
+\r
+div.exampleblock > div.content {\r
+ border-left: 3px solid #dddddd;\r
+ padding-left: 0.5em;\r
+}\r
+\r
+div.imageblock div.content { padding-left: 0; }\r
+span.image img { border-style: none; }\r
+a.image:visited { color: white; }\r
+\r
+dl {\r
+ margin-top: 0.8em;\r
+ margin-bottom: 0.8em;\r
+}\r
+dt {\r
+ margin-top: 0.5em;\r
+ margin-bottom: 0;\r
+ font-style: normal;\r
+ color: navy;\r
+}\r
+dd > *:first-child {\r
+ margin-top: 0.1em;\r
+}\r
+\r
+ul, ol {\r
+ list-style-position: outside;\r
+}\r
+ol.arabic {\r
+ list-style-type: decimal;\r
+}\r
+ol.loweralpha {\r
+ list-style-type: lower-alpha;\r
+}\r
+ol.upperalpha {\r
+ list-style-type: upper-alpha;\r
+}\r
+ol.lowerroman {\r
+ list-style-type: lower-roman;\r
+}\r
+ol.upperroman {\r
+ list-style-type: upper-roman;\r
+}\r
+\r
+div.compact ul, div.compact ol,\r
+div.compact p, div.compact p,\r
+div.compact div, div.compact div {\r
+ margin-top: 0.1em;\r
+ margin-bottom: 0.1em;\r
+}\r
+\r
+tfoot {\r
+ font-weight: bold;\r
+}\r
+td > div.verse {\r
+ white-space: pre;\r
+}\r
+\r
+div.hdlist {\r
+ margin-top: 0.8em;\r
+ margin-bottom: 0.8em;\r
+}\r
+div.hdlist tr {\r
+ padding-bottom: 15px;\r
+}\r
+dt.hdlist1.strong, td.hdlist1.strong {\r
+ font-weight: bold;\r
+}\r
+td.hdlist1 {\r
+ vertical-align: top;\r
+ font-style: normal;\r
+ padding-right: 0.8em;\r
+ color: navy;\r
+}\r
+td.hdlist2 {\r
+ vertical-align: top;\r
+}\r
+div.hdlist.compact tr {\r
+ margin: 0;\r
+ padding-bottom: 0;\r
+}\r
+\r
+.comment {\r
+ background: yellow;\r
+}\r
+\r
+.footnote, .footnoteref {\r
+ font-size: 0.8em;\r
+}\r
+\r
+span.footnote, span.footnoteref {\r
+ vertical-align: super;\r
+}\r
+\r
+#footnotes {\r
+ margin: 20px 0 20px 0;\r
+ padding: 7px 0 0 0;\r
+}\r
+\r
+#footnotes div.footnote {\r
+ margin: 0 0 5px 0;\r
+}\r
+\r
+#footnotes hr {\r
+ border: none;\r
+ border-top: 1px solid silver;\r
+ height: 1px;\r
+ text-align: left;\r
+ margin-left: 0;\r
+ width: 20%;\r
+ min-width: 100px;\r
+}\r
+\r
+div.colist td {\r
+ padding-right: 0.5em;\r
+ padding-bottom: 0.3em;\r
+ vertical-align: top;\r
+}\r
+div.colist td img {\r
+ margin-top: 0.3em;\r
+}\r
+\r
+@media print {\r
+ #footer-badges { display: none; }\r
+}\r
+\r
+#toc {\r
+ margin-bottom: 2.5em;\r
+}\r
+\r
+#toctitle {\r
+ color: #527bbd;\r
+ font-size: 1.1em;\r
+ font-weight: bold;\r
+ margin-top: 1.0em;\r
+ margin-bottom: 0.1em;\r
+}\r
+\r
+div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {\r
+ margin-top: 0;\r
+ margin-bottom: 0;\r
+}\r
+div.toclevel2 {\r
+ margin-left: 2em;\r
+ font-size: 0.9em;\r
+}\r
+div.toclevel3 {\r
+ margin-left: 4em;\r
+ font-size: 0.9em;\r
+}\r
+div.toclevel4 {\r
+ margin-left: 6em;\r
+ font-size: 0.9em;\r
+}\r
+\r
+span.aqua { color: aqua; }\r
+span.black { color: black; }\r
+span.blue { color: blue; }\r
+span.fuchsia { color: fuchsia; }\r
+span.gray { color: gray; }\r
+span.green { color: green; }\r
+span.lime { color: lime; }\r
+span.maroon { color: maroon; }\r
+span.navy { color: navy; }\r
+span.olive { color: olive; }\r
+span.purple { color: purple; }\r
+span.red { color: red; }\r
+span.silver { color: silver; }\r
+span.teal { color: teal; }\r
+span.white { color: white; }\r
+span.yellow { color: yellow; }\r
+\r
+span.aqua-background { background: aqua; }\r
+span.black-background { background: black; }\r
+span.blue-background { background: blue; }\r
+span.fuchsia-background { background: fuchsia; }\r
+span.gray-background { background: gray; }\r
+span.green-background { background: green; }\r
+span.lime-background { background: lime; }\r
+span.maroon-background { background: maroon; }\r
+span.navy-background { background: navy; }\r
+span.olive-background { background: olive; }\r
+span.purple-background { background: purple; }\r
+span.red-background { background: red; }\r
+span.silver-background { background: silver; }\r
+span.teal-background { background: teal; }\r
+span.white-background { background: white; }\r
+span.yellow-background { background: yellow; }\r
+\r
+span.big { font-size: 2em; }\r
+span.small { font-size: 0.6em; }\r
+\r
+span.underline { text-decoration: underline; }\r
+span.overline { text-decoration: overline; }\r
+span.line-through { text-decoration: line-through; }\r
+\r
+\r
+/*\r
+ * xhtml11 specific\r
+ *\r
+ * */\r
+\r
+tt {\r
+ font-family: monospace;\r
+ font-size: inherit;\r
+ color: navy;\r
+}\r
+\r
+div.tableblock {\r
+ margin-top: 1.0em;\r
+ margin-bottom: 1.5em;\r
+}\r
+div.tableblock > table {\r
+ border: 3px solid #527bbd;\r
+}\r
+thead, p.table.header {\r
+ font-weight: bold;\r
+ color: #527bbd;\r
+}\r
+p.table {\r
+ margin-top: 0;\r
+}\r
+/* Because the table frame attribute is overriden by CSS in most browsers. */\r
+div.tableblock > table[frame="void"] {\r
+ border-style: none;\r
+}\r
+div.tableblock > table[frame="hsides"] {\r
+ border-left-style: none;\r
+ border-right-style: none;\r
+}\r
+div.tableblock > table[frame="vsides"] {\r
+ border-top-style: none;\r
+ border-bottom-style: none;\r
+}\r
+\r
+\r
+/*\r
+ * html5 specific\r
+ *\r
+ * */\r
+\r
+.monospaced {\r
+ font-family: monospace;\r
+ font-size: inherit;\r
+ color: navy;\r
+}\r
+\r
+table.tableblock {\r
+ margin-top: 1.0em;\r
+ margin-bottom: 1.5em;\r
+}\r
+thead, p.tableblock.header {\r
+ font-weight: bold;\r
+ color: #527bbd;\r
+}\r
+p.tableblock {\r
+ margin-top: 0;\r
+}\r
+table.tableblock {\r
+ border-width: 3px;\r
+ border-spacing: 0px;\r
+ border-style: solid;\r
+ border-color: #527bbd;\r
+ border-collapse: collapse;\r
+}\r
+th.tableblock, td.tableblock {\r
+ border-width: 1px;\r
+ padding: 4px;\r
+ border-style: solid;\r
+ border-color: #527bbd;\r
+}\r
+\r
+table.tableblock.frame-topbot {\r
+ border-left-style: hidden;\r
+ border-right-style: hidden;\r
+}\r
+table.tableblock.frame-sides {\r
+ border-top-style: hidden;\r
+ border-bottom-style: hidden;\r
+}\r
+table.tableblock.frame-none {\r
+ border-style: hidden;\r
+}\r
+\r
+th.tableblock.halign-left, td.tableblock.halign-left {\r
+ text-align: left;\r
+}\r
+th.tableblock.halign-center, td.tableblock.halign-center {\r
+ text-align: center;\r
+}\r
+th.tableblock.halign-right, td.tableblock.halign-right {\r
+ text-align: right;\r
+}\r
+\r
+th.tableblock.valign-top, td.tableblock.valign-top {\r
+ vertical-align: top;\r
+}\r
+th.tableblock.valign-middle, td.tableblock.valign-middle {\r
+ vertical-align: middle;\r
+}\r
+th.tableblock.valign-bottom, td.tableblock.valign-bottom {\r
+ vertical-align: bottom;\r
+}\r
+\r
+\r
+/*\r
+ * manpage specific\r
+ *\r
+ * */\r
+\r
+body.manpage h1 {\r
+ padding-top: 0.5em;\r
+ padding-bottom: 0.5em;\r
+ border-top: 2px solid silver;\r
+ border-bottom: 2px solid silver;\r
+}\r
+body.manpage h2 {\r
+ border-style: none;\r
+}\r
+body.manpage div.sectionbody {\r
+ margin-left: 3em;\r
+}\r
+\r
+@media print {\r
+ body.manpage div#toc { display: none; }\r
+}\r
+</style>\r
+<script type="text/javascript">\r
+/*<+'])');\r
+ // Function that scans the DOM tree for header elements (the DOM2\r
+ // nodeIterator API would be a better technique but not supported by all\r
+ // browsers).\r
+ var iterate = function (el) {\r
+ for (var i = el.firstChild; i != null; i = i.nextSibling) {\r
+ if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {\r
+ var mo = re.exec(i.tagName);\r
+ if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {\r
+ result[result.length] = new TocEntry(i, getText(i), mo[1]-1);\r
+ }\r
+ iterate(i);\r
+ }\r
+ }\r
+ }\r
+ iterate(el);\r
+ return result;\r
+ }\r
+\r
+ var toc = document.getElementById("toc");\r
+ if (!toc) {\r
+ return;\r
+ }\r
+\r
+ // Delete existing TOC entries in case we're reloading the TOC.\r
+ var tocEntriesToRemove = [];\r
+ var i;\r
+ for (i = 0; i < toc.childNodes.length; i++) {\r
+ var entry = toc.childNodes[i];\r
+ if (entry.nodeName == 'div'\r
+ && entry.getAttribute("class")\r
+ && entry.getAttribute("class").match(/^toclevel/))\r
+ tocEntriesToRemove.push(entry);\r
+ }\r
+ for (i = 0; i < tocEntriesToRemove.length; i++) {\r
+ toc.removeChild(tocEntriesToRemove[i]);\r
+ }\r
+\r
+ // Rebuild TOC entries.\r
+ var entries = tocEntries(document.getElementById("content"), toclevels);\r
+ for (var i = 0; i < entries.length; ++i) {\r
+ var entry = entries[i];\r
+ if (entry.element.id == "")\r
+ entry.element.id = "_toc_" + i;\r
+ var a = document.createElement("a");\r
+ a.href = "#" + entry.element.id;\r
+ a.appendChild(document.createTextNode(entry.text));\r
+ var div = document.createElement("div");\r
+ div.appendChild(a);\r
+ div.className = "toclevel" + entry.toclevel;\r
+ toc.appendChild(div);\r
+ }\r
+ if (entries.length == 0)\r
+ toc.parentNode.removeChild(toc);\r
+},\r
+\r
+\r
+/////////////////////////////////////////////////////////////////////\r
+// Footnotes generator\r
+/////////////////////////////////////////////////////////////////////\r
+\r
+/* Based on footnote generation code from:\r
+ * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html\r
+ */\r
+\r
+footnotes: function () {\r
+ // Delete existing footnote entries in case we're reloading the footnodes.\r
+ var i;\r
+ var noteholder = document.getElementById("footnotes");\r
+ if (!noteholder) {\r
+ return;\r
+ }\r
+ var entriesToRemove = [];\r
+ for (i = 0; i < noteholder.childNodes.length; i++) {\r
+ var entry = noteholder.childNodes[i];\r
+ if (entry.nodeName == 'div' && entry.getAttribute("class") == "footnote")\r
+ entriesToRemove.push(entry);\r
+ }\r
+ for (i = 0; i < entriesToRemove.length; i++) {\r
+ noteholder.removeChild(entriesToRemove[i]);\r
+ }\r
+\r
+ // Rebuild footnote entries.\r
+ var cont = document.getElementById("content");\r
+ var spans = cont.getElementsByTagName("span");\r
+ var refs = {};\r
+ var n = 0;\r
+ for (i=0; i<spans.length; i++) {\r
+ if (spans[i].className == "footnote") {\r
+ n++;\r
+ var note = spans[i].getAttribute("data-note");\r
+ if (!note) {\r
+ // Use [\s\S] in place of . so multi-line matches work.\r
+ // Because JavaScript has no s (dotall) regex flag.\r
+ note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];\r
+ spans[i].innerHTML =\r
+ "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +\r
+ "' title='View footnote' class='footnote'>" + n + "</a>]";\r
+ spans[i].setAttribute("data-note", note);\r
+ }\r
+ noteholder.innerHTML +=\r
+ "<div class='footnote' id='_footnote_" + n + "'>" +\r
+ "<a href='#_footnoteref_" + n + "' title='Return to text'>" +\r
+ n + "</a>. " + note + "</div>";\r
+ var id =spans[i].getAttribute("id");\r
+ if (id != null) refs["#"+id] = n;\r
+ }\r
+ }\r
+ if (n == 0)\r
+ noteholder.parentNode.removeChild(noteholder);\r
+ else {\r
+ // Process footnoterefs.\r
+ for (i=0; i<spans.length; i++) {\r
+ if (spans[i].className == "footnoteref") {\r
+ var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");\r
+ href = href.match(/#.*/)[0]; // Because IE return full URL.\r
+ n = refs[href];\r
+ spans[i].innerHTML =\r
+ "[<a href='#_footnote_" + n +\r
+ "' title='View footnote' class='footnote'>" + n + "</a>]";\r
+ }\r
+ }\r
+ }\r
+},\r
+\r
+install: function(toclevels) {\r
+ var timerId;\r
+\r
+ function reinstall() {\r
+ asciidoc.footnotes();\r
+ if (toclevels) {\r
+ asciidoc.toc(toclevels);\r
+ }\r
+ }\r
+\r
+ function reinstallAndRemoveTimer() {\r
+ clearInterval(timerId);\r
+ reinstall();\r
+ }\r
+\r
+ timerId = setInterval(reinstall, 500);\r
+ if (document.addEventListener)\r
+ document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);\r
+ else\r
+ window.onload = reinstallAndRemoveTimer;\r
+}\r
+\r
+}\r
+asciidoc.install();\r
+/*]]>*/\r
+</script>\r
+</head>\r
+<body class="manpage">\r
+<div id="header">\r
+<h1>\r
+zmq_plain(7) Manual Page\r
+</h1>\r
+<h2>NAME</h2>\r
+<div class="sectionbody">\r
+<p>zmq_plain -\r
+ clear-text authentication\r
+</p>\r
+</div>\r
+</div>\r
+<div id="content">\r
+<div class="sect1">\r
+<h2 id="_synopsis">SYNOPSIS</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>The PLAIN mechanism defines a simple username/password mechanism that\r
+lets a server authenticate a client. PLAIN makes no attempt at security\r
+or confidentiality. It is intended for use on internal networks where\r
+security requirements are low. The PLAIN mechanism is defined by this\r
+document: <a href="http://rfc.zeromq.org/spec:24">http://rfc.zeromq.org/spec:24</a>.</p></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_usage">USAGE</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>To use PLAIN, the server shall set the ZMQ_PLAIN_SERVER option, and the\r
+client shall set the ZMQ_PLAIN_USERNAME and ZMQ_PLAIN_PASSWORD socket\r
+options. Which peer binds, and which connects, is not relevant.</p></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_see_also">SEE ALSO</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p><a href="zmq_setsockopt.html">zmq_setsockopt(3)</a>\r
+<a href="zmq_null.html">zmq_null(7)</a>\r
+<a href="zmq_curve.html">zmq_curve(7)</a>\r
+<a href="zmq.html">zmq(7)</a></p></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_authors">AUTHORS</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
+</div>\r
+</div>\r
+</div>\r
+<div id="footnotes"><hr /></div>\r
+<div id="footer">\r
+<div id="footer-text">\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
+</div>\r
+</div>\r
+</body>\r
+</html>\r
--- /dev/null
+zmq_plain(7)
+============
+
+
+NAME
+----
+zmq_plain - clear-text authentication
+
+
+SYNOPSIS
+--------
+The PLAIN mechanism defines a simple username/password mechanism that
+lets a server authenticate a client. PLAIN makes no attempt at security
+or confidentiality. It is intended for use on internal networks where
+security requirements are low. The PLAIN mechanism is defined by this
+document: <http://rfc.zeromq.org/spec:24>.
+
+
+USAGE
+-----
+To use PLAIN, the server shall set the ZMQ_PLAIN_SERVER option, and the
+client shall set the ZMQ_PLAIN_USERNAME and ZMQ_PLAIN_PASSWORD socket
+options. Which peer binds, and which connects, is not relevant.
+
+
+SEE ALSO
+--------
+linkzmq:zmq_setsockopt[3]
+linkzmq:zmq_null[7]
+linkzmq:zmq_curve[7]
+linkzmq:zmq[7]
+
+
+AUTHORS
+-------
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_poll
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.1
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_POLL" "3" "11/23/2012" "0MQ 3\&.2\&.1" "0MQ Manual"
+.TH "ZMQ_POLL" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
The \fIzmq_poll()\fR function may be implemented or emulated using operating system interfaces other than \fIpoll()\fR, and as such may be subject to the limits of those interfaces in ways not defined in this documentation\&.
.sp .5v
.RE
-.if n \{\
-.sp
-.\}
-.RS 4
-.it 1 an-trap
-.nr an-no-space-flag 1
-.nr an-break-flag 1
-.br
-.ps +1
-\fBNote\fR
-.ps -1
-.br
-.sp
-The \fIzmq_send()\fR function will clear all pending events on a socket\&. Thus, if you use \fIzmq_poll()\fR to monitor input on a socket, use it before output as well, and process all events after each \fIzmq_poll()\fR call\&.
-.sp .5v
-.RE
.SH "RETURN VALUE"
.sp
Upon successful completion, the \fIzmq_poll()\fR function shall return the number of \fBzmq_pollitem_t\fR structures with events signaled in \fIrevents\fR or 0 if no events have been signaled\&. Upon failure, \fIzmq_poll()\fR shall return \-1 and set \fIerrno\fR to one of the values defined below\&.
Your operating system documentation for the \fIpoll()\fR system call\&.
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Martin Sustrik <\m[blue]\fBsustrik@250bpm\&.com\fR\m[]\&\s-2\u[1]\d\s+2> and Martin Lucina <\m[blue]\fBmato@kotelna\&.sk\fR\m[]\&\s-2\u[2]\d\s+2>\&.
-.SH "NOTES"
-.IP " 1." 4
-sustrik@250bpm.com
-.RS 4
-\%mailto:sustrik@250bpm.com
-.RE
-.IP " 2." 4
-mato@kotelna.sk
-.RS 4
-\%mailto:mato@kotelna.sk
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
of those interfaces in ways not defined in this documentation.</td>\r
</tr></table>\r
</div>\r
-<div class="admonitionblock">\r
-<table><tr>\r
-<td class="icon">\r
-<div class="title">Note</div>\r
-</td>\r
-<td class="content">The <em>zmq_send()</em> function will clear all pending events on a socket. Thus,\r
-if you use <em>zmq_poll()</em> to monitor input on a socket, use it before output as\r
-well, and process all events after each <em>zmq_poll()</em> call.</td>\r
-</tr></table>\r
-</div>\r
</div>\r
</div>\r
<div class="sect1">\r
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Martin Sustrik <<a href="mailto:sustrik@250bpm.com">sustrik@250bpm.com</a>> and\r
-Martin Lucina <<a href="mailto:mato@kotelna.sk">mato@kotelna.sk</a>>.</p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-10-25 17:30:40 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
system interfaces other than _poll()_, and as such may be subject to the limits
of those interfaces in ways not defined in this documentation.
-NOTE: The _zmq_send()_ function will clear all pending events on a socket. Thus,
-if you use _zmq_poll()_ to monitor input on a socket, use it before output as
-well, and process all events after each _zmq_poll()_ call.
-
RETURN VALUE
------------
Upon successful completion, the _zmq_poll()_ function shall return the number
AUTHORS
-------
-This 0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
-Martin Lucina <mato@kotelna.sk>.
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_proxy
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.1
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_PROXY" "3" "11/23/2012" "0MQ 3\&.2\&.1" "0MQ Manual"
+.TH "ZMQ_PROXY" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
\fBzmq_bind\fR(3) \fBzmq_connect\fR(3) \fBzmq_socket\fR(3) \fBzmq\fR(7)
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Pieter Hintjens <\m[blue]\fBph@imatix\&.com\fR\m[]\&\s-2\u[1]\d\s+2>
-.SH "NOTES"
-.IP " 1." 4
-ph@imatix.com
-.RS 4
-\%mailto:ph@imatix.com
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Pieter Hintjens <<a href="mailto:ph@imatix.com">ph@imatix.com</a>></p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-10-25 17:30:40 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
AUTHORS
-------
-This 0MQ manual page was written by Pieter Hintjens <ph@imatix.com>
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_recv
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.1
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_RECV" "3" "11/23/2012" "0MQ 3\&.2\&.1" "0MQ Manual"
+.TH "ZMQ_RECV" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.sp
.SH "SEE ALSO"
.sp
-\fBzmq_recvmsg\fR(3) \fBzmq_send\fR(3) \fBzmq_sendmsg\fR(3) \fBzmq_getsockopt\fR(3) \fBzmq_socket\fR(7) \fBzmq\fR(7)
+\fBzmq_send\fR(3) \fBzmq_getsockopt\fR(3) \fBzmq_socket\fR(7) \fBzmq\fR(7)
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Martin Sustrik <\m[blue]\fBsustrik@250bpm\&.com\fR\m[]\&\s-2\u[1]\d\s+2> and Martin Lucina <\m[blue]\fBmato@kotelna\&.sk\fR\m[]\&\s-2\u[2]\d\s+2>, and Pieter Hintjens <\m[blue]\fBph@imatix\&.com\fR\m[]\&\s-2\u[3]\d\s+2>\&.
-.SH "NOTES"
-.IP " 1." 4
-sustrik@250bpm.com
-.RS 4
-\%mailto:sustrik@250bpm.com
-.RE
-.IP " 2." 4
-mato@kotelna.sk
-.RS 4
-\%mailto:mato@kotelna.sk
-.RE
-.IP " 3." 4
-ph@imatix.com
-.RS 4
-\%mailto:ph@imatix.com
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
<div class="sect1">\r
<h2 id="_see_also">SEE ALSO</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p><a href="zmq_recvmsg.html">zmq_recvmsg(3)</a>\r
-<a href="zmq_send.html">zmq_send(3)</a>\r
-<a href="zmq_sendmsg.html">zmq_sendmsg(3)</a>\r
+<div class="paragraph"><p><a href="zmq_send.html">zmq_send(3)</a>\r
<a href="zmq_getsockopt.html">zmq_getsockopt(3)</a>\r
<a href="zmq_socket.html">zmq_socket(7)</a>\r
<a href="zmq.html">zmq(7)</a></p></div>\r
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Martin Sustrik <<a href="mailto:sustrik@250bpm.com">sustrik@250bpm.com</a>> and\r
-Martin Lucina <<a href="mailto:mato@kotelna.sk">mato@kotelna.sk</a>>, and Pieter Hintjens <<a href="mailto:ph@imatix.com">ph@imatix.com</a>>.</p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-10-25 17:30:40 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
SEE ALSO
--------
-linkzmq:zmq_recvmsg[3]
linkzmq:zmq_send[3]
-linkzmq:zmq_sendmsg[3]
linkzmq:zmq_getsockopt[3]
linkzmq:zmq_socket[7]
linkzmq:zmq[7]
AUTHORS
-------
-This 0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
-Martin Lucina <mato@kotelna.sk>, and Pieter Hintjens <ph@imatix.com>.
-
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_recvmsg
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.2
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_RECVMSG" "3" "11/23/2012" "0MQ 3\&.2\&.2" "0MQ Manual"
+.TH "ZMQ_RECVMSG" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\}
.nf
int64_t more;
-size_t more_size = sizeof more;
+size_t more_size = sizeof (more);
do {
/* Create an empty 0MQ message to hold the message part */
zmq_msg_t part;
.sp
.SH "SEE ALSO"
.sp
-\fBzmq_recv\fR(3) \fBzmq_send\fR(3) \fBzmq_sendmsg\fR(3) \fBzmq_getsockopt\fR(3) \fBzmq_socket\fR(7) \fBzmq\fR(7)
+\fBzmq_recv\fR(3) \fBzmq_send\fR(3) \fBzmq_getsockopt\fR(3) \fBzmq_socket\fR(7) \fBzmq\fR(7)
.SH "AUTHORS"
.sp
-This man page was written by Martin Sustrik <\m[blue]\fBsustrik@250bpm\&.com\fR\m[]\&\s-2\u[1]\d\s+2>, Martin Lucina <\m[blue]\fBmartin@lucina\&.net\fR\m[]\&\s-2\u[2]\d\s+2> and Pieter Hintjens <\m[blue]\fBph@imatix\&.com\fR\m[]\&\s-2\u[3]\d\s+2>\&.
-.SH "NOTES"
-.IP " 1." 4
-sustrik@250bpm.com
-.RS 4
-\%mailto:sustrik@250bpm.com
-.RE
-.IP " 2." 4
-martin@lucina.net
-.RS 4
-\%mailto:martin@lucina.net
-.RE
-.IP " 3." 4
-ph@imatix.com
-.RS 4
-\%mailto:ph@imatix.com
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
<div class="title">Receiving a multi-part message</div>\r
<div class="content">\r
<pre><tt>int64_t more;\r
-size_t more_size = sizeof more;\r
+size_t more_size = sizeof (more);\r
do {\r
/* Create an empty 0MQ message to hold the message part */\r
zmq_msg_t part;\r
<div class="sectionbody">\r
<div class="paragraph"><p><a href="zmq_recv.html">zmq_recv(3)</a>\r
<a href="zmq_send.html">zmq_send(3)</a>\r
-<a href="zmq_sendmsg.html">zmq_sendmsg(3)</a>\r
<a href="zmq_getsockopt.html">zmq_getsockopt(3)</a>\r
<a href="zmq_socket.html">zmq_socket(7)</a>\r
<a href="zmq.html">zmq(7)</a></p></div>\r
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This man page was written by Martin Sustrik <<a href="mailto:sustrik@250bpm.com">sustrik@250bpm.com</a>>, Martin\r
-Lucina <<a href="mailto:martin@lucina.net">martin@lucina.net</a>> and Pieter Hintjens <<a href="mailto:ph@imatix.com">ph@imatix.com</a>>.</p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-11-14 10:09:14 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
.Receiving a multi-part message
----
int64_t more;
-size_t more_size = sizeof more;
+size_t more_size = sizeof (more);
do {
/* Create an empty 0MQ message to hold the message part */
zmq_msg_t part;
--------
linkzmq:zmq_recv[3]
linkzmq:zmq_send[3]
-linkzmq:zmq_sendmsg[3]
linkzmq:zmq_getsockopt[3]
linkzmq:zmq_socket[7]
linkzmq:zmq[7]
AUTHORS
-------
-This man page was written by Martin Sustrik <sustrik@250bpm.com>, Martin
-Lucina <martin@lucina.net> and Pieter Hintjens <ph@imatix.com>.
-
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_send
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.1
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_SEND" "3" "11/23/2012" "0MQ 3\&.2\&.1" "0MQ Manual"
+.TH "ZMQ_SEND" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.PP
\fBZMQ_DONTWAIT\fR
.RS 4
-Specifies that the operation should be performed in non\-blocking mode\&. If the message cannot be queued on the
+For socket types (DEALER, PUSH) that block when there are no available peers (or all peers have full high\-water mark), specifies that the operation should be performed in non\-blocking mode\&. If the message cannot be queued on the
\fIsocket\fR, the
\fIzmq_send()\fR
function shall fail with
.RS 4
The operation was interrupted by delivery of a signal before the message was sent\&.
.RE
+.PP
+\fBEHOSTUNREACH\fR
+.RS 4
+The message cannot be routed\&.
+.RE
.SH "EXAMPLE"
.PP
\fBSending a multi-part message\fR.
.sp
.SH "SEE ALSO"
.sp
-\fBzmq_sendmsg\fR(3) \fBzmq_recv\fR(3) \fBzmq_recvmsg\fR(3) \fBzmq_socket\fR(7) \fBzmq\fR(7)
+\fBzmq_send_const\fR(3) \fBzmq_recv\fR(3) \fBzmq_socket\fR(7) \fBzmq\fR(7)
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Martin Sustrik <\m[blue]\fBsustrik@250bpm\&.com\fR\m[]\&\s-2\u[1]\d\s+2> and Martin Lucina <\m[blue]\fBmato@kotelna\&.sk\fR\m[]\&\s-2\u[2]\d\s+2>, and Pieter Hintjens <\m[blue]\fBph@imatix\&.com\fR\m[]\&\s-2\u[3]\d\s+2>\&.
-.SH "NOTES"
-.IP " 1." 4
-sustrik@250bpm.com
-.RS 4
-\%mailto:sustrik@250bpm.com
-.RE
-.IP " 2." 4
-mato@kotelna.sk
-.RS 4
-\%mailto:mato@kotelna.sk
-.RE
-.IP " 3." 4
-ph@imatix.com
-.RS 4
-\%mailto:ph@imatix.com
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
</dt>\r
<dd>\r
<p>\r
-Specifies that the operation should be performed in non-blocking mode. If the\r
-message cannot be queued on the <em>socket</em>, the <em>zmq_send()</em> function shall\r
-fail with <em>errno</em> set to EAGAIN.\r
+For socket types (DEALER, PUSH) that block when there are no available peers\r
+(or all peers have full high-water mark), specifies that the operation should\r
+be performed in non-blocking mode. If the message cannot be queued on the\r
+<em>socket</em>, the <em>zmq_send()</em> function shall fail with <em>errno</em> set to EAGAIN.\r
</p>\r
</dd>\r
<dt class="hdlist1">\r
sent.\r
</p>\r
</dd>\r
+<dt class="hdlist1">\r
+<strong>EHOSTUNREACH</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+The message cannot be routed.\r
+</p>\r
+</dd>\r
</dl></div>\r
</div>\r
</div>\r
<div class="sect1">\r
<h2 id="_see_also">SEE ALSO</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p><a href="zmq_sendmsg.html">zmq_sendmsg(3)</a>\r
+<div class="paragraph"><p><a href="zmq_send_const.html">zmq_send_const(3)</a>\r
<a href="zmq_recv.html">zmq_recv(3)</a>\r
-<a href="zmq_recvmsg.html">zmq_recvmsg(3)</a>\r
<a href="zmq_socket.html">zmq_socket(7)</a>\r
<a href="zmq.html">zmq(7)</a></p></div>\r
</div>\r
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Martin Sustrik <<a href="mailto:sustrik@250bpm.com">sustrik@250bpm.com</a>> and\r
-Martin Lucina <<a href="mailto:mato@kotelna.sk">mato@kotelna.sk</a>>, and Pieter Hintjens <<a href="mailto:ph@imatix.com">ph@imatix.com</a>>.</p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-10-25 17:30:40 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
a combination of the flags defined below:
*ZMQ_DONTWAIT*::
-Specifies that the operation should be performed in non-blocking mode. If the
-message cannot be queued on the 'socket', the _zmq_send()_ function shall
-fail with 'errno' set to EAGAIN.
+For socket types (DEALER, PUSH) that block when there are no available peers
+(or all peers have full high-water mark), specifies that the operation should
+be performed in non-blocking mode. If the message cannot be queued on the
+'socket', the _zmq_send()_ function shall fail with 'errno' set to EAGAIN.
*ZMQ_SNDMORE*::
Specifies that the message being sent is a multi-part message, and that further
*EINTR*::
The operation was interrupted by delivery of a signal before the message was
sent.
+*EHOSTUNREACH*::
+The message cannot be routed.
EXAMPLE
SEE ALSO
--------
-linkzmq:zmq_sendmsg[3]
+linkzmq:zmq_send_const[3]
linkzmq:zmq_recv[3]
-linkzmq:zmq_recvmsg[3]
linkzmq:zmq_socket[7]
linkzmq:zmq[7]
AUTHORS
-------
-This 0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
-Martin Lucina <mato@kotelna.sk>, and Pieter Hintjens <ph@imatix.com>.
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
--- /dev/null
+'\" t
+.\" Title: zmq_send_const
+.\" Author: [see the "AUTHORS" section]
+.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
+.\" Date: 03/10/2014
+.\" Manual: 0MQ Manual
+.\" Source: 0MQ 4.0.1
+.\" Language: English
+.\"
+.TH "ZMQ_SEND_CONST" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+zmq_send_const \- send a constant\-memory message part on a socket
+.SH "SYNOPSIS"
+.sp
+\fBint zmq_send_const (void \fR\fB\fI*socket\fR\fR\fB, void \fR\fB\fI*buf\fR\fR\fB, size_t \fR\fB\fIlen\fR\fR\fB, int \fR\fB\fIflags\fR\fR\fB);\fR
+.SH "DESCRIPTION"
+.sp
+The \fIzmq_send_const()\fR function shall queue a message created from the buffer referenced by the \fIbuf\fR and \fIlen\fR arguments\&. The message buffer is assumed to be constant\-memory and will therefore not be copied or deallocated in any way\&. The \fIflags\fR argument is a combination of the flags defined below:
+.PP
+\fBZMQ_DONTWAIT\fR
+.RS 4
+For socket types (DEALER, PUSH) that block when there are no available peers (or all peers have full high\-water mark), specifies that the operation should be performed in non\-blocking mode\&. If the message cannot be queued on the
+\fIsocket\fR, the
+\fIzmq_send_const()\fR
+function shall fail with
+\fIerrno\fR
+set to EAGAIN\&.
+.RE
+.PP
+\fBZMQ_SNDMORE\fR
+.RS 4
+Specifies that the message being sent is a multi\-part message, and that further message parts are to follow\&. Refer to the section regarding multi\-part messages below for a detailed description\&.
+.RE
+.if n \{\
+.sp
+.\}
+.RS 4
+.it 1 an-trap
+.nr an-no-space-flag 1
+.nr an-break-flag 1
+.br
+.ps +1
+\fBNote\fR
+.ps -1
+.br
+.sp
+A successful invocation of \fIzmq_send_const()\fR does not indicate that the message has been transmitted to the network, only that it has been queued on the \fIsocket\fR and 0MQ has assumed responsibility for the message\&.
+.sp .5v
+.RE
+.SS "Multi\-part messages"
+.sp
+A 0MQ message is composed of 1 or more message parts\&. 0MQ ensures atomic delivery of messages: peers shall receive either all \fImessage parts\fR of a message or none at all\&. The total number of message parts is unlimited except by available memory\&.
+.sp
+An application that sends multi\-part messages must use the \fIZMQ_SNDMORE\fR flag when sending each message part except the final one\&.
+.SH "RETURN VALUE"
+.sp
+The \fIzmq_send_const()\fR function shall return number of bytes in the message if successful\&. Otherwise it shall return \-1 and set \fIerrno\fR to one of the values defined below\&.
+.SH "ERRORS"
+.PP
+\fBEAGAIN\fR
+.RS 4
+Non\-blocking mode was requested and the message cannot be sent at the moment\&.
+.RE
+.PP
+\fBENOTSUP\fR
+.RS 4
+The
+\fIzmq_send_const()\fR
+operation is not supported by this socket type\&.
+.RE
+.PP
+\fBEFSM\fR
+.RS 4
+The
+\fIzmq_send_const()\fR
+operation cannot be performed on this socket at the moment due to the socket not being in the appropriate state\&. This error may occur with socket types that switch between several states, such as ZMQ_REP\&. See the
+\fImessaging patterns\fR
+section of
+\fBzmq_socket\fR(3)
+for more information\&.
+.RE
+.PP
+\fBETERM\fR
+.RS 4
+The 0MQ
+\fIcontext\fR
+associated with the specified
+\fIsocket\fR
+was terminated\&.
+.RE
+.PP
+\fBENOTSOCK\fR
+.RS 4
+The provided
+\fIsocket\fR
+was invalid\&.
+.RE
+.PP
+\fBEINTR\fR
+.RS 4
+The operation was interrupted by delivery of a signal before the message was sent\&.
+.RE
+.PP
+\fBEHOSTUNREACH\fR
+.RS 4
+The message cannot be routed\&.
+.RE
+.SH "EXAMPLE"
+.PP
+\fBSending a multi-part message\fR.
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+/* Send a multi\-part message consisting of three parts to socket */
+rc = zmq_send_const (socket, "ABC", 3, ZMQ_SNDMORE);
+assert (rc == 3);
+rc = zmq_send_const (socket, "DEFGH", 5, ZMQ_SNDMORE);
+assert (rc == 5);
+/* Final part; no more parts to follow */
+rc = zmq_send_const (socket, "JK", 2, 0);
+assert (rc == 2);
+.fi
+.if n \{\
+.RE
+.\}
+.sp
+.SH "SEE ALSO"
+.sp
+\fBzmq_send\fR(3) \fBzmq_recv\fR(3) \fBzmq_socket\fR(7) \fBzmq\fR(7)
+.SH "AUTHORS"
+.sp
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"\r
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">\r
+<head>\r
+<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />\r
+<meta name="generator" content="AsciiDoc 8.6.6" />\r
+<title>zmq_send_const(3)</title>\r
+<style type="text/css">\r
+/* Shared CSS for AsciiDoc xhtml11 and html5 backends */\r
+\r
+/* Default font. */\r
+body {\r
+ font-family: Georgia,serif;\r
+}\r
+\r
+/* Title font. */\r
+h1, h2, h3, h4, h5, h6,\r
+div.title, caption.title,\r
+thead, p.table.header,\r
+#toctitle,\r
+#author, #revnumber, #revdate, #revremark,\r
+#footer {\r
+ font-family: Arial,Helvetica,sans-serif;\r
+}\r
+\r
+body {\r
+ margin: 1em 5% 1em 5%;\r
+}\r
+\r
+a {\r
+ color: blue;\r
+ text-decoration: underline;\r
+}\r
+a:visited {\r
+ color: fuchsia;\r
+}\r
+\r
+em {\r
+ font-style: italic;\r
+ color: navy;\r
+}\r
+\r
+strong {\r
+ font-weight: bold;\r
+ color: #083194;\r
+}\r
+\r
+h1, h2, h3, h4, h5, h6 {\r
+ color: #527bbd;\r
+ margin-top: 1.2em;\r
+ margin-bottom: 0.5em;\r
+ line-height: 1.3;\r
+}\r
+\r
+h1, h2, h3 {\r
+ border-bottom: 2px solid silver;\r
+}\r
+h2 {\r
+ padding-top: 0.5em;\r
+}\r
+h3 {\r
+ float: left;\r
+}\r
+h3 + * {\r
+ clear: left;\r
+}\r
+h5 {\r
+ font-size: 1.0em;\r
+}\r
+\r
+div.sectionbody {\r
+ margin-left: 0;\r
+}\r
+\r
+hr {\r
+ border: 1px solid silver;\r
+}\r
+\r
+p {\r
+ margin-top: 0.5em;\r
+ margin-bottom: 0.5em;\r
+}\r
+\r
+ul, ol, li > p {\r
+ margin-top: 0;\r
+}\r
+ul > li { color: #aaa; }\r
+ul > li > * { color: black; }\r
+\r
+pre {\r
+ padding: 0;\r
+ margin: 0;\r
+}\r
+\r
+#author {\r
+ color: #527bbd;\r
+ font-weight: bold;\r
+ font-size: 1.1em;\r
+}\r
+#email {\r
+}\r
+#revnumber, #revdate, #revremark {\r
+}\r
+\r
+#footer {\r
+ font-size: small;\r
+ border-top: 2px solid silver;\r
+ padding-top: 0.5em;\r
+ margin-top: 4.0em;\r
+}\r
+#footer-text {\r
+ float: left;\r
+ padding-bottom: 0.5em;\r
+}\r
+#footer-badges {\r
+ float: right;\r
+ padding-bottom: 0.5em;\r
+}\r
+\r
+#preamble {\r
+ margin-top: 1.5em;\r
+ margin-bottom: 1.5em;\r
+}\r
+div.imageblock, div.exampleblock, div.verseblock,\r
+div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,\r
+div.admonitionblock {\r
+ margin-top: 1.0em;\r
+ margin-bottom: 1.5em;\r
+}\r
+div.admonitionblock {\r
+ margin-top: 2.0em;\r
+ margin-bottom: 2.0em;\r
+ margin-right: 10%;\r
+ color: #606060;\r
+}\r
+\r
+div.content { /* Block element content. */\r
+ padding: 0;\r
+}\r
+\r
+/* Block element titles. */\r
+div.title, caption.title {\r
+ color: #527bbd;\r
+ font-weight: bold;\r
+ text-align: left;\r
+ margin-top: 1.0em;\r
+ margin-bottom: 0.5em;\r
+}\r
+div.title + * {\r
+ margin-top: 0;\r
+}\r
+\r
+td div.title:first-child {\r
+ margin-top: 0.0em;\r
+}\r
+div.content div.title:first-child {\r
+ margin-top: 0.0em;\r
+}\r
+div.content + div.title {\r
+ margin-top: 0.0em;\r
+}\r
+\r
+div.sidebarblock > div.content {\r
+ background: #ffffee;\r
+ border: 1px solid #dddddd;\r
+ border-left: 4px solid #f0f0f0;\r
+ padding: 0.5em;\r
+}\r
+\r
+div.listingblock > div.content {\r
+ border: 1px solid #dddddd;\r
+ border-left: 5px solid #f0f0f0;\r
+ background: #f8f8f8;\r
+ padding: 0.5em;\r
+}\r
+\r
+div.quoteblock, div.verseblock {\r
+ padding-left: 1.0em;\r
+ margin-left: 1.0em;\r
+ margin-right: 10%;\r
+ border-left: 5px solid #f0f0f0;\r
+ color: #888;\r
+}\r
+\r
+div.quoteblock > div.attribution {\r
+ padding-top: 0.5em;\r
+ text-align: right;\r
+}\r
+\r
+div.verseblock > pre.content {\r
+ font-family: inherit;\r
+ font-size: inherit;\r
+}\r
+div.verseblock > div.attribution {\r
+ padding-top: 0.75em;\r
+ text-align: left;\r
+}\r
+/* DEPRECATED: Pre version 8.2.7 verse style literal block. */\r
+div.verseblock + div.attribution {\r
+ text-align: left;\r
+}\r
+\r
+div.admonitionblock .icon {\r
+ vertical-align: top;\r
+ font-size: 1.1em;\r
+ font-weight: bold;\r
+ text-decoration: underline;\r
+ color: #527bbd;\r
+ padding-right: 0.5em;\r
+}\r
+div.admonitionblock td.content {\r
+ padding-left: 0.5em;\r
+ border-left: 3px solid #dddddd;\r
+}\r
+\r
+div.exampleblock > div.content {\r
+ border-left: 3px solid #dddddd;\r
+ padding-left: 0.5em;\r
+}\r
+\r
+div.imageblock div.content { padding-left: 0; }\r
+span.image img { border-style: none; }\r
+a.image:visited { color: white; }\r
+\r
+dl {\r
+ margin-top: 0.8em;\r
+ margin-bottom: 0.8em;\r
+}\r
+dt {\r
+ margin-top: 0.5em;\r
+ margin-bottom: 0;\r
+ font-style: normal;\r
+ color: navy;\r
+}\r
+dd > *:first-child {\r
+ margin-top: 0.1em;\r
+}\r
+\r
+ul, ol {\r
+ list-style-position: outside;\r
+}\r
+ol.arabic {\r
+ list-style-type: decimal;\r
+}\r
+ol.loweralpha {\r
+ list-style-type: lower-alpha;\r
+}\r
+ol.upperalpha {\r
+ list-style-type: upper-alpha;\r
+}\r
+ol.lowerroman {\r
+ list-style-type: lower-roman;\r
+}\r
+ol.upperroman {\r
+ list-style-type: upper-roman;\r
+}\r
+\r
+div.compact ul, div.compact ol,\r
+div.compact p, div.compact p,\r
+div.compact div, div.compact div {\r
+ margin-top: 0.1em;\r
+ margin-bottom: 0.1em;\r
+}\r
+\r
+tfoot {\r
+ font-weight: bold;\r
+}\r
+td > div.verse {\r
+ white-space: pre;\r
+}\r
+\r
+div.hdlist {\r
+ margin-top: 0.8em;\r
+ margin-bottom: 0.8em;\r
+}\r
+div.hdlist tr {\r
+ padding-bottom: 15px;\r
+}\r
+dt.hdlist1.strong, td.hdlist1.strong {\r
+ font-weight: bold;\r
+}\r
+td.hdlist1 {\r
+ vertical-align: top;\r
+ font-style: normal;\r
+ padding-right: 0.8em;\r
+ color: navy;\r
+}\r
+td.hdlist2 {\r
+ vertical-align: top;\r
+}\r
+div.hdlist.compact tr {\r
+ margin: 0;\r
+ padding-bottom: 0;\r
+}\r
+\r
+.comment {\r
+ background: yellow;\r
+}\r
+\r
+.footnote, .footnoteref {\r
+ font-size: 0.8em;\r
+}\r
+\r
+span.footnote, span.footnoteref {\r
+ vertical-align: super;\r
+}\r
+\r
+#footnotes {\r
+ margin: 20px 0 20px 0;\r
+ padding: 7px 0 0 0;\r
+}\r
+\r
+#footnotes div.footnote {\r
+ margin: 0 0 5px 0;\r
+}\r
+\r
+#footnotes hr {\r
+ border: none;\r
+ border-top: 1px solid silver;\r
+ height: 1px;\r
+ text-align: left;\r
+ margin-left: 0;\r
+ width: 20%;\r
+ min-width: 100px;\r
+}\r
+\r
+div.colist td {\r
+ padding-right: 0.5em;\r
+ padding-bottom: 0.3em;\r
+ vertical-align: top;\r
+}\r
+div.colist td img {\r
+ margin-top: 0.3em;\r
+}\r
+\r
+@media print {\r
+ #footer-badges { display: none; }\r
+}\r
+\r
+#toc {\r
+ margin-bottom: 2.5em;\r
+}\r
+\r
+#toctitle {\r
+ color: #527bbd;\r
+ font-size: 1.1em;\r
+ font-weight: bold;\r
+ margin-top: 1.0em;\r
+ margin-bottom: 0.1em;\r
+}\r
+\r
+div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {\r
+ margin-top: 0;\r
+ margin-bottom: 0;\r
+}\r
+div.toclevel2 {\r
+ margin-left: 2em;\r
+ font-size: 0.9em;\r
+}\r
+div.toclevel3 {\r
+ margin-left: 4em;\r
+ font-size: 0.9em;\r
+}\r
+div.toclevel4 {\r
+ margin-left: 6em;\r
+ font-size: 0.9em;\r
+}\r
+\r
+span.aqua { color: aqua; }\r
+span.black { color: black; }\r
+span.blue { color: blue; }\r
+span.fuchsia { color: fuchsia; }\r
+span.gray { color: gray; }\r
+span.green { color: green; }\r
+span.lime { color: lime; }\r
+span.maroon { color: maroon; }\r
+span.navy { color: navy; }\r
+span.olive { color: olive; }\r
+span.purple { color: purple; }\r
+span.red { color: red; }\r
+span.silver { color: silver; }\r
+span.teal { color: teal; }\r
+span.white { color: white; }\r
+span.yellow { color: yellow; }\r
+\r
+span.aqua-background { background: aqua; }\r
+span.black-background { background: black; }\r
+span.blue-background { background: blue; }\r
+span.fuchsia-background { background: fuchsia; }\r
+span.gray-background { background: gray; }\r
+span.green-background { background: green; }\r
+span.lime-background { background: lime; }\r
+span.maroon-background { background: maroon; }\r
+span.navy-background { background: navy; }\r
+span.olive-background { background: olive; }\r
+span.purple-background { background: purple; }\r
+span.red-background { background: red; }\r
+span.silver-background { background: silver; }\r
+span.teal-background { background: teal; }\r
+span.white-background { background: white; }\r
+span.yellow-background { background: yellow; }\r
+\r
+span.big { font-size: 2em; }\r
+span.small { font-size: 0.6em; }\r
+\r
+span.underline { text-decoration: underline; }\r
+span.overline { text-decoration: overline; }\r
+span.line-through { text-decoration: line-through; }\r
+\r
+\r
+/*\r
+ * xhtml11 specific\r
+ *\r
+ * */\r
+\r
+tt {\r
+ font-family: monospace;\r
+ font-size: inherit;\r
+ color: navy;\r
+}\r
+\r
+div.tableblock {\r
+ margin-top: 1.0em;\r
+ margin-bottom: 1.5em;\r
+}\r
+div.tableblock > table {\r
+ border: 3px solid #527bbd;\r
+}\r
+thead, p.table.header {\r
+ font-weight: bold;\r
+ color: #527bbd;\r
+}\r
+p.table {\r
+ margin-top: 0;\r
+}\r
+/* Because the table frame attribute is overriden by CSS in most browsers. */\r
+div.tableblock > table[frame="void"] {\r
+ border-style: none;\r
+}\r
+div.tableblock > table[frame="hsides"] {\r
+ border-left-style: none;\r
+ border-right-style: none;\r
+}\r
+div.tableblock > table[frame="vsides"] {\r
+ border-top-style: none;\r
+ border-bottom-style: none;\r
+}\r
+\r
+\r
+/*\r
+ * html5 specific\r
+ *\r
+ * */\r
+\r
+.monospaced {\r
+ font-family: monospace;\r
+ font-size: inherit;\r
+ color: navy;\r
+}\r
+\r
+table.tableblock {\r
+ margin-top: 1.0em;\r
+ margin-bottom: 1.5em;\r
+}\r
+thead, p.tableblock.header {\r
+ font-weight: bold;\r
+ color: #527bbd;\r
+}\r
+p.tableblock {\r
+ margin-top: 0;\r
+}\r
+table.tableblock {\r
+ border-width: 3px;\r
+ border-spacing: 0px;\r
+ border-style: solid;\r
+ border-color: #527bbd;\r
+ border-collapse: collapse;\r
+}\r
+th.tableblock, td.tableblock {\r
+ border-width: 1px;\r
+ padding: 4px;\r
+ border-style: solid;\r
+ border-color: #527bbd;\r
+}\r
+\r
+table.tableblock.frame-topbot {\r
+ border-left-style: hidden;\r
+ border-right-style: hidden;\r
+}\r
+table.tableblock.frame-sides {\r
+ border-top-style: hidden;\r
+ border-bottom-style: hidden;\r
+}\r
+table.tableblock.frame-none {\r
+ border-style: hidden;\r
+}\r
+\r
+th.tableblock.halign-left, td.tableblock.halign-left {\r
+ text-align: left;\r
+}\r
+th.tableblock.halign-center, td.tableblock.halign-center {\r
+ text-align: center;\r
+}\r
+th.tableblock.halign-right, td.tableblock.halign-right {\r
+ text-align: right;\r
+}\r
+\r
+th.tableblock.valign-top, td.tableblock.valign-top {\r
+ vertical-align: top;\r
+}\r
+th.tableblock.valign-middle, td.tableblock.valign-middle {\r
+ vertical-align: middle;\r
+}\r
+th.tableblock.valign-bottom, td.tableblock.valign-bottom {\r
+ vertical-align: bottom;\r
+}\r
+\r
+\r
+/*\r
+ * manpage specific\r
+ *\r
+ * */\r
+\r
+body.manpage h1 {\r
+ padding-top: 0.5em;\r
+ padding-bottom: 0.5em;\r
+ border-top: 2px solid silver;\r
+ border-bottom: 2px solid silver;\r
+}\r
+body.manpage h2 {\r
+ border-style: none;\r
+}\r
+body.manpage div.sectionbody {\r
+ margin-left: 3em;\r
+}\r
+\r
+@media print {\r
+ body.manpage div#toc { display: none; }\r
+}\r
+</style>\r
+<script type="text/javascript">\r
+/*<+'])');\r
+ // Function that scans the DOM tree for header elements (the DOM2\r
+ // nodeIterator API would be a better technique but not supported by all\r
+ // browsers).\r
+ var iterate = function (el) {\r
+ for (var i = el.firstChild; i != null; i = i.nextSibling) {\r
+ if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {\r
+ var mo = re.exec(i.tagName);\r
+ if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {\r
+ result[result.length] = new TocEntry(i, getText(i), mo[1]-1);\r
+ }\r
+ iterate(i);\r
+ }\r
+ }\r
+ }\r
+ iterate(el);\r
+ return result;\r
+ }\r
+\r
+ var toc = document.getElementById("toc");\r
+ if (!toc) {\r
+ return;\r
+ }\r
+\r
+ // Delete existing TOC entries in case we're reloading the TOC.\r
+ var tocEntriesToRemove = [];\r
+ var i;\r
+ for (i = 0; i < toc.childNodes.length; i++) {\r
+ var entry = toc.childNodes[i];\r
+ if (entry.nodeName == 'div'\r
+ && entry.getAttribute("class")\r
+ && entry.getAttribute("class").match(/^toclevel/))\r
+ tocEntriesToRemove.push(entry);\r
+ }\r
+ for (i = 0; i < tocEntriesToRemove.length; i++) {\r
+ toc.removeChild(tocEntriesToRemove[i]);\r
+ }\r
+\r
+ // Rebuild TOC entries.\r
+ var entries = tocEntries(document.getElementById("content"), toclevels);\r
+ for (var i = 0; i < entries.length; ++i) {\r
+ var entry = entries[i];\r
+ if (entry.element.id == "")\r
+ entry.element.id = "_toc_" + i;\r
+ var a = document.createElement("a");\r
+ a.href = "#" + entry.element.id;\r
+ a.appendChild(document.createTextNode(entry.text));\r
+ var div = document.createElement("div");\r
+ div.appendChild(a);\r
+ div.className = "toclevel" + entry.toclevel;\r
+ toc.appendChild(div);\r
+ }\r
+ if (entries.length == 0)\r
+ toc.parentNode.removeChild(toc);\r
+},\r
+\r
+\r
+/////////////////////////////////////////////////////////////////////\r
+// Footnotes generator\r
+/////////////////////////////////////////////////////////////////////\r
+\r
+/* Based on footnote generation code from:\r
+ * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html\r
+ */\r
+\r
+footnotes: function () {\r
+ // Delete existing footnote entries in case we're reloading the footnodes.\r
+ var i;\r
+ var noteholder = document.getElementById("footnotes");\r
+ if (!noteholder) {\r
+ return;\r
+ }\r
+ var entriesToRemove = [];\r
+ for (i = 0; i < noteholder.childNodes.length; i++) {\r
+ var entry = noteholder.childNodes[i];\r
+ if (entry.nodeName == 'div' && entry.getAttribute("class") == "footnote")\r
+ entriesToRemove.push(entry);\r
+ }\r
+ for (i = 0; i < entriesToRemove.length; i++) {\r
+ noteholder.removeChild(entriesToRemove[i]);\r
+ }\r
+\r
+ // Rebuild footnote entries.\r
+ var cont = document.getElementById("content");\r
+ var spans = cont.getElementsByTagName("span");\r
+ var refs = {};\r
+ var n = 0;\r
+ for (i=0; i<spans.length; i++) {\r
+ if (spans[i].className == "footnote") {\r
+ n++;\r
+ var note = spans[i].getAttribute("data-note");\r
+ if (!note) {\r
+ // Use [\s\S] in place of . so multi-line matches work.\r
+ // Because JavaScript has no s (dotall) regex flag.\r
+ note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];\r
+ spans[i].innerHTML =\r
+ "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +\r
+ "' title='View footnote' class='footnote'>" + n + "</a>]";\r
+ spans[i].setAttribute("data-note", note);\r
+ }\r
+ noteholder.innerHTML +=\r
+ "<div class='footnote' id='_footnote_" + n + "'>" +\r
+ "<a href='#_footnoteref_" + n + "' title='Return to text'>" +\r
+ n + "</a>. " + note + "</div>";\r
+ var id =spans[i].getAttribute("id");\r
+ if (id != null) refs["#"+id] = n;\r
+ }\r
+ }\r
+ if (n == 0)\r
+ noteholder.parentNode.removeChild(noteholder);\r
+ else {\r
+ // Process footnoterefs.\r
+ for (i=0; i<spans.length; i++) {\r
+ if (spans[i].className == "footnoteref") {\r
+ var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");\r
+ href = href.match(/#.*/)[0]; // Because IE return full URL.\r
+ n = refs[href];\r
+ spans[i].innerHTML =\r
+ "[<a href='#_footnote_" + n +\r
+ "' title='View footnote' class='footnote'>" + n + "</a>]";\r
+ }\r
+ }\r
+ }\r
+},\r
+\r
+install: function(toclevels) {\r
+ var timerId;\r
+\r
+ function reinstall() {\r
+ asciidoc.footnotes();\r
+ if (toclevels) {\r
+ asciidoc.toc(toclevels);\r
+ }\r
+ }\r
+\r
+ function reinstallAndRemoveTimer() {\r
+ clearInterval(timerId);\r
+ reinstall();\r
+ }\r
+\r
+ timerId = setInterval(reinstall, 500);\r
+ if (document.addEventListener)\r
+ document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);\r
+ else\r
+ window.onload = reinstallAndRemoveTimer;\r
+}\r
+\r
+}\r
+asciidoc.install();\r
+/*]]>*/\r
+</script>\r
+</head>\r
+<body class="manpage">\r
+<div id="header">\r
+<h1>\r
+zmq_send_const(3) Manual Page\r
+</h1>\r
+<h2>NAME</h2>\r
+<div class="sectionbody">\r
+<p>zmq_send_const -\r
+ send a constant-memory message part on a socket\r
+</p>\r
+</div>\r
+</div>\r
+<div id="content">\r
+<div class="sect1">\r
+<h2 id="_synopsis">SYNOPSIS</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p><strong>int zmq_send_const (void <em>*socket</em>, void <em>*buf</em>, size_t <em>len</em>, int <em>flags</em>);</strong></p></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_description">DESCRIPTION</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>The <em>zmq_send_const()</em> function shall queue a message created from the buffer\r
+referenced by the <em>buf</em> and <em>len</em> arguments. The message buffer is assumed\r
+to be constant-memory and will therefore not be copied or deallocated\r
+in any way. The <em>flags</em> argument is a combination of the flags defined below:</p></div>\r
+<div class="dlist"><dl>\r
+<dt class="hdlist1">\r
+<strong>ZMQ_DONTWAIT</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+For socket types (DEALER, PUSH) that block when there are no available peers\r
+(or all peers have full high-water mark), specifies that the operation should\r
+be performed in non-blocking mode. If the message cannot be queued on the\r
+<em>socket</em>, the <em>zmq_send_const()</em> function shall fail with <em>errno</em> set to EAGAIN.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>ZMQ_SNDMORE</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+Specifies that the message being sent is a multi-part message, and that further\r
+message parts are to follow. Refer to the section regarding multi-part messages\r
+below for a detailed description.\r
+</p>\r
+</dd>\r
+</dl></div>\r
+<div class="admonitionblock">\r
+<table><tr>\r
+<td class="icon">\r
+<div class="title">Note</div>\r
+</td>\r
+<td class="content">A successful invocation of <em>zmq_send_const()</em> does not indicate that the\r
+message has been transmitted to the network, only that it has been queued on\r
+the <em>socket</em> and ØMQ has assumed responsibility for the message.</td>\r
+</tr></table>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_multi_part_messages">Multi-part messages</h3>\r
+<div class="paragraph"><p>A ØMQ message is composed of 1 or more message parts. ØMQ ensures atomic\r
+delivery of messages: peers shall receive either all <em>message parts</em> of a\r
+message or none at all. The total number of message parts is unlimited except\r
+by available memory.</p></div>\r
+<div class="paragraph"><p>An application that sends multi-part messages must use the <em>ZMQ_SNDMORE</em> flag\r
+when sending each message part except the final one.</p></div>\r
+</div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_return_value">RETURN VALUE</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>The <em>zmq_send_const()</em> function shall return number of bytes in the message\r
+if successful. Otherwise it shall return <tt>-1</tt> and set <em>errno</em> to one of the\r
+values defined below.</p></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_errors">ERRORS</h2>\r
+<div class="sectionbody">\r
+<div class="dlist"><dl>\r
+<dt class="hdlist1">\r
+<strong>EAGAIN</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+Non-blocking mode was requested and the message cannot be sent at the moment.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>ENOTSUP</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+The <em>zmq_send_const()</em> operation is not supported by this socket type.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>EFSM</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+The <em>zmq_send_const()</em> operation cannot be performed on this socket at the moment\r
+due to the socket not being in the appropriate state. This error may occur with\r
+socket types that switch between several states, such as ZMQ_REP. See the\r
+<em>messaging patterns</em> section of <a href="zmq_socket.html">zmq_socket(3)</a> for more information.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>ETERM</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+The ØMQ <em>context</em> associated with the specified <em>socket</em> was terminated.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>ENOTSOCK</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+The provided <em>socket</em> was invalid.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>EINTR</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+The operation was interrupted by delivery of a signal before the message was\r
+sent.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>EHOSTUNREACH</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+The message cannot be routed.\r
+</p>\r
+</dd>\r
+</dl></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_example">EXAMPLE</h2>\r
+<div class="sectionbody">\r
+<div class="listingblock">\r
+<div class="title">Sending a multi-part message</div>\r
+<div class="content">\r
+<pre><tt>/* Send a multi-part message consisting of three parts to socket */\r
+rc = zmq_send_const (socket, "ABC", 3, ZMQ_SNDMORE);\r
+assert (rc == 3);\r
+rc = zmq_send_const (socket, "DEFGH", 5, ZMQ_SNDMORE);\r
+assert (rc == 5);\r
+/* Final part; no more parts to follow */\r
+rc = zmq_send_const (socket, "JK", 2, 0);\r
+assert (rc == 2);</tt></pre>\r
+</div></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_see_also">SEE ALSO</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p><a href="zmq_send.html">zmq_send(3)</a>\r
+<a href="zmq_recv.html">zmq_recv(3)</a>\r
+<a href="zmq_socket.html">zmq_socket(7)</a>\r
+<a href="zmq.html">zmq(7)</a></p></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_authors">AUTHORS</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
+</div>\r
+</div>\r
+</div>\r
+<div id="footnotes"><hr /></div>\r
+<div id="footer">\r
+<div id="footer-text">\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
+</div>\r
+</div>\r
+</body>\r
+</html>\r
--- /dev/null
+zmq_send_const(3)
+=================
+
+
+NAME
+----
+zmq_send_const - send a constant-memory message part on a socket
+
+
+SYNOPSIS
+--------
+*int zmq_send_const (void '*socket', void '*buf', size_t 'len', int 'flags');*
+
+
+DESCRIPTION
+-----------
+The _zmq_send_const()_ function shall queue a message created from the buffer
+referenced by the 'buf' and 'len' arguments. The message buffer is assumed
+to be constant-memory and will therefore not be copied or deallocated
+in any way. The 'flags' argument is a combination of the flags defined below:
+
+*ZMQ_DONTWAIT*::
+For socket types (DEALER, PUSH) that block when there are no available peers
+(or all peers have full high-water mark), specifies that the operation should
+be performed in non-blocking mode. If the message cannot be queued on the
+'socket', the _zmq_send_const()_ function shall fail with 'errno' set to EAGAIN.
+
+*ZMQ_SNDMORE*::
+Specifies that the message being sent is a multi-part message, and that further
+message parts are to follow. Refer to the section regarding multi-part messages
+below for a detailed description.
+
+NOTE: A successful invocation of _zmq_send_const()_ does not indicate that the
+message has been transmitted to the network, only that it has been queued on
+the 'socket' and 0MQ has assumed responsibility for the message.
+
+
+Multi-part messages
+~~~~~~~~~~~~~~~~~~~
+A 0MQ message is composed of 1 or more message parts. 0MQ ensures atomic
+delivery of messages: peers shall receive either all _message parts_ of a
+message or none at all. The total number of message parts is unlimited except
+by available memory.
+
+An application that sends multi-part messages must use the _ZMQ_SNDMORE_ flag
+when sending each message part except the final one.
+
+
+RETURN VALUE
+------------
+The _zmq_send_const()_ function shall return number of bytes in the message
+if successful. Otherwise it shall return `-1` and set 'errno' to one of the
+values defined below.
+
+
+ERRORS
+------
+*EAGAIN*::
+Non-blocking mode was requested and the message cannot be sent at the moment.
+*ENOTSUP*::
+The _zmq_send_const()_ operation is not supported by this socket type.
+*EFSM*::
+The _zmq_send_const()_ operation cannot be performed on this socket at the moment
+due to the socket not being in the appropriate state. This error may occur with
+socket types that switch between several states, such as ZMQ_REP. See the
+_messaging patterns_ section of linkzmq:zmq_socket[3] for more information.
+*ETERM*::
+The 0MQ 'context' associated with the specified 'socket' was terminated.
+*ENOTSOCK*::
+The provided 'socket' was invalid.
+*EINTR*::
+The operation was interrupted by delivery of a signal before the message was
+sent.
+*EHOSTUNREACH*::
+The message cannot be routed.
+
+
+EXAMPLE
+-------
+.Sending a multi-part message
+----
+/* Send a multi-part message consisting of three parts to socket */
+rc = zmq_send_const (socket, "ABC", 3, ZMQ_SNDMORE);
+assert (rc == 3);
+rc = zmq_send_const (socket, "DEFGH", 5, ZMQ_SNDMORE);
+assert (rc == 5);
+/* Final part; no more parts to follow */
+rc = zmq_send_const (socket, "JK", 2, 0);
+assert (rc == 2);
+----
+
+SEE ALSO
+--------
+linkzmq:zmq_send[3]
+linkzmq:zmq_recv[3]
+linkzmq:zmq_socket[7]
+linkzmq:zmq[7]
+
+
+AUTHORS
+-------
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_sendmsg
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.2
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_SENDMSG" "3" "11/23/2012" "0MQ 3\&.2\&.2" "0MQ Manual"
+.TH "ZMQ_SENDMSG" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.PP
\fBZMQ_DONTWAIT\fR
.RS 4
-Specifies that the operation should be performed in non\-blocking mode\&. If the message cannot be queued on the
+For socket types (DEALER, PUSH) that block when there are no available peers (or all peers have full high\-water mark), specifies that the operation should be performed in non\-blocking mode\&. If the message cannot be queued on the
\fIsocket\fR, the
\fIzmq_sendmsg()\fR
function shall fail with
.RS 4
Invalid message\&.
.RE
+.PP
+\fBEHOSTUNREACH\fR
+.RS 4
+The message cannot be routed\&.
+.RE
.SH "EXAMPLE"
.PP
\fBFilling in a message and sending it to a socket\fR.
.sp
.SH "SEE ALSO"
.sp
-\fBzmq_recv\fR(3) \fBzmq_recv\fR(3) \fBzmq_recvmsg\fR(3) \fBzmq_socket\fR(7) \fBzmq\fR(7)
+\fBzmq_recv\fR(3) \fBzmq_socket\fR(7) \fBzmq\fR(7)
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Martin Sustrik <\m[blue]\fBsustrik@250bpm\&.com\fR\m[]\&\s-2\u[1]\d\s+2> and Martin Lucina <\m[blue]\fBmato@kotelna\&.sk\fR\m[]\&\s-2\u[2]\d\s+2>, and Pieter Hintjens <\m[blue]\fBph@imatix\&.com\fR\m[]\&\s-2\u[3]\d\s+2>\&.
-.SH "NOTES"
-.IP " 1." 4
-sustrik@250bpm.com
-.RS 4
-\%mailto:sustrik@250bpm.com
-.RE
-.IP " 2." 4
-mato@kotelna.sk
-.RS 4
-\%mailto:mato@kotelna.sk
-.RE
-.IP " 3." 4
-ph@imatix.com
-.RS 4
-\%mailto:ph@imatix.com
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
</dt>\r
<dd>\r
<p>\r
-Specifies that the operation should be performed in non-blocking mode. If the\r
-message cannot be queued on the <em>socket</em>, the <em>zmq_sendmsg()</em> function shall\r
-fail with <em>errno</em> set to EAGAIN.\r
+For socket types (DEALER, PUSH) that block when there are no available peers\r
+(or all peers have full high-water mark), specifies that the operation should\r
+be performed in non-blocking mode. If the message cannot be queued on the\r
+<em>socket</em>, the <em>zmq_sendmsg()</em> function shall fail with <em>errno</em> set to EAGAIN.\r
</p>\r
</dd>\r
<dt class="hdlist1">\r
Invalid message.\r
</p>\r
</dd>\r
+<dt class="hdlist1">\r
+<strong>EHOSTUNREACH</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+The message cannot be routed.\r
+</p>\r
+</dd>\r
</dl></div>\r
</div>\r
</div>\r
<h2 id="_see_also">SEE ALSO</h2>\r
<div class="sectionbody">\r
<div class="paragraph"><p><a href="zmq_recv.html">zmq_recv(3)</a>\r
-<a href="zmq_recv.html">zmq_recv(3)</a>\r
-<a href="zmq_recvmsg.html">zmq_recvmsg(3)</a>\r
<a href="zmq_socket.html">zmq_socket(7)</a>\r
<a href="zmq.html">zmq(7)</a></p></div>\r
</div>\r
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Martin Sustrik <<a href="mailto:sustrik@250bpm.com">sustrik@250bpm.com</a>> and\r
-Martin Lucina <<a href="mailto:mato@kotelna.sk">mato@kotelna.sk</a>>, and Pieter Hintjens <<a href="mailto:ph@imatix.com">ph@imatix.com</a>>.</p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-11-14 10:09:14 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
'flags' argument is a combination of the flags defined below:
*ZMQ_DONTWAIT*::
-Specifies that the operation should be performed in non-blocking mode. If the
-message cannot be queued on the 'socket', the _zmq_sendmsg()_ function shall
-fail with 'errno' set to EAGAIN.
+For socket types (DEALER, PUSH) that block when there are no available peers
+(or all peers have full high-water mark), specifies that the operation should
+be performed in non-blocking mode. If the message cannot be queued on the
+'socket', the _zmq_sendmsg()_ function shall fail with 'errno' set to EAGAIN.
*ZMQ_SNDMORE*::
Specifies that the message being sent is a multi-part message, and that further
sent.
*EFAULT*::
Invalid message.
+*EHOSTUNREACH*::
+The message cannot be routed.
EXAMPLE
SEE ALSO
--------
linkzmq:zmq_recv[3]
-linkzmq:zmq_recv[3]
-linkzmq:zmq_recvmsg[3]
linkzmq:zmq_socket[7]
linkzmq:zmq[7]
AUTHORS
-------
-This 0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
-Martin Lucina <mato@kotelna.sk>, and Pieter Hintjens <ph@imatix.com>.
-
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_setsockopt
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.2
+.\" Source: 0MQ 4.0.4
.\" Language: English
.\"
-.TH "ZMQ_SETSOCKOPT" "3" "11/23/2012" "0MQ 3\&.2\&.2" "0MQ Manual"
+.TH "ZMQ_SETSOCKOPT" "3" "03/10/2014" "0MQ 4\&.0\&.4" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.sp
\fBint zmq_setsockopt (void \fR\fB\fI*socket\fR\fR\fB, int \fR\fB\fIoption_name\fR\fR\fB, const void \fR\fB\fI*option_value\fR\fR\fB, size_t \fR\fB\fIoption_len\fR\fR\fB);\fR
.sp
-Caution: All options, with the exception of ZMQ_SUBSCRIBE, ZMQ_UNSUBSCRIBE, ZMQ_LINGER, ZMQ_ROUTER_MANDATORY and ZMQ_XPUB_VERBOSE only take effect for subsequent socket bind/connects\&.
+Caution: All options, with the exception of ZMQ_SUBSCRIBE, ZMQ_UNSUBSCRIBE, ZMQ_LINGER, ZMQ_ROUTER_MANDATORY, ZMQ_PROBE_ROUTER, ZMQ_XPUB_VERBOSE, ZMQ_REQ_CORRELATE, and ZMQ_REQ_RELAXED, only take effect for subsequent socket bind/connects\&.
+.sp
+Specifically, security options take effect for subsequent bind/connect calls, and can be changed at any time to affect subsequent binds and/or connects\&.
.SH "DESCRIPTION"
.sp
The \fIzmq_setsockopt()\fR function shall set the option specified by the \fIoption_name\fR argument to the value pointed to by the \fIoption_value\fR argument for the 0MQ socket pointed to by the \fIsocket\fR argument\&. The \fIoption_len\fR argument is the size of the option value in bytes\&.
The following socket options can be set with the \fIzmq_setsockopt()\fR function:
.SS "ZMQ_SNDHWM: Set high water mark for outbound messages"
.sp
-The \fIZMQ_SNDHWM\fR option shall set the high water mark for outbound messages on the specified \fIsocket\fR\&. The high water mark is a hard limit on the maximum number of outstanding messages 0MQ shall queue in memory for any single peer that the specified \fIsocket\fR is communicating with\&.
+The \fIZMQ_SNDHWM\fR option shall set the high water mark for outbound messages on the specified \fIsocket\fR\&. The high water mark is a hard limit on the maximum number of outstanding messages 0MQ shall queue in memory for any single peer that the specified \fIsocket\fR is communicating with\&. A value of zero means no limit\&.
.sp
If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, 0MQ shall take appropriate action such as blocking or dropping sent messages\&. Refer to the individual socket descriptions in \fBzmq_socket\fR(3) for details on the exact action taken for each socket type\&.
.if n \{\
.sp 1
.SS "ZMQ_RCVHWM: Set high water mark for inbound messages"
.sp
-The \fIZMQ_RCVHWM\fR option shall set the high water mark for inbound messages on the specified \fIsocket\fR\&. The high water mark is a hard limit on the maximum number of outstanding messages 0MQ shall queue in memory for any single peer that the specified \fIsocket\fR is communicating with\&.
+The \fIZMQ_RCVHWM\fR option shall set the high water mark for inbound messages on the specified \fIsocket\fR\&. The high water mark is a hard limit on the maximum number of outstanding messages 0MQ shall queue in memory for any single peer that the specified \fIsocket\fR is communicating with\&. A value of zero means no limit\&.
.sp
If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, 0MQ shall take appropriate action such as blocking or dropping sent messages\&. Refer to the individual socket descriptions in \fBzmq_socket\fR(3) for details on the exact action taken for each socket type\&.
.TS
.sp 1
.SS "ZMQ_IDENTITY: Set socket identity"
.sp
-The \fIZMQ_IDENTITY\fR option shall set the identity of the specified \fIsocket\fR\&. Socket identity is used only by request/reply pattern\&. Namely, it can be used in tandem with ROUTER socket to route messages to the peer with specific identity\&.
-.sp
-Identity should be at least one byte and at most 255 bytes long\&. Identities starting with binary zero are reserved for use by 0MQ infrastructure\&.
+The \fIZMQ_IDENTITY\fR option shall set the identity of the specified \fIsocket\fR when connecting to a ROUTER socket\&. The identity should be from 1 to 255 bytes long and MAY NOT start with binary zero\&.
.sp
-If two peers use the same identity when connecting to a third peer, the results shall be undefined\&.
+If two clients use the same identity when connecting to a ROUTER, the ROUTER socket shall accept only the first such client and reject the others\&.
.TS
tab(:);
lt lt
Applicable socket types
T}:T{
.sp
-all
+ZMQ_REQ, ZMQ_REP, ZMQ_ROUTER, ZMQ_DEALER\&.
T}
.TE
.sp 1
T}
.TE
.sp 1
-.SS "ZMQ_IPV4ONLY: Use IPv4\-only sockets"
+.SS "ZMQ_IPV6: Enable IPv6 on socket"
+.sp
+Set the IPv6 option for the socket\&. A value of 1 means IPv6 is enabled on the socket, while 0 means the socket will use only IPv4\&. When IPv6 is enabled the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts\&.
+.TS
+tab(:);
+lt lt
+lt lt
+lt lt
+lt lt.
+T{
+.sp
+Option value type
+T}:T{
+.sp
+int
+T}
+T{
+.sp
+Option value unit
+T}:T{
+.sp
+boolean
+T}
+T{
+.sp
+Default value
+T}:T{
+.sp
+0 (false)
+T}
+T{
+.sp
+Applicable socket types
+T}:T{
+.sp
+all, when using TCP transports\&.
+T}
+.TE
+.sp 1
+.SS "ZMQ_IPV4ONLY: Use IPv4\-only on socket"
.sp
-Sets the underlying native socket type\&. A value of 1 will use IPv4 sockets, while the value of 0 will use IPv6 sockets\&. An IPv6 socket lets applications connect to and accept connections from both IPv4 and IPv6 hosts\&.
+Set the IPv4\-only option for the socket\&. This option is deprecated\&. Please use the ZMQ_IPV6 option\&.
.TS
tab(:);
lt lt
T}
.TE
.sp 1
-.SS "ZMQ_DELAY_ATTACH_ON_CONNECT: Accept messages only when connections are made"
+.SS "ZMQ_IMMEDIATE: Queue messages only to completed connections"
.sp
-If set to 1, will delay the attachment of a pipe on connect until the underlying connection has completed\&. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection\&.
+By default queues will fill on outgoing connections even if the connection has not completed\&. This can lead to "lost" messages on sockets with round\-robin routing (REQ, PUSH, DEALER)\&. If this option is set to 1, messages shall be queued only to completed connections\&. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection\&.
.TS
tab(:);
lt lt
.sp 1
.SS "ZMQ_ROUTER_MANDATORY: accept only routable messages on ROUTER sockets"
.sp
-Sets the \fIROUTER\fR socket behavior when an unroutable message is encountered\&. A value of 0 is the default and discards the message silently when it cannot be routed\&. A value of 1 returns an \fIEHOSTUNREACH\fR error code if the message cannot be routed\&.
+Sets the ROUTER socket behavior when an unroutable message is encountered\&. A value of 0 is the default and discards the message silently when it cannot be routed\&. A value of 1 returns an \fIEHOSTUNREACH\fR error code if the message cannot be routed\&.
+.TS
+tab(:);
+lt lt
+lt lt
+lt lt
+lt lt.
+T{
+.sp
+Option value type
+T}:T{
+.sp
+int
+T}
+T{
+.sp
+Option value unit
+T}:T{
+.sp
+0, 1
+T}
+T{
+.sp
+Default value
+T}:T{
+.sp
+0
+T}
+T{
+.sp
+Applicable socket types
+T}:T{
+.sp
+ZMQ_ROUTER
+T}
+.TE
+.sp 1
+.SS "ZMQ_ROUTER_RAW: switch ROUTER socket to raw mode"
+.sp
+Sets the raw mode on the ROUTER, when set to 1\&. When the ROUTER socket is in raw mode, and when using the tcp:// transport, it will read and write TCP data without 0MQ framing\&. This lets 0MQ applications talk to non\-0MQ applications\&. When using raw mode, you cannot set explicit identities, and the ZMQ_MSGMORE flag is ignored when sending data messages\&. In raw mode you can close a specific connection by sending it a zero\-length message (following the identity frame)\&.
+.if n \{\
+.sp
+.\}
+.RS 4
+.it 1 an-trap
+.nr an-no-space-flag 1
+.nr an-break-flag 1
+.br
+.ps +1
+\fBNote\fR
+.ps -1
+.br
+.sp
+This option is deprecated, please use ZMQ_STREAM sockets instead\&.
+.sp .5v
+.RE
.TS
tab(:);
lt lt
T}
.TE
.sp 1
+.SS "ZMQ_PROBE_ROUTER: bootstrap connections to ROUTER sockets"
+.sp
+When set to 1, the socket will automatically send an empty message when a new connection is made or accepted\&. You may set this on REQ, DEALER, or ROUTER sockets connected to a ROUTER socket\&. The application must filter such empty messages\&. The ZMQ_PROBE_ROUTER option in effect provides the ROUTER application with an event signaling the arrival of a new peer\&.
+.if n \{\
+.sp
+.\}
+.RS 4
+.it 1 an-trap
+.nr an-no-space-flag 1
+.nr an-break-flag 1
+.br
+.ps +1
+\fBNote\fR
+.ps -1
+.br
+.sp
+do not set this option on a socket that talks to any other socket types: the results are undefined\&.
+.sp .5v
+.RE
+.TS
+tab(:);
+lt lt
+lt lt
+lt lt
+lt lt.
+T{
+.sp
+Option value type
+T}:T{
+.sp
+int
+T}
+T{
+.sp
+Option value unit
+T}:T{
+.sp
+0, 1
+T}
+T{
+.sp
+Default value
+T}:T{
+.sp
+0
+T}
+T{
+.sp
+Applicable socket types
+T}:T{
+.sp
+ZMQ_ROUTER, ZMQ_DEALER, ZMQ_REQ
+T}
+.TE
+.sp 1
.SS "ZMQ_XPUB_VERBOSE: provide all subscription messages on XPUB sockets"
.sp
Sets the \fIXPUB\fR socket behavior on new subscriptions and unsubscriptions\&. A value of \fI0\fR is the default and passes only new subscription messages to upstream\&. A value of \fI1\fR passes all subscription messages upstream\&.
T}
.TE
.sp 1
+.SS "ZMQ_REQ_CORRELATE: match replies with requests"
+.sp
+The default behavior of REQ sockets is to rely on the ordering of messages to match requests and responses and that is usually sufficient\&. When this option is set to 1, the REQ socket will prefix outgoing messages with an extra frame containing a request id\&. That means the full message is (request id, 0, user frames\&...)\&. The REQ socket will discard all incoming messages that don\(cqt begin with these two frames\&.
+.TS
+tab(:);
+lt lt
+lt lt
+lt lt
+lt lt.
+T{
+.sp
+Option value type
+T}:T{
+.sp
+int
+T}
+T{
+.sp
+Option value unit
+T}:T{
+.sp
+0, 1
+T}
+T{
+.sp
+Default value
+T}:T{
+.sp
+0
+T}
+T{
+.sp
+Applicable socket types
+T}:T{
+.sp
+ZMQ_REQ
+T}
+.TE
+.sp 1
+.SS "ZMQ_REQ_RELAXED: relax strict alternation between request and reply"
+.sp
+By default, a REQ socket does not allow initiating a new request with \fIzmq_send(3)\fR until the reply to the previous one has been received\&. When set to 1, sending another message is allowed and has the effect of disconnecting the underlying connection to the peer from which the reply was expected, triggering a reconnection attempt on transports that support it\&. The request\-reply state machine is reset and a new request is sent to the next available peer\&.
+.sp
+If set to 1, also enable ZMQ_REQ_CORRELATE to ensure correct matching of requests and replies\&. Otherwise a late reply to an aborted request can be reported as the reply to the superseding request\&.
+.TS
+tab(:);
+lt lt
+lt lt
+lt lt
+lt lt.
+T{
+.sp
+Option value type
+T}:T{
+.sp
+int
+T}
+T{
+.sp
+Option value unit
+T}:T{
+.sp
+0, 1
+T}
+T{
+.sp
+Default value
+T}:T{
+.sp
+0
+T}
+T{
+.sp
+Applicable socket types
+T}:T{
+.sp
+ZMQ_REQ
+T}
+.TE
+.sp 1
.SS "ZMQ_TCP_KEEPALIVE: Override SO_KEEPALIVE socket option"
.sp
-Override \fISO_KEEPALIVE\fR socket option(where supported by OS)\&. The default value of \-1 means to skip any overrides and leave it to OS default\&.
+Override \fISO_KEEPALIVE\fR socket option (where supported by OS)\&. The default value of \-1 means to skip any overrides and leave it to OS default\&.
.TS
tab(:);
lt lt
T}
.TE
.sp 1
-.SS "ZMQ_TCP_KEEPALIVE_IDLE: Override TCP_KEEPCNT(or TCP_KEEPALIVE on some OS)"
+.SS "ZMQ_TCP_KEEPALIVE_IDLE: Override TCP_KEEPCNT (or TCP_KEEPALIVE on some OS)"
.sp
-Override \fITCP_KEEPCNT\fR(or \fITCP_KEEPALIVE\fR on some OS) socket option(where supported by OS)\&. The default value of \-1 means to skip any overrides and leave it to OS default\&.
+Override \fITCP_KEEPCNT\fR(or \fITCP_KEEPALIVE\fR on some OS) socket option (where supported by OS)\&. The default value of \-1 means to skip any overrides and leave it to OS default\&.
.TS
tab(:);
lt lt
.sp 1
.SS "ZMQ_TCP_KEEPALIVE_CNT: Override TCP_KEEPCNT socket option"
.sp
-Override \fITCP_KEEPCNT\fR socket option(where supported by OS)\&. The default value of \-1 means to skip any overrides and leave it to OS default\&.
+Override \fITCP_KEEPCNT\fR socket option (where supported by OS)\&. The default value of \-1 means to skip any overrides and leave it to OS default\&.
.TS
tab(:);
lt lt
.sp 1
.SS "ZMQ_TCP_ACCEPT_FILTER: Assign filters to allow new TCP connections"
.sp
-Assign arbitrary number of filters that will be applied for each new TCP transport connection on a listening socket\&. If no filters applied, then TCP transport allows connections from any ip\&. If at least one filter is applied then new connection source ip should be matched\&. To clear all filters call zmq_setsockopt(socket, ZMQ_TCP_ACCEPT_FILTER, NULL, 0)\&. Filter is a null\-terminated string with ipv6 or ipv4 CIDR\&.
+Assign an arbitrary number of filters that will be applied for each new TCP transport connection on a listening socket\&. If no filters are applied, then the TCP transport allows connections from any IP address\&. If at least one filter is applied then new connection source ip should be matched\&. To clear all filters call zmq_setsockopt(socket, ZMQ_TCP_ACCEPT_FILTER, NULL, 0)\&. Filter is a null\-terminated string with ipv6 or ipv4 CIDR\&.
.TS
tab(:);
lt lt
T}
.TE
.sp 1
-.SH "RETURN VALUE"
-.sp
-The \fIzmq_setsockopt()\fR function shall return zero if successful\&. Otherwise it shall return \-1 and set \fIerrno\fR to one of the values defined below\&.
-.SH "ERRORS"
-.PP
-\fBEINVAL\fR
-.RS 4
-The requested option
-\fIoption_name\fR
-is unknown, or the requested
-\fIoption_len\fR
-or
-\fIoption_value\fR
-is invalid\&.
-.RE
-.PP
-\fBETERM\fR
-.RS 4
-The 0MQ
-\fIcontext\fR
-associated with the specified
-\fIsocket\fR
-was terminated\&.
-.RE
-.PP
-\fBENOTSOCK\fR
-.RS 4
-The provided
-\fIsocket\fR
-was invalid\&.
-.RE
-.PP
-\fBEINTR\fR
-.RS 4
-The operation was interrupted by delivery of a signal\&.
-.RE
-.SH "EXAMPLE"
-.PP
-\fBSubscribing to messages on a ZMQ_SUB socket\fR.
+.SS "ZMQ_PLAIN_SERVER: Set PLAIN server role"
.sp
-.if n \{\
+Defines whether the socket will act as server for PLAIN security, see \fBzmq_plain\fR(7)\&. A value of \fI1\fR means the socket will act as PLAIN server\&. A value of \fI0\fR means the socket will not act as PLAIN server, and its security role then depends on other option settings\&. Setting this to \fI0\fR shall reset the socket security to NULL\&.
+.TS
+tab(:);
+lt lt
+lt lt
+lt lt
+lt lt.
+T{
+.sp
+Option value type
+T}:T{
+.sp
+int
+T}
+T{
+.sp
+Option value unit
+T}:T{
+.sp
+0, 1
+T}
+T{
+.sp
+Default value
+T}:T{
+.sp
+0
+T}
+T{
+.sp
+Applicable socket types
+T}:T{
+.sp
+all, when using TCP transport
+T}
+.TE
+.sp 1
+.SS "ZMQ_PLAIN_USERNAME: Set PLAIN security username"
+.sp
+Sets the username for outgoing connections over TCP or IPC\&. If you set this to a non\-null value, the security mechanism used for connections shall be PLAIN, see \fBzmq_plain\fR(7)\&. If you set this to a null value, the security mechanism used for connections shall be NULL, see \fBzmq_null\fR(3)\&.
+.TS
+tab(:);
+lt lt
+lt lt
+lt lt
+lt lt.
+T{
+.sp
+Option value type
+T}:T{
+.sp
+character string
+T}
+T{
+.sp
+Option value unit
+T}:T{
+.sp
+N/A
+T}
+T{
+.sp
+Default value
+T}:T{
+.sp
+not set
+T}
+T{
+.sp
+Applicable socket types
+T}:T{
+.sp
+all, when using TCP transport
+T}
+.TE
+.sp 1
+.SS "ZMQ_PLAIN_PASSWORD: Set PLAIN security password"
+.sp
+Sets the password for outgoing connections over TCP or IPC\&. If you set this to a non\-null value, the security mechanism used for connections shall be PLAIN, see \fBzmq_plain\fR(7)\&. If you set this to a null value, the security mechanism used for connections shall be NULL, see \fBzmq_null\fR(3)\&.
+.TS
+tab(:);
+lt lt
+lt lt
+lt lt
+lt lt.
+T{
+.sp
+Option value type
+T}:T{
+.sp
+character string
+T}
+T{
+.sp
+Option value unit
+T}:T{
+.sp
+N/A
+T}
+T{
+.sp
+Default value
+T}:T{
+.sp
+not set
+T}
+T{
+.sp
+Applicable socket types
+T}:T{
+.sp
+all, when using TCP transport
+T}
+.TE
+.sp 1
+.SS "ZMQ_CURVE_SERVER: Set CURVE server role"
+.sp
+Defines whether the socket will act as server for CURVE security, see \fBzmq_curve\fR(7)\&. A value of \fI1\fR means the socket will act as CURVE server\&. A value of \fI0\fR means the socket will not act as CURVE server, and its security role then depends on other option settings\&. Setting this to \fI0\fR shall reset the socket security to NULL\&. When you set this you must also set the server\(cqs secret key using the ZMQ_CURVE_SECRETKEY option\&. A server socket does not need to know its own public key\&.
+.TS
+tab(:);
+lt lt
+lt lt
+lt lt
+lt lt.
+T{
+.sp
+Option value type
+T}:T{
+.sp
+int
+T}
+T{
+.sp
+Option value unit
+T}:T{
+.sp
+0, 1
+T}
+T{
+.sp
+Default value
+T}:T{
+.sp
+0
+T}
+T{
+.sp
+Applicable socket types
+T}:T{
+.sp
+all, when using TCP transport
+T}
+.TE
+.sp 1
+.SS "ZMQ_CURVE_PUBLICKEY: Set CURVE public key"
+.sp
+Sets the socket\(cqs long term public key\&. You must set this on CURVE client sockets, see \fBzmq_curve\fR(7)\&. You can provide the key as 32 binary bytes, or as a 40\-character string encoded in the Z85 encoding format\&. The public key must always be used with the matching secret key\&. To generate a public/secret key pair, use \fBzmq_curve_keypair\fR(3)\&.
+.TS
+tab(:);
+lt lt
+lt lt
+lt lt
+lt lt.
+T{
+.sp
+Option value type
+T}:T{
+.sp
+binary data or Z85 text string
+T}
+T{
+.sp
+Option value size
+T}:T{
+.sp
+32 or 40
+T}
+T{
+.sp
+Default value
+T}:T{
+.sp
+NULL
+T}
+T{
+.sp
+Applicable socket types
+T}:T{
+.sp
+all, when using TCP transport
+T}
+.TE
+.sp 1
+.SS "ZMQ_CURVE_SECRETKEY: Set CURVE secret key"
+.sp
+Sets the socket\(cqs long term secret key\&. You must set this on both CURVE client and server sockets, see \fBzmq_curve\fR(7)\&. You can provide the key as 32 binary bytes, or as a 40\-character string encoded in the Z85 encoding format\&. To generate a public/secret key pair, use \fBzmq_curve_keypair\fR(3)\&.
+.TS
+tab(:);
+lt lt
+lt lt
+lt lt
+lt lt.
+T{
+.sp
+Option value type
+T}:T{
+.sp
+binary data or Z85 text string
+T}
+T{
+.sp
+Option value size
+T}:T{
+.sp
+32 or 40
+T}
+T{
+.sp
+Default value
+T}:T{
+.sp
+NULL
+T}
+T{
+.sp
+Applicable socket types
+T}:T{
+.sp
+all, when using TCP transport
+T}
+.TE
+.sp 1
+.SS "ZMQ_CURVE_SERVERKEY: Set CURVE server key"
+.sp
+Sets the socket\(cqs long term server key\&. You must set this on CURVE client sockets, see \fBzmq_curve\fR(7)\&. You can provide the key as 32 binary bytes, or as a 40\-character string encoded in the Z85 encoding format\&. This key must have been generated together with the server\(cqs secret key\&.
+.TS
+tab(:);
+lt lt
+lt lt
+lt lt
+lt lt.
+T{
+.sp
+Option value type
+T}:T{
+.sp
+binary data or Z85 text string
+T}
+T{
+.sp
+Option value size
+T}:T{
+.sp
+32 or 40
+T}
+T{
+.sp
+Default value
+T}:T{
+.sp
+NULL
+T}
+T{
+.sp
+Applicable socket types
+T}:T{
+.sp
+all, when using TCP transport
+T}
+.TE
+.sp 1
+.SS "ZMQ_ZAP_DOMAIN: Set RFC 27 authentication domain"
+.sp
+Sets the domain for ZAP (ZMQ RFC 27) authentication\&. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non\-empty domain\&. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present\&. See \m[blue]\fBhttp://rfc\&.zeromq\&.org/spec:27\fR\m[] for more details\&.
+.TS
+tab(:);
+lt lt
+lt lt
+lt lt
+lt lt.
+T{
+.sp
+Option value type
+T}:T{
+.sp
+character string
+T}
+T{
+.sp
+Option value unit
+T}:T{
+.sp
+N/A
+T}
+T{
+.sp
+Default value
+T}:T{
+.sp
+not set
+T}
+T{
+.sp
+Applicable socket types
+T}:T{
+.sp
+all, when using TCP transport
+T}
+.TE
+.sp 1
+.SS "ZMQ_CONFLATE: Keep only last message"
+.sp
+If set, a socket shall keep only one message in its inbound/outbound queue, this message being the last message received/the last message to be sent\&. Ignores \fIZMQ_RECVHWM\fR and \fIZMQ_SENDHWM\fR options\&. Does not supports multi\-part messages, in particular, only one part of it is kept in the socket internal queue\&.
+.TS
+tab(:);
+lt lt
+lt lt
+lt lt
+lt lt.
+T{
+.sp
+Option value type
+T}:T{
+.sp
+int
+T}
+T{
+.sp
+Option value unit
+T}:T{
+.sp
+boolean
+T}
+T{
+.sp
+Default value
+T}:T{
+.sp
+0 (false)
+T}
+T{
+.sp
+Applicable socket types
+T}:T{
+.sp
+ZMQ_PULL, ZMQ_PUSH, ZMQ_SUB, ZMQ_PUB, ZMQ_DEALER
+T}
+.TE
+.sp 1
+.SH "RETURN VALUE"
+.sp
+The \fIzmq_setsockopt()\fR function shall return zero if successful\&. Otherwise it shall return \-1 and set \fIerrno\fR to one of the values defined below\&.
+.SH "ERRORS"
+.PP
+\fBEINVAL\fR
+.RS 4
+The requested option
+\fIoption_name\fR
+is unknown, or the requested
+\fIoption_len\fR
+or
+\fIoption_value\fR
+is invalid\&.
+.RE
+.PP
+\fBETERM\fR
+.RS 4
+The 0MQ
+\fIcontext\fR
+associated with the specified
+\fIsocket\fR
+was terminated\&.
+.RE
+.PP
+\fBENOTSOCK\fR
+.RS 4
+The provided
+\fIsocket\fR
+was invalid\&.
+.RE
+.PP
+\fBEINTR\fR
+.RS 4
+The operation was interrupted by delivery of a signal\&.
+.RE
+.SH "EXAMPLE"
+.PP
+\fBSubscribing to messages on a ZMQ_SUB socket\fR.
+.sp
+.if n \{\
.RS 4
.\}
.nf
int64_t affinity;
/* Incoming connections on TCP port 5555 shall be handled by I/O thread 1 */
affinity = 1;
-rc = zmq_setsockopt (socket, ZMQ_AFFINITY, &affinity, sizeof affinity);
+rc = zmq_setsockopt (socket, ZMQ_AFFINITY, &affinity, sizeof (affinity));
assert (rc);
rc = zmq_bind (socket, "tcp://lo:5555");
assert (rc);
/* Incoming connections on TCP port 5556 shall be handled by I/O thread 2 */
affinity = 2;
-rc = zmq_setsockopt (socket, ZMQ_AFFINITY, &affinity, sizeof affinity);
+rc = zmq_setsockopt (socket, ZMQ_AFFINITY, &affinity, sizeof (affinity));
assert (rc);
rc = zmq_bind (socket, "tcp://lo:5556");
assert (rc);
.sp
.SH "SEE ALSO"
.sp
-\fBzmq_getsockopt\fR(3) \fBzmq_socket\fR(3) \fBzmq\fR(7)
+\fBzmq_getsockopt\fR(3) \fBzmq_socket\fR(3) \fBzmq_plain\fR(7) \fBzmq_curve\fR(7) \fBzmq\fR(7)
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Martin Sustrik <\m[blue]\fBsustrik@250bpm\&.com\fR\m[]\&\s-2\u[1]\d\s+2> and Martin Lucina <\m[blue]\fBmato@kotelna\&.sk\fR\m[]\&\s-2\u[2]\d\s+2>\&.
-.SH "NOTES"
-.IP " 1." 4
-sustrik@250bpm.com
-.RS 4
-\%mailto:sustrik@250bpm.com
-.RE
-.IP " 2." 4
-mato@kotelna.sk
-.RS 4
-\%mailto:mato@kotelna.sk
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
<div class="sectionbody">\r
<div class="paragraph"><p><strong>int zmq_setsockopt (void <em>*socket</em>, int <em>option_name</em>, const void <em>*option_value</em>, size_t <em>option_len</em>);</strong></p></div>\r
<div class="paragraph"><p>Caution: All options, with the exception of ZMQ_SUBSCRIBE, ZMQ_UNSUBSCRIBE,\r
-ZMQ_LINGER, ZMQ_ROUTER_MANDATORY and ZMQ_XPUB_VERBOSE only take effect for\r
-subsequent socket bind/connects.</p></div>\r
+ZMQ_LINGER, ZMQ_ROUTER_MANDATORY, ZMQ_PROBE_ROUTER, ZMQ_XPUB_VERBOSE,\r
+ZMQ_REQ_CORRELATE, and ZMQ_REQ_RELAXED, only take effect for subsequent socket\r
+bind/connects.</p></div>\r
+<div class="paragraph"><p>Specifically, security options take effect for subsequent bind/connect calls,\r
+and can be changed at any time to affect subsequent binds and/or connects.</p></div>\r
</div>\r
</div>\r
<div class="sect1">\r
<div class="paragraph"><p>The <em>ZMQ_SNDHWM</em> option shall set the high water mark for outbound messages on\r
the specified <em>socket</em>. The high water mark is a hard limit on the maximum\r
number of outstanding messages ØMQ shall queue in memory for any single peer\r
-that the specified <em>socket</em> is communicating with.</p></div>\r
+that the specified <em>socket</em> is communicating with. A value of zero means no\r
+limit.</p></div>\r
<div class="paragraph"><p>If this limit has been reached the socket shall enter an exceptional state and\r
depending on the socket type, ØMQ shall take appropriate action such as\r
blocking or dropping sent messages. Refer to the individual socket descriptions\r
<div class="paragraph"><p>The <em>ZMQ_RCVHWM</em> option shall set the high water mark for inbound messages on\r
the specified <em>socket</em>. The high water mark is a hard limit on the maximum\r
number of outstanding messages ØMQ shall queue in memory for any single peer\r
-that the specified <em>socket</em> is communicating with.</p></div>\r
+that the specified <em>socket</em> is communicating with. A value of zero means no\r
+limit.</p></div>\r
<div class="paragraph"><p>If this limit has been reached the socket shall enter an exceptional state and\r
depending on the socket type, ØMQ shall take appropriate action such as\r
blocking or dropping sent messages. Refer to the individual socket descriptions\r
</div>\r
<div class="sect2">\r
<h3 id="_zmq_identity_set_socket_identity">ZMQ_IDENTITY: Set socket identity</h3>\r
-<div class="paragraph"><p>The <em>ZMQ_IDENTITY</em> option shall set the identity of the specified <em>socket</em>.\r
-Socket identity is used only by request/reply pattern. Namely, it can be used\r
-in tandem with ROUTER socket to route messages to the peer with specific\r
-identity.</p></div>\r
-<div class="paragraph"><p>Identity should be at least one byte and at most 255 bytes long. Identities\r
-starting with binary zero are reserved for use by ØMQ infrastructure.</p></div>\r
-<div class="paragraph"><p>If two peers use the same identity when connecting to a third peer, the\r
-results shall be undefined.</p></div>\r
+<div class="paragraph"><p>The <em>ZMQ_IDENTITY</em> option shall set the identity of the specified <em>socket</em>\r
+when connecting to a ROUTER socket. The identity should be from 1 to 255\r
+bytes long and MAY NOT start with binary zero.</p></div>\r
+<div class="paragraph"><p>If two clients use the same identity when connecting to a ROUTER, the\r
+ROUTER socket shall accept only the first such client and reject the\r
+others.</p></div>\r
<div class="hdlist"><table>\r
<tr>\r
<td class="hdlist1">\r
</td>\r
<td class="hdlist2">\r
<p style="margin-top: 0;">\r
-all\r
+ZMQ_REQ, ZMQ_REP, ZMQ_ROUTER, ZMQ_DEALER.\r
</p>\r
</td>\r
</tr>\r
</table></div>\r
</div>\r
<div class="sect2">\r
-<h3 id="_zmq_ipv4only_use_ipv4_only_sockets">ZMQ_IPV4ONLY: Use IPv4-only sockets</h3>\r
-<div class="paragraph"><p>Sets the underlying native socket type. A value of <tt>1</tt> will use IPv4 sockets,\r
-while the value of <tt>0</tt> will use IPv6 sockets. An IPv6 socket lets\r
-applications connect to and accept connections from both IPv4 and IPv6 hosts.</p></div>\r
+<h3 id="_zmq_ipv6_enable_ipv6_on_socket">ZMQ_IPV6: Enable IPv6 on socket</h3>\r
+<div class="paragraph"><p>Set the IPv6 option for the socket. A value of <tt>1</tt> means IPv6 is\r
+enabled on the socket, while <tt>0</tt> means the socket will use only IPv4.\r
+When IPv6 is enabled the socket will connect to, or accept connections\r
+from, both IPv4 and IPv6 hosts.</p></div>\r
+<div class="hdlist"><table>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value type\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+int\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value unit\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+boolean\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Default value\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+0 (false)\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Applicable socket types\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+all, when using TCP transports.\r
+</p>\r
+</td>\r
+</tr>\r
+</table></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_zmq_ipv4only_use_ipv4_only_on_socket">ZMQ_IPV4ONLY: Use IPv4-only on socket</h3>\r
+<div class="paragraph"><p>Set the IPv4-only option for the socket. This option is deprecated.\r
+Please use the ZMQ_IPV6 option.</p></div>\r
<div class="hdlist"><table>\r
<tr>\r
<td class="hdlist1">\r
</table></div>\r
</div>\r
<div class="sect2">\r
-<h3 id="_zmq_delay_attach_on_connect_accept_messages_only_when_connections_are_made">ZMQ_DELAY_ATTACH_ON_CONNECT: Accept messages only when connections are made</h3>\r
-<div class="paragraph"><p>If set to <tt>1</tt>, will delay the attachment of a pipe on connect until the underlying\r
-connection has completed. This will cause the socket to block if there are no other\r
-connections, but will prevent queues from filling on pipes awaiting connection.</p></div>\r
+<h3 id="_zmq_immediate_queue_messages_only_to_completed_connections">ZMQ_IMMEDIATE: Queue messages only to completed connections</h3>\r
+<div class="paragraph"><p>By default queues will fill on outgoing connections even if the connection has\r
+not completed. This can lead to "lost" messages on sockets with round-robin\r
+routing (REQ, PUSH, DEALER). If this option is set to <tt>1</tt>, messages shall be\r
+queued only to completed connections. This will cause the socket to block if\r
+there are no other connections, but will prevent queues from filling on pipes\r
+awaiting connection.</p></div>\r
<div class="hdlist"><table>\r
<tr>\r
<td class="hdlist1">\r
</div>\r
<div class="sect2">\r
<h3 id="_zmq_router_mandatory_accept_only_routable_messages_on_router_sockets">ZMQ_ROUTER_MANDATORY: accept only routable messages on ROUTER sockets</h3>\r
-<div class="paragraph"><p>Sets the <em>ROUTER</em> socket behavior when an unroutable message is encountered. A\r
+<div class="paragraph"><p>Sets the ROUTER socket behavior when an unroutable message is encountered. A\r
value of <tt>0</tt> is the default and discards the message silently when it cannot be\r
routed. A value of <tt>1</tt> returns an <em>EHOSTUNREACH</em> error code if the message\r
cannot be routed.</p></div>\r
</table></div>\r
</div>\r
<div class="sect2">\r
+<h3 id="_zmq_router_raw_switch_router_socket_to_raw_mode">ZMQ_ROUTER_RAW: switch ROUTER socket to raw mode</h3>\r
+<div class="paragraph"><p>Sets the raw mode on the ROUTER, when set to 1. When the ROUTER socket is in\r
+raw mode, and when using the tcp:// transport, it will read and write TCP data\r
+without ØMQ framing. This lets ØMQ applications talk to non-ØMQ applications.\r
+When using raw mode, you cannot set explicit identities, and the ZMQ_MSGMORE\r
+flag is ignored when sending data messages. In raw mode you can close a specific\r
+connection by sending it a zero-length message (following the identity frame).</p></div>\r
+<div class="admonitionblock">\r
+<table><tr>\r
+<td class="icon">\r
+<div class="title">Note</div>\r
+</td>\r
+<td class="content">This option is deprecated, please use ZMQ_STREAM sockets instead.</td>\r
+</tr></table>\r
+</div>\r
+<div class="hdlist"><table>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value type\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+int\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value unit\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+0, 1\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Default value\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+0\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Applicable socket types\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+ZMQ_ROUTER\r
+</p>\r
+</td>\r
+</tr>\r
+</table></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_zmq_probe_router_bootstrap_connections_to_router_sockets">ZMQ_PROBE_ROUTER: bootstrap connections to ROUTER sockets</h3>\r
+<div class="paragraph"><p>When set to 1, the socket will automatically send an empty message when a\r
+new connection is made or accepted. You may set this on REQ, DEALER, or\r
+ROUTER sockets connected to a ROUTER socket. The application must filter\r
+such empty messages. The ZMQ_PROBE_ROUTER option in effect provides the\r
+ROUTER application with an event signaling the arrival of a new peer.</p></div>\r
+<div class="admonitionblock">\r
+<table><tr>\r
+<td class="icon">\r
+<div class="title">Note</div>\r
+</td>\r
+<td class="content">do not set this option on a socket that talks to any other socket\r
+types: the results are undefined.</td>\r
+</tr></table>\r
+</div>\r
+<div class="hdlist"><table>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value type\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+int\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value unit\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+0, 1\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Default value\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+0\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Applicable socket types\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+ZMQ_ROUTER, ZMQ_DEALER, ZMQ_REQ\r
+</p>\r
+</td>\r
+</tr>\r
+</table></div>\r
+</div>\r
+<div class="sect2">\r
<h3 id="_zmq_xpub_verbose_provide_all_subscription_messages_on_xpub_sockets">ZMQ_XPUB_VERBOSE: provide all subscription messages on XPUB sockets</h3>\r
<div class="paragraph"><p>Sets the <em>XPUB</em> socket behavior on new subscriptions and unsubscriptions.\r
A value of <em>0</em> is the default and passes only new subscription messages to\r
</table></div>\r
</div>\r
<div class="sect2">\r
+<h3 id="_zmq_req_correlate_match_replies_with_requests">ZMQ_REQ_CORRELATE: match replies with requests</h3>\r
+<div class="paragraph"><p>The default behavior of REQ sockets is to rely on the ordering of messages to\r
+match requests and responses and that is usually sufficient. When this option\r
+is set to 1, the REQ socket will prefix outgoing messages with an extra frame\r
+containing a request id. That means the full message is (request id, 0,\r
+user frames…). The REQ socket will discard all incoming messages that don’t\r
+begin with these two frames.</p></div>\r
+<div class="hdlist"><table>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value type\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+int\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value unit\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+0, 1\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Default value\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+0\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Applicable socket types\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+ZMQ_REQ\r
+</p>\r
+</td>\r
+</tr>\r
+</table></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_zmq_req_relaxed_relax_strict_alternation_between_request_and_reply">ZMQ_REQ_RELAXED: relax strict alternation between request and reply</h3>\r
+<div class="paragraph"><p>By default, a REQ socket does not allow initiating a new request with\r
+<em>zmq_send(3)</em> until the reply to the previous one has been received.\r
+When set to 1, sending another message is allowed and has the effect of\r
+disconnecting the underlying connection to the peer from which the reply was\r
+expected, triggering a reconnection attempt on transports that support it.\r
+The request-reply state machine is reset and a new request is sent to the\r
+next available peer.</p></div>\r
+<div class="paragraph"><p>If set to 1, also enable ZMQ_REQ_CORRELATE to ensure correct matching of\r
+requests and replies. Otherwise a late reply to an aborted request can be\r
+reported as the reply to the superseding request.</p></div>\r
+<div class="hdlist"><table>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value type\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+int\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value unit\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+0, 1\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Default value\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+0\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Applicable socket types\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+ZMQ_REQ\r
+</p>\r
+</td>\r
+</tr>\r
+</table></div>\r
+</div>\r
+<div class="sect2">\r
<h3 id="_zmq_tcp_keepalive_override_so_keepalive_socket_option">ZMQ_TCP_KEEPALIVE: Override SO_KEEPALIVE socket option</h3>\r
-<div class="paragraph"><p>Override <em>SO_KEEPALIVE</em> socket option(where supported by OS).\r
+<div class="paragraph"><p>Override <em>SO_KEEPALIVE</em> socket option (where supported by OS).\r
The default value of <tt>-1</tt> means to skip any overrides and leave it to OS default.</p></div>\r
<div class="hdlist"><table>\r
<tr>\r
</table></div>\r
</div>\r
<div class="sect2">\r
-<h3 id="_zmq_tcp_keepalive_idle_override_tcp_keepcnt_or_tcp_keepalive_on_some_os">ZMQ_TCP_KEEPALIVE_IDLE: Override TCP_KEEPCNT(or TCP_KEEPALIVE on some OS)</h3>\r
-<div class="paragraph"><p>Override <em>TCP_KEEPCNT</em>(or <em>TCP_KEEPALIVE</em> on some OS) socket option(where supported by OS).\r
-The default value of <tt>-1</tt> means to skip any overrides and leave it to OS default.</p></div>\r
+<h3 id="_zmq_tcp_keepalive_idle_override_tcp_keepcnt_or_tcp_keepalive_on_some_os">ZMQ_TCP_KEEPALIVE_IDLE: Override TCP_KEEPCNT (or TCP_KEEPALIVE on some OS)</h3>\r
+<div class="paragraph"><p>Override <em>TCP_KEEPCNT</em>(or <em>TCP_KEEPALIVE</em> on some OS) socket option (where\r
+supported by OS). The default value of <tt>-1</tt> means to skip any overrides and\r
+leave it to OS default.</p></div>\r
<div class="hdlist"><table>\r
<tr>\r
<td class="hdlist1">\r
</div>\r
<div class="sect2">\r
<h3 id="_zmq_tcp_keepalive_cnt_override_tcp_keepcnt_socket_option">ZMQ_TCP_KEEPALIVE_CNT: Override TCP_KEEPCNT socket option</h3>\r
-<div class="paragraph"><p>Override <em>TCP_KEEPCNT</em> socket option(where supported by OS).\r
-The default value of <tt>-1</tt> means to skip any overrides and leave it to OS default.</p></div>\r
+<div class="paragraph"><p>Override <em>TCP_KEEPCNT</em> socket option (where supported by OS). The default\r
+value of <tt>-1</tt> means to skip any overrides and leave it to OS default.</p></div>\r
<div class="hdlist"><table>\r
<tr>\r
<td class="hdlist1">\r
</div>\r
<div class="sect2">\r
<h3 id="_zmq_tcp_keepalive_intvl_override_tcp_keepintvl_socket_option">ZMQ_TCP_KEEPALIVE_INTVL: Override TCP_KEEPINTVL socket option</h3>\r
-<div class="paragraph"><p>Override <em>TCP_KEEPINTVL</em> socket option(where supported by OS).\r
-The default value of <tt>-1</tt> means to skip any overrides and leave it to OS default.</p></div>\r
+<div class="paragraph"><p>Override <em>TCP_KEEPINTVL</em> socket option(where supported by OS). The default\r
+value of <tt>-1</tt> means to skip any overrides and leave it to OS default.</p></div>\r
<div class="hdlist"><table>\r
<tr>\r
<td class="hdlist1">\r
</div>\r
<div class="sect2">\r
<h3 id="_zmq_tcp_accept_filter_assign_filters_to_allow_new_tcp_connections">ZMQ_TCP_ACCEPT_FILTER: Assign filters to allow new TCP connections</h3>\r
-<div class="paragraph"><p>Assign arbitrary number of filters that will be applied for each new TCP transport\r
-connection on a listening socket.\r
-If no filters applied, then TCP transport allows connections from any ip.\r
-If at least one filter is applied then new connection source ip should be matched.\r
-To clear all filters call zmq_setsockopt(socket, ZMQ_TCP_ACCEPT_FILTER, NULL, 0).\r
+<div class="paragraph"><p>Assign an arbitrary number of filters that will be applied for each new TCP\r
+transport connection on a listening socket. If no filters are applied, then\r
+the TCP transport allows connections from any IP address. If at least one\r
+filter is applied then new connection source ip should be matched. To clear\r
+all filters call zmq_setsockopt(socket, ZMQ_TCP_ACCEPT_FILTER, NULL, 0).\r
Filter is a null-terminated string with ipv6 or ipv4 CIDR.</p></div>\r
<div class="hdlist"><table>\r
<tr>\r
</tr>\r
</table></div>\r
</div>\r
+<div class="sect2">\r
+<h3 id="_zmq_plain_server_set_plain_server_role">ZMQ_PLAIN_SERVER: Set PLAIN server role</h3>\r
+<div class="paragraph"><p>Defines whether the socket will act as server for PLAIN security, see\r
+<a href="zmq_plain.html">zmq_plain(7)</a>. A value of <em>1</em> means the socket will act as\r
+PLAIN server. A value of <em>0</em> means the socket will not act as PLAIN\r
+server, and its security role then depends on other option settings.\r
+Setting this to <em>0</em> shall reset the socket security to NULL.</p></div>\r
+<div class="hdlist"><table>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value type\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+int\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value unit\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+0, 1\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Default value\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+0\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Applicable socket types\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+all, when using TCP transport\r
+</p>\r
+</td>\r
+</tr>\r
+</table></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_zmq_plain_username_set_plain_security_username">ZMQ_PLAIN_USERNAME: Set PLAIN security username</h3>\r
+<div class="paragraph"><p>Sets the username for outgoing connections over TCP or IPC. If you set this\r
+to a non-null value, the security mechanism used for connections shall be\r
+PLAIN, see <a href="zmq_plain.html">zmq_plain(7)</a>. If you set this to a null value, the security\r
+mechanism used for connections shall be NULL, see <a href="zmq_null.html">zmq_null(3)</a>.</p></div>\r
+<div class="hdlist"><table>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value type\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+character string\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value unit\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+N/A\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Default value\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+not set\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Applicable socket types\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+all, when using TCP transport\r
+</p>\r
+</td>\r
+</tr>\r
+</table></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_zmq_plain_password_set_plain_security_password">ZMQ_PLAIN_PASSWORD: Set PLAIN security password</h3>\r
+<div class="paragraph"><p>Sets the password for outgoing connections over TCP or IPC. If you set this\r
+to a non-null value, the security mechanism used for connections shall be\r
+PLAIN, see <a href="zmq_plain.html">zmq_plain(7)</a>. If you set this to a null value, the security\r
+mechanism used for connections shall be NULL, see <a href="zmq_null.html">zmq_null(3)</a>.</p></div>\r
+<div class="hdlist"><table>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value type\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+character string\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value unit\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+N/A\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Default value\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+not set\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Applicable socket types\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+all, when using TCP transport\r
+</p>\r
+</td>\r
+</tr>\r
+</table></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_zmq_curve_server_set_curve_server_role">ZMQ_CURVE_SERVER: Set CURVE server role</h3>\r
+<div class="paragraph"><p>Defines whether the socket will act as server for CURVE security, see\r
+<a href="zmq_curve.html">zmq_curve(7)</a>. A value of <em>1</em> means the socket will act as\r
+CURVE server. A value of <em>0</em> means the socket will not act as CURVE\r
+server, and its security role then depends on other option settings.\r
+Setting this to <em>0</em> shall reset the socket security to NULL. When you\r
+set this you must also set the server’s secret key using the\r
+ZMQ_CURVE_SECRETKEY option. A server socket does not need to know\r
+its own public key.</p></div>\r
+<div class="hdlist"><table>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value type\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+int\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value unit\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+0, 1\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Default value\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+0\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Applicable socket types\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+all, when using TCP transport\r
+</p>\r
+</td>\r
+</tr>\r
+</table></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_zmq_curve_publickey_set_curve_public_key">ZMQ_CURVE_PUBLICKEY: Set CURVE public key</h3>\r
+<div class="paragraph"><p>Sets the socket’s long term public key. You must set this on CURVE client\r
+sockets, see <a href="zmq_curve.html">zmq_curve(7)</a>. You can provide the key as 32 binary\r
+bytes, or as a 40-character string encoded in the Z85 encoding format.\r
+The public key must always be used with the matching secret key. To\r
+generate a public/secret key pair, use <a href="zmq_curve_keypair.html">zmq_curve_keypair(3)</a>.</p></div>\r
+<div class="hdlist"><table>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value type\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+binary data or Z85 text string\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value size\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+32 or 40\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Default value\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+NULL\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Applicable socket types\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+all, when using TCP transport\r
+</p>\r
+</td>\r
+</tr>\r
+</table></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_zmq_curve_secretkey_set_curve_secret_key">ZMQ_CURVE_SECRETKEY: Set CURVE secret key</h3>\r
+<div class="paragraph"><p>Sets the socket’s long term secret key. You must set this on both CURVE\r
+client and server sockets, see <a href="zmq_curve.html">zmq_curve(7)</a>. You can provide the\r
+key as 32 binary bytes, or as a 40-character string encoded in the Z85\r
+encoding format. To generate a public/secret key pair, use\r
+<a href="zmq_curve_keypair.html">zmq_curve_keypair(3)</a>.</p></div>\r
+<div class="hdlist"><table>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value type\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+binary data or Z85 text string\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value size\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+32 or 40\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Default value\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+NULL\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Applicable socket types\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+all, when using TCP transport\r
+</p>\r
+</td>\r
+</tr>\r
+</table></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_zmq_curve_serverkey_set_curve_server_key">ZMQ_CURVE_SERVERKEY: Set CURVE server key</h3>\r
+<div class="paragraph"><p>Sets the socket’s long term server key. You must set this on CURVE client\r
+sockets, see <a href="zmq_curve.html">zmq_curve(7)</a>. You can provide the key as 32 binary\r
+bytes, or as a 40-character string encoded in the Z85 encoding format.\r
+This key must have been generated together with the server’s secret key.</p></div>\r
+<div class="hdlist"><table>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value type\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+binary data or Z85 text string\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value size\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+32 or 40\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Default value\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+NULL\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Applicable socket types\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+all, when using TCP transport\r
+</p>\r
+</td>\r
+</tr>\r
+</table></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_zmq_zap_domain_set_rfc_27_authentication_domain">ZMQ_ZAP_DOMAIN: Set RFC 27 authentication domain</h3>\r
+<div class="paragraph"><p>Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the\r
+default on all tcp:// connections), ZAP authentication only happens if you\r
+set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always\r
+made, if there is a ZAP handler present. See <a href="http://rfc.zeromq.org/spec:27">http://rfc.zeromq.org/spec:27</a>\r
+for more details.</p></div>\r
+<div class="hdlist"><table>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value type\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+character string\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value unit\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+N/A\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Default value\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+not set\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Applicable socket types\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+all, when using TCP transport\r
+</p>\r
+</td>\r
+</tr>\r
+</table></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_zmq_conflate_keep_only_last_message">ZMQ_CONFLATE: Keep only last message</h3>\r
+<div class="paragraph"><p>If set, a socket shall keep only one message in its inbound/outbound\r
+queue, this message being the last message received/the last message\r
+to be sent.\r
+Ignores <em>ZMQ_RECVHWM</em> and <em>ZMQ_SENDHWM</em> options.\r
+Does not supports multi-part messages, in particular, only one part of it\r
+is kept in the socket internal queue.</p></div>\r
+<div class="hdlist"><table>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value type\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+int\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Option value unit\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+boolean\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Default value\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+0 (false)\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Applicable socket types\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+ZMQ_PULL, ZMQ_PUSH, ZMQ_SUB, ZMQ_PUB, ZMQ_DEALER\r
+</p>\r
+</td>\r
+</tr>\r
+</table></div>\r
+</div>\r
</div>\r
</div>\r
<div class="sect1">\r
<pre><tt>int64_t affinity;\r
/* Incoming connections on TCP port 5555 shall be handled by I/O thread 1 */\r
affinity = 1;\r
-rc = zmq_setsockopt (socket, ZMQ_AFFINITY, &affinity, sizeof affinity);\r
+rc = zmq_setsockopt (socket, ZMQ_AFFINITY, &affinity, sizeof (affinity));\r
assert (rc);\r
rc = zmq_bind (socket, "tcp://lo:5555");\r
assert (rc);\r
/* Incoming connections on TCP port 5556 shall be handled by I/O thread 2 */\r
affinity = 2;\r
-rc = zmq_setsockopt (socket, ZMQ_AFFINITY, &affinity, sizeof affinity);\r
+rc = zmq_setsockopt (socket, ZMQ_AFFINITY, &affinity, sizeof (affinity));\r
assert (rc);\r
rc = zmq_bind (socket, "tcp://lo:5556");\r
assert (rc);</tt></pre>\r
<div class="sectionbody">\r
<div class="paragraph"><p><a href="zmq_getsockopt.html">zmq_getsockopt(3)</a>\r
<a href="zmq_socket.html">zmq_socket(3)</a>\r
+<a href="zmq_plain.html">zmq_plain(7)</a>\r
+<a href="zmq_curve.html">zmq_curve(7)</a>\r
<a href="zmq.html">zmq(7)</a></p></div>\r
</div>\r
</div>\r
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Martin Sustrik <<a href="mailto:sustrik@250bpm.com">sustrik@250bpm.com</a>> and\r
-Martin Lucina <<a href="mailto:mato@kotelna.sk">mato@kotelna.sk</a>>.</p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-11-23 16:54:28 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2014-03-10 22:20:14 CET\r
</div>\r
</div>\r
</body>\r
*int zmq_setsockopt (void '*socket', int 'option_name', const void '*option_value', size_t 'option_len');*
Caution: All options, with the exception of ZMQ_SUBSCRIBE, ZMQ_UNSUBSCRIBE,
-ZMQ_LINGER, ZMQ_ROUTER_MANDATORY and ZMQ_XPUB_VERBOSE only take effect for
-subsequent socket bind/connects.
+ZMQ_LINGER, ZMQ_ROUTER_MANDATORY, ZMQ_PROBE_ROUTER, ZMQ_XPUB_VERBOSE,
+ZMQ_REQ_CORRELATE, and ZMQ_REQ_RELAXED, only take effect for subsequent socket
+bind/connects.
+
+Specifically, security options take effect for subsequent bind/connect calls,
+and can be changed at any time to affect subsequent binds and/or connects.
DESCRIPTION
-----------
The 'ZMQ_SNDHWM' option shall set the high water mark for outbound messages on
the specified 'socket'. The high water mark is a hard limit on the maximum
number of outstanding messages 0MQ shall queue in memory for any single peer
-that the specified 'socket' is communicating with.
+that the specified 'socket' is communicating with. A value of zero means no
+limit.
If this limit has been reached the socket shall enter an exceptional state and
depending on the socket type, 0MQ shall take appropriate action such as
The 'ZMQ_RCVHWM' option shall set the high water mark for inbound messages on
the specified 'socket'. The high water mark is a hard limit on the maximum
number of outstanding messages 0MQ shall queue in memory for any single peer
-that the specified 'socket' is communicating with.
+that the specified 'socket' is communicating with. A value of zero means no
+limit.
If this limit has been reached the socket shall enter an exceptional state and
depending on the socket type, 0MQ shall take appropriate action such as
ZMQ_IDENTITY: Set socket identity
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-The 'ZMQ_IDENTITY' option shall set the identity of the specified 'socket'.
-Socket identity is used only by request/reply pattern. Namely, it can be used
-in tandem with ROUTER socket to route messages to the peer with specific
-identity.
-
-Identity should be at least one byte and at most 255 bytes long. Identities
-starting with binary zero are reserved for use by 0MQ infrastructure.
+The 'ZMQ_IDENTITY' option shall set the identity of the specified 'socket'
+when connecting to a ROUTER socket. The identity should be from 1 to 255
+bytes long and MAY NOT start with binary zero.
-If two peers use the same identity when connecting to a third peer, the
-results shall be undefined.
+If two clients use the same identity when connecting to a ROUTER, the
+ROUTER socket shall accept only the first such client and reject the
+others.
[horizontal]
Option value type:: binary data
Option value unit:: N/A
Default value:: NULL
-Applicable socket types:: all
+Applicable socket types:: ZMQ_REQ, ZMQ_REP, ZMQ_ROUTER, ZMQ_DEALER.
ZMQ_RATE: Set multicast data rate
Default value:: 10000
Applicable socket types:: all, when using multicast transports
+
ZMQ_SNDBUF: Set kernel transmit buffer size
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_SNDBUF' option shall set the underlying kernel transmit buffer size
ZMQ_RECONNECT_IVL_MAX: Set maximum reconnection interval
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-The 'ZMQ_RECONNECT_IVL_MAX' option shall set the maximum reconnection interval
+The 'ZMQ_RECONNECT_IVL_MAX' option shall set the maximum reconnection interval
for the specified 'socket'. This is the maximum period 0MQ shall wait between
attempts to reconnect. On each reconnect attempt, the previous interval shall be
doubled untill ZMQ_RECONNECT_IVL_MAX is reached. This allows for exponential
Applicable socket types:: all
-ZMQ_IPV4ONLY: Use IPv4-only sockets
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ZMQ_IPV6: Enable IPv6 on socket
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set the IPv6 option for the socket. A value of `1` means IPv6 is
+enabled on the socket, while `0` means the socket will use only IPv4.
+When IPv6 is enabled the socket will connect to, or accept connections
+from, both IPv4 and IPv6 hosts.
+
+[horizontal]
+Option value type:: int
+Option value unit:: boolean
+Default value:: 0 (false)
+Applicable socket types:: all, when using TCP transports.
+
+
+ZMQ_IPV4ONLY: Use IPv4-only on socket
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Sets the underlying native socket type. A value of `1` will use IPv4 sockets,
-while the value of `0` will use IPv6 sockets. An IPv6 socket lets
-applications connect to and accept connections from both IPv4 and IPv6 hosts.
+Set the IPv4-only option for the socket. This option is deprecated.
+Please use the ZMQ_IPV6 option.
[horizontal]
Option value type:: int
Applicable socket types:: all, when using TCP transports.
-ZMQ_DELAY_ATTACH_ON_CONNECT: Accept messages only when connections are made
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ZMQ_IMMEDIATE: Queue messages only to completed connections
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-If set to `1`, will delay the attachment of a pipe on connect until the underlying
-connection has completed. This will cause the socket to block if there are no other
-connections, but will prevent queues from filling on pipes awaiting connection.
+By default queues will fill on outgoing connections even if the connection has
+not completed. This can lead to "lost" messages on sockets with round-robin
+routing (REQ, PUSH, DEALER). If this option is set to `1`, messages shall be
+queued only to completed connections. This will cause the socket to block if
+there are no other connections, but will prevent queues from filling on pipes
+awaiting connection.
[horizontal]
Option value type:: int
ZMQ_ROUTER_MANDATORY: accept only routable messages on ROUTER sockets
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Sets the 'ROUTER' socket behavior when an unroutable message is encountered. A
-value of `0` is the default and discards the message silently when it cannot be
+Sets the ROUTER socket behavior when an unroutable message is encountered. A
+value of `0` is the default and discards the message silently when it cannot be
routed. A value of `1` returns an 'EHOSTUNREACH' error code if the message
cannot be routed.
Applicable socket types:: ZMQ_ROUTER
+ZMQ_ROUTER_RAW: switch ROUTER socket to raw mode
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Sets the raw mode on the ROUTER, when set to 1. When the ROUTER socket is in
+raw mode, and when using the tcp:// transport, it will read and write TCP data
+without 0MQ framing. This lets 0MQ applications talk to non-0MQ applications.
+When using raw mode, you cannot set explicit identities, and the ZMQ_MSGMORE
+flag is ignored when sending data messages. In raw mode you can close a specific
+connection by sending it a zero-length message (following the identity frame).
+
+NOTE: This option is deprecated, please use ZMQ_STREAM sockets instead.
+
+[horizontal]
+Option value type:: int
+Option value unit:: 0, 1
+Default value:: 0
+Applicable socket types:: ZMQ_ROUTER
+
+
+ZMQ_PROBE_ROUTER: bootstrap connections to ROUTER sockets
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+When set to 1, the socket will automatically send an empty message when a
+new connection is made or accepted. You may set this on REQ, DEALER, or
+ROUTER sockets connected to a ROUTER socket. The application must filter
+such empty messages. The ZMQ_PROBE_ROUTER option in effect provides the
+ROUTER application with an event signaling the arrival of a new peer.
+
+NOTE: do not set this option on a socket that talks to any other socket
+types: the results are undefined.
+
+[horizontal]
+Option value type:: int
+Option value unit:: 0, 1
+Default value:: 0
+Applicable socket types:: ZMQ_ROUTER, ZMQ_DEALER, ZMQ_REQ
+
+
ZMQ_XPUB_VERBOSE: provide all subscription messages on XPUB sockets
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Sets the 'XPUB' socket behavior on new subscriptions and unsubscriptions.
-A value of '0' is the default and passes only new subscription messages to
+Sets the 'XPUB' socket behavior on new subscriptions and unsubscriptions.
+A value of '0' is the default and passes only new subscription messages to
upstream. A value of '1' passes all subscription messages upstream.
[horizontal]
Applicable socket types:: ZMQ_XPUB
+ZMQ_REQ_CORRELATE: match replies with requests
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The default behavior of REQ sockets is to rely on the ordering of messages to
+match requests and responses and that is usually sufficient. When this option
+is set to 1, the REQ socket will prefix outgoing messages with an extra frame
+containing a request id. That means the full message is (request id, 0,
+user frames...). The REQ socket will discard all incoming messages that don't
+begin with these two frames.
+
+[horizontal]
+Option value type:: int
+Option value unit:: 0, 1
+Default value:: 0
+Applicable socket types:: ZMQ_REQ
+
+
+ZMQ_REQ_RELAXED: relax strict alternation between request and reply
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+By default, a REQ socket does not allow initiating a new request with
+_zmq_send(3)_ until the reply to the previous one has been received.
+When set to 1, sending another message is allowed and has the effect of
+disconnecting the underlying connection to the peer from which the reply was
+expected, triggering a reconnection attempt on transports that support it.
+The request-reply state machine is reset and a new request is sent to the
+next available peer.
+
+If set to 1, also enable ZMQ_REQ_CORRELATE to ensure correct matching of
+requests and replies. Otherwise a late reply to an aborted request can be
+reported as the reply to the superseding request.
+
+[horizontal]
+Option value type:: int
+Option value unit:: 0, 1
+Default value:: 0
+Applicable socket types:: ZMQ_REQ
+
+
ZMQ_TCP_KEEPALIVE: Override SO_KEEPALIVE socket option
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Override 'SO_KEEPALIVE' socket option(where supported by OS).
+
+Override 'SO_KEEPALIVE' socket option (where supported by OS).
The default value of `-1` means to skip any overrides and leave it to OS default.
[horizontal]
Applicable socket types:: all, when using TCP transports.
-ZMQ_TCP_KEEPALIVE_IDLE: Override TCP_KEEPCNT(or TCP_KEEPALIVE on some OS)
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Override 'TCP_KEEPCNT'(or 'TCP_KEEPALIVE' on some OS) socket option(where supported by OS).
-The default value of `-1` means to skip any overrides and leave it to OS default.
+ZMQ_TCP_KEEPALIVE_IDLE: Override TCP_KEEPCNT (or TCP_KEEPALIVE on some OS)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Override 'TCP_KEEPCNT'(or 'TCP_KEEPALIVE' on some OS) socket option (where
+supported by OS). The default value of `-1` means to skip any overrides and
+leave it to OS default.
[horizontal]
Option value type:: int
ZMQ_TCP_KEEPALIVE_CNT: Override TCP_KEEPCNT socket option
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Override 'TCP_KEEPCNT' socket option(where supported by OS).
-The default value of `-1` means to skip any overrides and leave it to OS default.
+
+Override 'TCP_KEEPCNT' socket option (where supported by OS). The default
+value of `-1` means to skip any overrides and leave it to OS default.
[horizontal]
Option value type:: int
ZMQ_TCP_KEEPALIVE_INTVL: Override TCP_KEEPINTVL socket option
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Override 'TCP_KEEPINTVL' socket option(where supported by OS).
-The default value of `-1` means to skip any overrides and leave it to OS default.
+
+Override 'TCP_KEEPINTVL' socket option(where supported by OS). The default
+value of `-1` means to skip any overrides and leave it to OS default.
[horizontal]
Option value type:: int
ZMQ_TCP_ACCEPT_FILTER: Assign filters to allow new TCP connections
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Assign arbitrary number of filters that will be applied for each new TCP transport
-connection on a listening socket.
-If no filters applied, then TCP transport allows connections from any ip.
-If at least one filter is applied then new connection source ip should be matched.
-To clear all filters call zmq_setsockopt(socket, ZMQ_TCP_ACCEPT_FILTER, NULL, 0).
+
+Assign an arbitrary number of filters that will be applied for each new TCP
+transport connection on a listening socket. If no filters are applied, then
+the TCP transport allows connections from any IP address. If at least one
+filter is applied then new connection source ip should be matched. To clear
+all filters call zmq_setsockopt(socket, ZMQ_TCP_ACCEPT_FILTER, NULL, 0).
Filter is a null-terminated string with ipv6 or ipv4 CIDR.
[horizontal]
Applicable socket types:: all listening sockets, when using TCP transports.
+ZMQ_PLAIN_SERVER: Set PLAIN server role
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Defines whether the socket will act as server for PLAIN security, see
+linkzmq:zmq_plain[7]. A value of '1' means the socket will act as
+PLAIN server. A value of '0' means the socket will not act as PLAIN
+server, and its security role then depends on other option settings.
+Setting this to '0' shall reset the socket security to NULL.
+
+[horizontal]
+Option value type:: int
+Option value unit:: 0, 1
+Default value:: 0
+Applicable socket types:: all, when using TCP transport
+
+
+ZMQ_PLAIN_USERNAME: Set PLAIN security username
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Sets the username for outgoing connections over TCP or IPC. If you set this
+to a non-null value, the security mechanism used for connections shall be
+PLAIN, see linkzmq:zmq_plain[7]. If you set this to a null value, the security
+mechanism used for connections shall be NULL, see linkzmq:zmq_null[3].
+
+[horizontal]
+Option value type:: character string
+Option value unit:: N/A
+Default value:: not set
+Applicable socket types:: all, when using TCP transport
+
+
+ZMQ_PLAIN_PASSWORD: Set PLAIN security password
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Sets the password for outgoing connections over TCP or IPC. If you set this
+to a non-null value, the security mechanism used for connections shall be
+PLAIN, see linkzmq:zmq_plain[7]. If you set this to a null value, the security
+mechanism used for connections shall be NULL, see linkzmq:zmq_null[3].
+
+[horizontal]
+Option value type:: character string
+Option value unit:: N/A
+Default value:: not set
+Applicable socket types:: all, when using TCP transport
+
+
+ZMQ_CURVE_SERVER: Set CURVE server role
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Defines whether the socket will act as server for CURVE security, see
+linkzmq:zmq_curve[7]. A value of '1' means the socket will act as
+CURVE server. A value of '0' means the socket will not act as CURVE
+server, and its security role then depends on other option settings.
+Setting this to '0' shall reset the socket security to NULL. When you
+set this you must also set the server's secret key using the
+ZMQ_CURVE_SECRETKEY option. A server socket does not need to know
+its own public key.
+
+[horizontal]
+Option value type:: int
+Option value unit:: 0, 1
+Default value:: 0
+Applicable socket types:: all, when using TCP transport
+
+
+ZMQ_CURVE_PUBLICKEY: Set CURVE public key
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Sets the socket's long term public key. You must set this on CURVE client
+sockets, see linkzmq:zmq_curve[7]. You can provide the key as 32 binary
+bytes, or as a 40-character string encoded in the Z85 encoding format.
+The public key must always be used with the matching secret key. To
+generate a public/secret key pair, use linkzmq:zmq_curve_keypair[3].
+
+[horizontal]
+Option value type:: binary data or Z85 text string
+Option value size:: 32 or 40
+Default value:: NULL
+Applicable socket types:: all, when using TCP transport
+
+
+ZMQ_CURVE_SECRETKEY: Set CURVE secret key
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Sets the socket's long term secret key. You must set this on both CURVE
+client and server sockets, see linkzmq:zmq_curve[7]. You can provide the
+key as 32 binary bytes, or as a 40-character string encoded in the Z85
+encoding format. To generate a public/secret key pair, use
+linkzmq:zmq_curve_keypair[3].
+
+[horizontal]
+Option value type:: binary data or Z85 text string
+Option value size:: 32 or 40
+Default value:: NULL
+Applicable socket types:: all, when using TCP transport
+
+
+ZMQ_CURVE_SERVERKEY: Set CURVE server key
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Sets the socket's long term server key. You must set this on CURVE client
+sockets, see linkzmq:zmq_curve[7]. You can provide the key as 32 binary
+bytes, or as a 40-character string encoded in the Z85 encoding format.
+This key must have been generated together with the server's secret key.
+
+[horizontal]
+Option value type:: binary data or Z85 text string
+Option value size:: 32 or 40
+Default value:: NULL
+Applicable socket types:: all, when using TCP transport
+
+
+ZMQ_ZAP_DOMAIN: Set RFC 27 authentication domain
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the
+default on all tcp:// connections), ZAP authentication only happens if you
+set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always
+made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27
+for more details.
+
+[horizontal]
+Option value type:: character string
+Option value unit:: N/A
+Default value:: not set
+Applicable socket types:: all, when using TCP transport
+
+
+ZMQ_CONFLATE: Keep only last message
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+If set, a socket shall keep only one message in its inbound/outbound
+queue, this message being the last message received/the last message
+to be sent.
+Ignores 'ZMQ_RECVHWM' and 'ZMQ_SENDHWM' options.
+Does not supports multi-part messages, in particular, only one part of it
+is kept in the socket internal queue.
+[horizontal]
+Option value type:: int
+Option value unit:: boolean
+Default value:: 0 (false)
+Applicable socket types:: ZMQ_PULL, ZMQ_PUSH, ZMQ_SUB, ZMQ_PUB, ZMQ_DEALER
+
+
RETURN VALUE
------------
The _zmq_setsockopt()_ function shall return zero if successful. Otherwise it
int64_t affinity;
/* Incoming connections on TCP port 5555 shall be handled by I/O thread 1 */
affinity = 1;
-rc = zmq_setsockopt (socket, ZMQ_AFFINITY, &affinity, sizeof affinity);
+rc = zmq_setsockopt (socket, ZMQ_AFFINITY, &affinity, sizeof (affinity));
assert (rc);
rc = zmq_bind (socket, "tcp://lo:5555");
assert (rc);
/* Incoming connections on TCP port 5556 shall be handled by I/O thread 2 */
affinity = 2;
-rc = zmq_setsockopt (socket, ZMQ_AFFINITY, &affinity, sizeof affinity);
+rc = zmq_setsockopt (socket, ZMQ_AFFINITY, &affinity, sizeof (affinity));
assert (rc);
rc = zmq_bind (socket, "tcp://lo:5556");
assert (rc);
--------
linkzmq:zmq_getsockopt[3]
linkzmq:zmq_socket[3]
+linkzmq:zmq_plain[7]
+linkzmq:zmq_curve[7]
linkzmq:zmq[7]
AUTHORS
-------
-This 0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
-Martin Lucina <mato@kotelna.sk>.
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_socket
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.2
+.\" Source: 0MQ 4.0.4
.\" Language: English
.\"
-.TH "ZMQ_SOCKET" "3" "11/23/2012" "0MQ 3\&.2\&.2" "0MQ Manual"
+.TH "ZMQ_SOCKET" "3" "03/10/2014" "0MQ 4\&.0\&.4" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.sp
The request\-reply pattern is used for sending requests from a ZMQ_REQ \fIclient\fR to one or more ZMQ_REP \fIservices\fR, and receiving subsequent replies to each request sent\&.
.sp
+The request\-reply pattern is formally defined by \m[blue]\fBhttp://rfc\&.zeromq\&.org/spec:28\fR\m[]\&.
+.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.sp
A socket of type \fIZMQ_REQ\fR is used by a \fIclient\fR to send requests to and receive replies from a \fIservice\fR\&. This socket type allows only an alternating sequence of \fIzmq_send(request)\fR and subsequent \fIzmq_recv(reply)\fR calls\&. Each request sent is round\-robined among all \fIservices\fR, and each reply received is matched with the last issued request\&.
.sp
-When a \fIZMQ_REQ\fR socket enters the \fImute\fR state due to having reached the high water mark for all \fIservices\fR, or if there are no \fIservices\fR at all, then any \fBzmq_send\fR(3) operations on the socket shall block until the \fImute\fR state ends or at least one \fIservice\fR becomes available for sending; messages are not discarded\&.
+If no services are available, then any send operation on the socket shall block until at least one \fIservice\fR becomes available\&. The REQ socket shall not discard messages\&.
.sp
.it 1 an-trap
.nr an-no-space-flag 1
\fBZMQ_REP\fR
.RS 4
.sp
-A socket of type \fIZMQ_REP\fR is used by a \fIservice\fR to receive requests from and send replies to a \fIclient\fR\&. This socket type allows only an alternating sequence of \fIzmq_recv(request)\fR and subsequent \fIzmq_send(reply)\fR calls\&. Each request received is fair\-queued from among all \fIclients\fR, and each reply sent is routed to the \fIclient\fR that issued the last request\&. If the original requester doesn\(cqt exist any more the reply is silently discarded\&.
-.sp
-When a \fIZMQ_REP\fR socket enters the \fImute\fR state due to having reached the high water mark for a \fIclient\fR, then any replies sent to the \fIclient\fR in question shall be dropped until the mute state ends\&.
+A socket of type \fIZMQ_REP\fR is used by a \fIservice\fR to receive requests from and send replies to a \fIclient\fR\&. This socket type allows only an alternating sequence of \fIzmq_recv(request)\fR and subsequent \fIzmq_send(reply)\fR calls\&. Each request received is fair\-queued from among all \fIclients\fR, and each reply sent is routed to the \fIclient\fR that issued the last request\&. If the original requester does not exist any more the reply is silently discarded\&.
.sp
.it 1 an-trap
.nr an-no-space-flag 1
lt lt
lt lt
lt lt
-lt lt
lt lt.
T{
.sp
.sp
Last peer
T}
-T{
-.sp
-Action in mute state
-T}:T{
-.sp
-Drop
-T}
.TE
.sp 1
.RE
.sp
When a \fIZMQ_DEALER\fR socket is connected to a \fIZMQ_REP\fR socket each message sent must consist of an empty message part, the \fIdelimiter\fR, followed by one or more \fIbody parts\fR\&.
.sp
-Deprecated alias: \fIZMQ_XREQ\fR\&.
-.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
\fBZMQ_ROUTER\fR
.RS 4
.sp
-A socket of type \fIZMQ_ROUTER\fR is an advanced socket type used for extending request/reply sockets\&. When receiving messages a \fIZMQ_ROUTER\fR socket shall prepend a message part containing the \fIidentity\fR 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 \fIZMQ_ROUTER\fR socket shall remove the first part of the message and use it to determine the \fIidentity\fR of the peer the message shall be routed to\&. If the peer does not exist anymore the message shall be silently discarded by default, unless \fIZMQ_ROUTER_BEHAVIOR\fR socket option is set to \fI1\fR\&.
+A socket of type \fIZMQ_ROUTER\fR is an advanced socket type used for extending request/reply sockets\&. When receiving messages a \fIZMQ_ROUTER\fR socket shall prepend a message part containing the \fIidentity\fR 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 \fIZMQ_ROUTER\fR socket shall remove the first part of the message and use it to determine the \fIidentity\fR of the peer the message shall be routed to\&. If the peer does not exist anymore the message shall be silently discarded by default, unless \fIZMQ_ROUTER_MANDATORY\fR socket option is set to \fI1\fR\&.
.sp
When a \fIZMQ_ROUTER\fR socket enters the \fImute\fR state due to having reached the high water mark for all peers, then any messages sent to the socket shall be dropped until the mute state ends\&. Likewise, any messages routed to a peer for which the individual high water mark has been reached shall also be dropped\&.
.sp
When a \fIZMQ_REQ\fR socket is connected to a \fIZMQ_ROUTER\fR socket, in addition to the \fIidentity\fR of the originating peer each message received shall contain an empty \fIdelimiter\fR message part\&. Hence, the entire structure of each received message as seen by the application becomes: one or more \fIidentity\fR parts, \fIdelimiter\fR part, one or more \fIbody parts\fR\&. When sending replies to a \fIZMQ_REQ\fR socket the application must include the \fIdelimiter\fR part\&.
.sp
-Deprecated alias: \fIZMQ_XREP\fR\&.
-.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.sp
The publish\-subscribe pattern is used for one\-to\-many distribution of data from a single \fIpublisher\fR to multiple \fIsubscribers\fR in a fan out fashion\&.
.sp
+The publish\-subscribe pattern is formally defined by \m[blue]\fBhttp://rfc\&.zeromq\&.org/spec:29\fR\m[]\&.
+.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
lt lt
lt lt
lt lt
-lt lt
lt lt.
T{
.sp
.sp
N/A
T}
-T{
-.sp
-Action in mute state
-T}:T{
-.sp
-Drop
-T}
.TE
.sp 1
.RE
\fBZMQ_XPUB\fR
.RS 4
.sp
-Same as ZMQ_PUB except that you can receive subscriptions from the peers in form of incoming messages\&. Subscription message is a byte 1 (for subscriptions) or byte 0 (for unsubscriptions) followed by the subscription body\&.
+Same as ZMQ_PUB except that you can receive subscriptions from the peers in form of incoming messages\&. Subscription message is a byte 1 (for subscriptions) or byte 0 (for unsubscriptions) followed by the subscription body\&. Messages without a sub/unsub prefix are also received, but have no effect on subscription status\&.
.sp
.it 1 an-trap
.nr an-no-space-flag 1
\fBZMQ_XSUB\fR
.RS 4
.sp
-Same as ZMQ_SUB except that you subscribe by sending subscription messages to the socket\&. Subscription message is a byte 1 (for subscriptions) or byte 0 (for unsubscriptions) followed by the subscription body\&.
+Same as ZMQ_SUB except that you subscribe by sending subscription messages to the socket\&. Subscription message is a byte 1 (for subscriptions) or byte 0 (for unsubscriptions) followed by the subscription body\&. Messages without a sub/unsub prefix may also be sent, but have no effect on subscription status\&.
.sp
.it 1 an-trap
.nr an-no-space-flag 1
.sp
The pipeline pattern is used for distributing data to \fInodes\fR arranged in a pipeline\&. Data always flows down the pipeline, and each stage of the pipeline is connected to at least one \fInode\fR\&. When a pipeline stage is connected to multiple \fInodes\fR data is round\-robined among all connected \fInodes\fR\&.
.sp
+The pipeline pattern is formally defined by \m[blue]\fBhttp://rfc\&.zeromq\&.org/spec:30\fR\m[]\&.
+.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.sp
The exclusive pair pattern is used to connect a peer to precisely one other peer\&. This pattern is used for inter\-thread communication across the inproc transport\&.
.sp
+The exclusive pair pattern is formally defined by \m[blue]\fBhttp://rfc\&.zeromq\&.org/spec:31\fR\m[]\&.
+.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.TE
.sp 1
.RE
+.SS "Native Pattern"
+.sp
+The native pattern is used for communicating with TCP peers and allows asynchronous requests and replies in either direction\&.
+.sp
+.it 1 an-trap
+.nr an-no-space-flag 1
+.nr an-break-flag 1
+.br
+.ps +1
+\fBZMQ_STREAM\fR
+.RS 4
+.sp
+A socket of type \fIZMQ_STREAM\fR is used to send and receive TCP data from a non\-0MQ peer, when using the tcp:// transport\&. A \fIZMQ_STREAM\fR socket can act as client and/or server, sending and/or receiving TCP data asynchronously\&.
+.sp
+When receiving TCP data, a \fIZMQ_STREAM\fR socket shall prepend a message part containing the \fIidentity\fR of the originating peer to the message before passing it to the application\&. Messages received are fair\-queued from among all connected peers\&.
+.sp
+When sending TCP data, a \fIZMQ_STREAM\fR socket shall remove the first part of the message and use it to determine the \fIidentity\fR of the peer the message shall be routed to, and unroutable messages shall cause an EHOSTUNREACH or EAGAIN error\&.
+.sp
+To open a connection to a server, use the zmq_connect call, and then fetch the socket identity using the ZMQ_IDENTITY zmq_getsockopt call\&.
+.sp
+To close a specific client connection, as a server, send the identity frame followed by a zero\-length message (see EXAMPLE section)\&.
+.sp
+The ZMQ_MSGMORE flag is ignored on data frames\&. You must send one identity frame followed by one data frame\&.
+.sp
+Also, please note that omitting the ZMQ_MSGMORE flag will prevent sending further data (from any client) on the same socket\&.
+.sp
+.it 1 an-trap
+.nr an-no-space-flag 1
+.nr an-break-flag 1
+.br
+.B Table\ \&12.\ \&Summary of ZMQ_STREAM characteristics
+.TS
+tab(:);
+lt lt
+lt lt
+lt lt
+lt lt
+lt lt
+lt lt.
+T{
+.sp
+Compatible peer sockets
+T}:T{
+.sp
+none\&.
+T}
+T{
+.sp
+Direction
+T}:T{
+.sp
+Bidirectional
+T}
+T{
+.sp
+Send/receive pattern
+T}:T{
+.sp
+Unrestricted
+T}
+T{
+.sp
+Outgoing routing strategy
+T}:T{
+.sp
+See text
+T}
+T{
+.sp
+Incoming routing strategy
+T}:T{
+.sp
+Fair\-queued
+T}
+T{
+.sp
+Action in mute state
+T}:T{
+.sp
+EAGAIN
+T}
+.TE
+.sp 1
+.RE
.SH "RETURN VALUE"
.sp
The \fIzmq_socket()\fR function shall return an opaque handle to the newly created socket if successful\&. Otherwise, it shall return NULL and set \fIerrno\fR to one of the values defined below\&.
.RS 4
The context specified was terminated\&.
.RE
+.SH "EXAMPLE"
+.PP
+\fBCreating a simple HTTP server using ZMQ_STREAM\fR.
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+void *ctx = zmq_ctx_new ();
+assert (ctx);
+/* Create ZMQ_STREAM socket */
+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;
+while (1) {
+ /* Get HTTP request; ID frame and then request */
+ id_size = zmq_recv (server, id, 256, 0);
+ assert (id_size > 0);
+ /* Prepares the response */
+ char http_response [] =
+ "HTTP/1\&.0 200 OK\er\en"
+ "Content\-Type: text/plain\er\en"
+ "\er\en"
+ "Hello, World!";
+ /* Sends the ID frame followed by the response */
+ zmq_send (socket, id, id_size, ZMQ_SNDMORE);
+ zmq_send (socket, http_response, strlen (http_response), ZMQ_SNDMORE);
+ /* Closes the connection by sending the ID frame followed by a zero response */
+ zmq_send (socket, id, id_size, ZMQ_SNDMORE);
+ zmq_send (socket, 0, 0, ZMQ_SNDMORE);
+ /* NOTE: If we don\*(Aqt use ZMQ_SNDMORE, then we won\*(Aqt be able to send more */
+ /* message to any client */
+}
+zmq_close (socket);
+zmq_ctx_destroy (ctx);
+.fi
+.if n \{\
+.RE
+.\}
+.sp
.SH "SEE ALSO"
.sp
\fBzmq_init\fR(3) \fBzmq_setsockopt\fR(3) \fBzmq_bind\fR(3) \fBzmq_connect\fR(3) \fBzmq_send\fR(3) \fBzmq_recv\fR(3) \fBzmq_inproc\fR(7) \fBzmq\fR(7)
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Martin Sustrik <\m[blue]\fBsustrik@250bpm\&.com\fR\m[]\&\s-2\u[1]\d\s+2>, Martin Lucina <\m[blue]\fBmato@kotelna\&.sk\fR\m[]\&\s-2\u[2]\d\s+2>, and Pieter Hintjens <\m[blue]\fBph@imatix\&.com\fR\m[]\&\s-2\u[3]\d\s+2>\&.
-.SH "NOTES"
-.IP " 1." 4
-sustrik@250bpm.com
-.RS 4
-\%mailto:sustrik@250bpm.com
-.RE
-.IP " 2." 4
-mato@kotelna.sk
-.RS 4
-\%mailto:mato@kotelna.sk
-.RE
-.IP " 3." 4
-ph@imatix.com
-.RS 4
-\%mailto:ph@imatix.com
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
<div class="paragraph"><p>The request-reply pattern is used for sending requests from a ZMQ_REQ <em>client</em>\r
to one or more ZMQ_REP <em>services</em>, and receiving subsequent replies to each\r
request sent.</p></div>\r
+<div class="paragraph"><p>The request-reply pattern is formally defined by <a href="http://rfc.zeromq.org/spec:28">http://rfc.zeromq.org/spec:28</a>.</p></div>\r
<div class="sect3">\r
<h4 id="_zmq_req">ZMQ_REQ</h4>\r
<div class="paragraph"><p>A socket of type <em>ZMQ_REQ</em> is used by a <em>client</em> to send requests to and\r
sequence of <em>zmq_send(request)</em> and subsequent <em>zmq_recv(reply)</em> calls. Each\r
request sent is round-robined among all <em>services</em>, and each reply received is\r
matched with the last issued request.</p></div>\r
-<div class="paragraph"><p>When a <em>ZMQ_REQ</em> socket enters the <em>mute</em> state due to having reached the\r
-high water mark for all <em>services</em>, or if there are no <em>services</em> at all, then\r
-any <a href="zmq_send.html">zmq_send(3)</a> operations on the socket shall block until the\r
-<em>mute</em> state ends or at least one <em>service</em> becomes available for sending;\r
-messages are not discarded.</p></div>\r
+<div class="paragraph"><p>If no services are available, then any send operation on the socket shall\r
+block until at least one <em>service</em> becomes available. The REQ socket shall\r
+not discard messages.</p></div>\r
<div class="hdlist"><div class="title">Summary of ZMQ_REQ characteristics</div><table>\r
<tr>\r
<td class="hdlist1">\r
sequence of <em>zmq_recv(request)</em> and subsequent <em>zmq_send(reply)</em> calls. Each\r
request received is fair-queued from among all <em>clients</em>, and each reply sent\r
is routed to the <em>client</em> that issued the last request. If the original\r
-requester doesn’t exist any more the reply is silently discarded.</p></div>\r
-<div class="paragraph"><p>When a <em>ZMQ_REP</em> socket enters the <em>mute</em> state due to having reached the\r
-high water mark for a <em>client</em>, then any replies sent to the <em>client</em> in\r
-question shall be dropped until the mute state ends.</p></div>\r
+requester does not exist any more the reply is silently discarded.</p></div>\r
<div class="hdlist"><div class="title">Summary of ZMQ_REP characteristics</div><table>\r
<tr>\r
<td class="hdlist1">\r
</p>\r
</td>\r
</tr>\r
-<tr>\r
-<td class="hdlist1">\r
-Action in mute state\r
-<br />\r
-</td>\r
-<td class="hdlist2">\r
-<p style="margin-top: 0;">\r
-Drop\r
-</p>\r
-</td>\r
-</tr>\r
</table></div>\r
</div>\r
<div class="sect3">\r
<div class="paragraph"><p>When a <em>ZMQ_DEALER</em> socket is connected to a <em>ZMQ_REP</em> socket each message sent\r
must consist of an empty message part, the <em>delimiter</em>, followed by one or more\r
<em>body parts</em>.</p></div>\r
-<div class="paragraph"><p>Deprecated alias: <em>ZMQ_XREQ</em>.</p></div>\r
<div class="hdlist"><div class="title">Summary of ZMQ_DEALER characteristics</div><table>\r
<tr>\r
<td class="hdlist1">\r
from among all connected peers. When sending messages a <em>ZMQ_ROUTER</em> socket shall\r
remove the first part of the message and use it to determine the <em>identity</em> of\r
the peer the message shall be routed to. If the peer does not exist anymore\r
-the message shall be silently discarded by default, unless <em>ZMQ_ROUTER_BEHAVIOR</em>\r
+the message shall be silently discarded by default, unless <em>ZMQ_ROUTER_MANDATORY</em>\r
socket option is set to <em>1</em>.</p></div>\r
<div class="paragraph"><p>When a <em>ZMQ_ROUTER</em> socket enters the <em>mute</em> state due to having reached the\r
high water mark for all peers, then any messages sent to the socket shall be dropped\r
as seen by the application becomes: one or more <em>identity</em> parts, <em>delimiter</em>\r
part, one or more <em>body parts</em>. When sending replies to a <em>ZMQ_REQ</em> socket the\r
application must include the <em>delimiter</em> part.</p></div>\r
-<div class="paragraph"><p>Deprecated alias: <em>ZMQ_XREP</em>.</p></div>\r
<div class="hdlist"><div class="title">Summary of ZMQ_ROUTER characteristics</div><table>\r
<tr>\r
<td class="hdlist1">\r
<h3 id="_publish_subscribe_pattern">Publish-subscribe pattern</h3>\r
<div class="paragraph"><p>The publish-subscribe pattern is used for one-to-many distribution of data from\r
a single <em>publisher</em> to multiple <em>subscribers</em> in a fan out fashion.</p></div>\r
+<div class="paragraph"><p>The publish-subscribe pattern is formally defined by <a href="http://rfc.zeromq.org/spec:29">http://rfc.zeromq.org/spec:29</a>.</p></div>\r
<div class="sect3">\r
<h4 id="_zmq_pub">ZMQ_PUB</h4>\r
<div class="paragraph"><p>A socket of type <em>ZMQ_PUB</em> is used by a <em>publisher</em> to distribute data.\r
</p>\r
</td>\r
</tr>\r
-<tr>\r
-<td class="hdlist1">\r
-Action in mute state\r
-<br />\r
-</td>\r
-<td class="hdlist2">\r
-<p style="margin-top: 0;">\r
-Drop\r
-</p>\r
-</td>\r
-</tr>\r
</table></div>\r
</div>\r
<div class="sect3">\r
<div class="paragraph"><p>Same as ZMQ_PUB except that you can receive subscriptions from the peers\r
in form of incoming messages. Subscription message is a byte 1 (for\r
subscriptions) or byte 0 (for unsubscriptions) followed by the subscription\r
-body.</p></div>\r
+body. Messages without a sub/unsub prefix are also received, but have no\r
+effect on subscription status.</p></div>\r
<div class="hdlist"><div class="title">Summary of ZMQ_XPUB characteristics</div><table>\r
<tr>\r
<td class="hdlist1">\r
<h4 id="_zmq_xsub">ZMQ_XSUB</h4>\r
<div class="paragraph"><p>Same as ZMQ_SUB except that you subscribe by sending subscription messages to\r
the socket. Subscription message is a byte 1 (for subscriptions) or byte 0\r
-(for unsubscriptions) followed by the subscription body.</p></div>\r
+(for unsubscriptions) followed by the subscription body. Messages without a\r
+sub/unsub prefix may also be sent, but have no effect on subscription status.</p></div>\r
<div class="hdlist"><div class="title">Summary of ZMQ_XSUB characteristics</div><table>\r
<tr>\r
<td class="hdlist1">\r
a pipeline. Data always flows down the pipeline, and each stage of the pipeline\r
is connected to at least one <em>node</em>. When a pipeline stage is connected to\r
multiple <em>nodes</em> data is round-robined among all connected <em>nodes</em>.</p></div>\r
+<div class="paragraph"><p>The pipeline pattern is formally defined by <a href="http://rfc.zeromq.org/spec:30">http://rfc.zeromq.org/spec:30</a>.</p></div>\r
<div class="sect3">\r
<h4 id="_zmq_push">ZMQ_PUSH</h4>\r
<div class="paragraph"><p>A socket of type <em>ZMQ_PUSH</em> is used by a pipeline <em>node</em> to send messages\r
<div class="paragraph"><p>The exclusive pair pattern is used to connect a peer to precisely one other\r
peer. This pattern is used for inter-thread communication across the inproc\r
transport.</p></div>\r
+<div class="paragraph"><p>The exclusive pair pattern is formally defined by <a href="http://rfc.zeromq.org/spec:31">http://rfc.zeromq.org/spec:31</a>.</p></div>\r
<div class="sect3">\r
<h4 id="_zmq_pair">ZMQ_PAIR</h4>\r
<div class="paragraph"><p>A socket of type <em>ZMQ_PAIR</em> can only be connected to a single peer at any one\r
</table></div>\r
</div>\r
</div>\r
+<div class="sect2">\r
+<h3 id="_native_pattern">Native Pattern</h3>\r
+<div class="paragraph"><p>The native pattern is used for communicating with TCP peers and allows\r
+asynchronous requests and replies in either direction.</p></div>\r
+<div class="sect3">\r
+<h4 id="_zmq_stream">ZMQ_STREAM</h4>\r
+<div class="paragraph"><p>A socket of type <em>ZMQ_STREAM</em> is used to send and receive TCP data from a\r
+non-ØMQ peer, when using the tcp:// transport. A <em>ZMQ_STREAM</em> socket can\r
+act as client and/or server, sending and/or receiving TCP data asynchronously.</p></div>\r
+<div class="paragraph"><p>When receiving TCP data, a <em>ZMQ_STREAM</em> socket shall prepend a message part\r
+containing the <em>identity</em> of the originating peer to the message before passing\r
+it to the application. Messages received are fair-queued from among all\r
+connected peers.</p></div>\r
+<div class="paragraph"><p>When sending TCP data, a <em>ZMQ_STREAM</em> socket shall remove the first part of the\r
+message and use it to determine the <em>identity</em> of the peer the message shall be\r
+routed to, and unroutable messages shall cause an EHOSTUNREACH or EAGAIN error.</p></div>\r
+<div class="paragraph"><p>To open a connection to a server, use the zmq_connect call, and then fetch the\r
+socket identity using the ZMQ_IDENTITY zmq_getsockopt call.</p></div>\r
+<div class="paragraph"><p>To close a specific client connection, as a server, send the identity frame\r
+followed by a zero-length message (see EXAMPLE section).</p></div>\r
+<div class="paragraph"><p>The ZMQ_MSGMORE flag is ignored on data frames. You must send one identity frame\r
+followed by one data frame.</p></div>\r
+<div class="paragraph"><p>Also, please note that omitting the ZMQ_MSGMORE flag will prevent sending further\r
+data (from any client) on the same socket.</p></div>\r
+<div class="hdlist"><div class="title">Summary of ZMQ_STREAM characteristics</div><table>\r
+<tr>\r
+<td class="hdlist1">\r
+Compatible peer sockets\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+none.\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Direction\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+Bidirectional\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Send/receive pattern\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+Unrestricted\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Outgoing routing strategy\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+See text\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Incoming routing strategy\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+Fair-queued\r
+</p>\r
+</td>\r
+</tr>\r
+<tr>\r
+<td class="hdlist1">\r
+Action in mute state\r
+<br />\r
+</td>\r
+<td class="hdlist2">\r
+<p style="margin-top: 0;">\r
+EAGAIN\r
+</p>\r
+</td>\r
+</tr>\r
+</table></div>\r
+</div>\r
+</div>\r
</div>\r
</div>\r
<div class="sect1">\r
</div>\r
</div>\r
<div class="sect1">\r
+<h2 id="_example">EXAMPLE</h2>\r
+<div class="sectionbody">\r
+<div class="listingblock">\r
+<div class="title">Creating a simple HTTP server using ZMQ_STREAM</div>\r
+<div class="content">\r
+<pre><tt>void *ctx = zmq_ctx_new ();\r
+assert (ctx);\r
+/* Create ZMQ_STREAM socket */\r
+void *socket = zmq_socket (ctx, ZMQ_STREAM);\r
+assert (socket);\r
+int rc = zmq_bind (socket, "tcp://*:8080");\r
+assert (rc == 0);\r
+/* Data structure to hold the ZMQ_STREAM ID */\r
+uint8_t id [256];\r
+size_t id_size = 256;\r
+while (1) {\r
+ /* Get HTTP request; ID frame and then request */\r
+ id_size = zmq_recv (server, id, 256, 0);\r
+ assert (id_size > 0);\r
+ /* Prepares the response */\r
+ char http_response [] =\r
+ "HTTP/1.0 200 OK\r\n"\r
+ "Content-Type: text/plain\r\n"\r
+ "\r\n"\r
+ "Hello, World!";\r
+ /* Sends the ID frame followed by the response */\r
+ zmq_send (socket, id, id_size, ZMQ_SNDMORE);\r
+ zmq_send (socket, http_response, strlen (http_response), ZMQ_SNDMORE);\r
+ /* Closes the connection by sending the ID frame followed by a zero response */\r
+ zmq_send (socket, id, id_size, ZMQ_SNDMORE);\r
+ zmq_send (socket, 0, 0, ZMQ_SNDMORE);\r
+ /* NOTE: If we don't use ZMQ_SNDMORE, then we won't be able to send more */\r
+ /* message to any client */\r
+}\r
+zmq_close (socket);\r
+zmq_ctx_destroy (ctx);</tt></pre>\r
+</div></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
<h2 id="_see_also">SEE ALSO</h2>\r
<div class="sectionbody">\r
<div class="paragraph"><p><a href="zmq_init.html">zmq_init(3)</a>\r
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Martin Sustrik <<a href="mailto:sustrik@250bpm.com">sustrik@250bpm.com</a>>,\r
-Martin Lucina <<a href="mailto:mato@kotelna.sk">mato@kotelna.sk</a>>, and Pieter Hintjens <<a href="mailto:ph@imatix.com">ph@imatix.com</a>>.</p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-11-14 10:09:14 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-12-08 08:02:10 CET\r
</div>\r
</div>\r
</body>\r
to one or more ZMQ_REP _services_, and receiving subsequent replies to each
request sent.
+The request-reply pattern is formally defined by http://rfc.zeromq.org/spec:28.
ZMQ_REQ
^^^^^^^
request sent is round-robined among all _services_, and each reply received is
matched with the last issued request.
-When a 'ZMQ_REQ' socket enters the 'mute' state due to having reached the
-high water mark for all _services_, or if there are no _services_ at all, then
-any linkzmq:zmq_send[3] operations on the socket shall block until the
-'mute' state ends or at least one _service_ becomes available for sending;
-messages are not discarded.
+If no services are available, then any send operation on the socket shall
+block until at least one _service_ becomes available. The REQ socket shall
+not discard messages.
[horizontal]
.Summary of ZMQ_REQ characteristics
sequence of _zmq_recv(request)_ and subsequent _zmq_send(reply)_ calls. Each
request received is fair-queued from among all _clients_, and each reply sent
is routed to the _client_ that issued the last request. If the original
-requester doesn't exist any more the reply is silently discarded.
-
-When a 'ZMQ_REP' socket enters the 'mute' state due to having reached the
-high water mark for a _client_, then any replies sent to the _client_ in
-question shall be dropped until the mute state ends.
+requester does not exist any more the reply is silently discarded.
[horizontal]
.Summary of ZMQ_REP characteristics
Send/receive pattern:: Receive, Send, Receive, Send, ...
Incoming routing strategy:: Fair-queued
Outgoing routing strategy:: Last peer
-Action in mute state:: Drop
ZMQ_DEALER
must consist of an empty message part, the _delimiter_, followed by one or more
_body parts_.
-Deprecated alias: 'ZMQ_XREQ'.
-
[horizontal]
.Summary of ZMQ_DEALER characteristics
Compatible peer sockets:: 'ZMQ_ROUTER', 'ZMQ_REP', 'ZMQ_DEALER'
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. If the peer does not exist anymore
-the message shall be silently discarded by default, unless 'ZMQ_ROUTER_BEHAVIOR'
+the message shall be silently discarded by default, unless 'ZMQ_ROUTER_MANDATORY'
socket option is set to '1'.
When a 'ZMQ_ROUTER' socket enters the 'mute' state due to having reached the
part, one or more _body parts_. When sending replies to a 'ZMQ_REQ' socket the
application must include the _delimiter_ part.
-Deprecated alias: 'ZMQ_XREP'.
-
[horizontal]
.Summary of ZMQ_ROUTER characteristics
Compatible peer sockets:: 'ZMQ_DEALER', 'ZMQ_REQ', 'ZMQ_ROUTER'
The publish-subscribe pattern is used for one-to-many distribution of data from
a single _publisher_ to multiple _subscribers_ in a fan out fashion.
+The publish-subscribe pattern is formally defined by http://rfc.zeromq.org/spec:29.
ZMQ_PUB
^^^^^^^
Send/receive pattern:: Receive only
Incoming routing strategy:: Fair-queued
Outgoing routing strategy:: N/A
-Action in mute state:: Drop
ZMQ_XPUB
Same as ZMQ_PUB except that you can receive subscriptions from the peers
in form of incoming messages. Subscription message is a byte 1 (for
subscriptions) or byte 0 (for unsubscriptions) followed by the subscription
-body.
+body. Messages without a sub/unsub prefix are also received, but have no
+effect on subscription status.
[horizontal]
.Summary of ZMQ_XPUB characteristics
^^^^^^^^
Same as ZMQ_SUB except that you subscribe by sending subscription messages to
the socket. Subscription message is a byte 1 (for subscriptions) or byte 0
-(for unsubscriptions) followed by the subscription body.
+(for unsubscriptions) followed by the subscription body. Messages without a
+sub/unsub prefix may also be sent, but have no effect on subscription status.
[horizontal]
.Summary of ZMQ_XSUB characteristics
is connected to at least one _node_. When a pipeline stage is connected to
multiple _nodes_ data is round-robined among all connected _nodes_.
+The pipeline pattern is formally defined by http://rfc.zeromq.org/spec:30.
ZMQ_PUSH
^^^^^^^^
peer. This pattern is used for inter-thread communication across the inproc
transport.
+The exclusive pair pattern is formally defined by http://rfc.zeromq.org/spec:31.
ZMQ_PAIR
^^^^^^^^
Action in mute state:: Block
+Native Pattern
+~~~~~~~~~~~~~~
+The native pattern is used for communicating with TCP peers and allows
+asynchronous requests and replies in either direction.
+
+
+ZMQ_STREAM
+^^^^^^^^^^
+A socket of type 'ZMQ_STREAM' is used to send and receive TCP data from a
+non-0MQ peer, when using the tcp:// transport. A 'ZMQ_STREAM' socket can
+act as client and/or server, sending and/or receiving TCP data asynchronously.
+
+When receiving TCP data, a 'ZMQ_STREAM' 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 TCP data, a 'ZMQ_STREAM' 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, and unroutable messages shall cause an EHOSTUNREACH or EAGAIN error.
+
+To open a connection to a server, use the zmq_connect call, and then fetch the
+socket identity using the ZMQ_IDENTITY zmq_getsockopt call.
+
+To close a specific client connection, as a server, send the identity frame
+followed by a zero-length message (see EXAMPLE section).
+
+The ZMQ_MSGMORE flag is ignored on data frames. You must send one identity frame
+followed by one data frame.
+
+Also, please note that omitting the ZMQ_MSGMORE flag will prevent sending further
+data (from any client) on the same socket.
+
+[horizontal]
+.Summary of ZMQ_STREAM characteristics
+Compatible peer sockets:: none.
+Direction:: Bidirectional
+Send/receive pattern:: Unrestricted
+Outgoing routing strategy:: See text
+Incoming routing strategy:: Fair-queued
+Action in mute state:: EAGAIN
+
+
RETURN VALUE
------------
The _zmq_socket()_ function shall return an opaque handle to the newly created
*ETERM*::
The context specified was terminated.
+EXAMPLE
+-------
+.Creating a simple HTTP server using ZMQ_STREAM
+----
+void *ctx = zmq_ctx_new ();
+assert (ctx);
+/* Create ZMQ_STREAM socket */
+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;
+while (1) {
+ /* Get HTTP request; ID frame and then request */
+ id_size = zmq_recv (server, id, 256, 0);
+ assert (id_size > 0);
+ /* Prepares the response */
+ char http_response [] =
+ "HTTP/1.0 200 OK\r\n"
+ "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);
+ zmq_send (socket, http_response, strlen (http_response), ZMQ_SNDMORE);
+ /* Closes the connection by sending the ID frame followed by a zero response */
+ zmq_send (socket, id, id_size, ZMQ_SNDMORE);
+ zmq_send (socket, 0, 0, ZMQ_SNDMORE);
+ /* NOTE: If we don't use ZMQ_SNDMORE, then we won't be able to send more */
+ /* message to any client */
+}
+zmq_close (socket);
+zmq_ctx_destroy (ctx);
+----
+
+
SEE ALSO
--------
linkzmq:zmq_init[3]
AUTHORS
-------
-This 0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com>,
-Martin Lucina <mato@kotelna.sk>, and Pieter Hintjens <ph@imatix.com>.
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_ctx_socket_monitor
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.1
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_CTX_SOCKET_MONIT" "3" "11/23/2012" "0MQ 3\&.2\&.1" "0MQ Manual"
+.TH "ZMQ_CTX_SOCKET_MONIT" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
\fBint zmq_socket_monitor (void \fR\fB\fI*socket\fR\fR\fB, char * \fR\fB\fI*addr\fR\fR\fB, int \fR\fB\fIevents\fR\fR\fB);\fR
.SH "DESCRIPTION"
.sp
-The \fIzmq_socket_monitor()\fR function shall spawn a \fIPAIR\fR socket that publishes socket state changes (events) over the inproc:// transport to a given endpoint\&. Messages are \fIzmq_event_t\fR structs\&. It\(cqs recommended to connect via a \fIPAIR\fR socket in another application thread and handle monitoring events there\&. It\(cqs possible to also supply a bitmask (\fIZMQ_EVENT_ALL\fR or any combination of the \fIZMQ_EVENT_*\fR constants) of the events you\(cqre interested in\&.
+The \fIzmq_socket_monitor()\fR function shall spawn a \fIPAIR\fR socket that publishes socket state changes (events) over the inproc:// transport to a given endpoint\&.
.sp
-.if n \{\
-.RS 4
-.\}
-.nf
-// monitoring thread
-static void *req_socket_monitor (void *ctx)
-{
- zmq_event_t event;
- int rc;
-
- void *s = zmq_socket (ctx, ZMQ_PAIR);
- assert (s);
-
- rc = zmq_connect (s, "inproc://monitor\&.req");
- assert (rc == 0);
- while (true) {
- zmq_msg_t msg;
- zmq_msg_init (&msg);
- rc = zmq_recvmsg (s, &msg, 0);
- if (rc == \-1 && zmq_errno() == ETERM) break;
- assert (rc != \-1);
- memcpy (&event, zmq_msg_data (&msg), sizeof (event));
- switch (event\&.event) {
- case ZMQ_EVENT_CONNECTED:
- // handle socket connected event
- break;
- case ZMQ_EVENT_CLOSED:
- // handle socket closed event
- break;
- }
- }
- zmq_close (s);
- return NULL;
-}
-
-// register a monitor endpoint for all socket events
-rc = zmq_socket_monitor (req, "inproc://monitor\&.req", ZMQ_EVENT_ALL);
-assert (rc == 0);
-
-// spawn a monitoring thread
-rc = pthread_create (&threads [0], NULL, req_socket_monitor, ctx);
-assert (rc == 0);
-.fi
-.if n \{\
-.RE
-.\}
+Messages consist of 2 Frames, the first containing the event\-id and the associated value\&. The second frame holds the affected endpoint as string\&.
.sp
-Only connection oriented (tcp and ipc) transports are supported in this initial implementation\&.
+The layout of the first Frame is: 16 bit event id 32 bit event value
.sp
-Supported events are:
-.SS "ZMQ_EVENT_CONNECTED: connection established"
+event id and value are in the native byte order (for the machine the application is running on)\&. There is no padding between the fields\&.
.sp
-The \fIZMQ_EVENT_CONNECTED\fR event triggers when a connection has been established to a remote peer\&. This can happen either synchronous or asynchronous\&.
-.PP
-\fBEvent metadata:\fR.
+The event value has to be interpreted in the context of the event id\&. See \fISupported events\fR below for details\&.
.sp
.if n \{\
.RS 4
.\}
.nf
-data\&.connected\&.addr // peer address
-data\&.connected\&.fd // socket descriptor
+Only connection oriented (tcp and ipc) transports are supported in this initial
+implementation\&.
.fi
.if n \{\
.RE
.\}
+.SH "SUPPORTED EVENTS"
+.SS "ZMQ_EVENT_CONNECTED: connection established"
.sp
+The \fIZMQ_EVENT_CONNECTED\fR event triggers when a connection has been established to a remote peer\&. This can happen either synchronous or asynchronous\&. Value is the FD of the newly connected socket\&.
.SS "ZMQ_EVENT_CONNECT_DELAYED: synchronous connect failed, it\(cqs being polled"
.sp
-The \fIZMQ_EVENT_CONNECT_DELAYED\fR event triggers when an immediate connection attempt is delayed and it\(cqs completion\(cqs being polled for\&.
-.PP
-\fBEvent metadata:\fR.
-.sp
-.if n \{\
-.RS 4
-.\}
-.nf
-data\&.connect_delayed\&.addr // peer address
-data\&.connect_delayed\&.err // errno value
-.fi
-.if n \{\
-.RE
-.\}
-.sp
+The \fIZMQ_EVENT_CONNECT_DELAYED\fR event triggers when an immediate connection attempt is delayed and its completion is being polled for\&. Value has no meaning\&.
.SS "ZMQ_EVENT_CONNECT_RETRIED: asynchronous connect / reconnection attempt"
.sp
-The \fIZMQ_EVENT_CONNECT_RETRIED\fR event triggers when a connection attempt is being handled by reconnect timer\&. The reconnect interval\(cqs recomputed for each attempt\&.
-.PP
-\fBEvent metadata:\fR.
-.sp
-.if n \{\
-.RS 4
-.\}
-.nf
-data\&.connect_retried\&.addr // peer address
-data\&.connect_retried\&.interval // computed reconnect interval
-.fi
-.if n \{\
-.RE
-.\}
-.sp
+The \fIZMQ_EVENT_CONNECT_RETRIED\fR event triggers when a connection attempt is being handled by reconnect timer\&. The reconnect interval\(cqs recomputed for each attempt\&. Value is the reconnect interval\&.
.SS "ZMQ_EVENT_LISTENING: socket bound to an address, ready to accept connections"
.sp
-The \fIZMQ_EVENT_LISTENING\fR event triggers when a socket\(cqs successfully bound to a an interface\&.
-.PP
-\fBEvent metadata:\fR.
-.sp
-.if n \{\
-.RS 4
-.\}
-.nf
-data\&.listening\&.addr // listen address
-data\&.listening\&.fd // socket descriptor
-.fi
-.if n \{\
-.RE
-.\}
-.sp
+The \fIZMQ_EVENT_LISTENING\fR event triggers when a socket\(cqs successfully bound to a an interface\&. Value is the FD of the newly bound socket\&.
.SS "ZMQ_EVENT_BIND_FAILED: socket could not bind to an address"
.sp
-The \fIZMQ_EVENT_BIND_FAILED\fR event triggers when a socket could not bind to a given interface\&.
-.PP
-\fBEvent metadata:\fR.
-.sp
-.if n \{\
-.RS 4
-.\}
-.nf
-data\&.bind_failed\&.addr // listen address
-data\&.bind_failed\&.err // errno value
-.fi
-.if n \{\
-.RE
-.\}
-.sp
+The \fIZMQ_EVENT_BIND_FAILED\fR event triggers when a socket could not bind to a given interface\&. Value is the errno generated by the bind call\&.
.SS "ZMQ_EVENT_ACCEPTED: connection accepted to bound interface"
.sp
-The \fIZMQ_EVENT_ACCEPTED\fR event triggers when a connection from a remote peer has been established with a socket\(cqs listen address\&.
-.PP
-\fBEvent metadata:\fR.
-.sp
-.if n \{\
-.RS 4
-.\}
-.nf
-data\&.accepted\&.addr // listen address
-data\&.accepted\&.fd // socket descriptor
-.fi
-.if n \{\
-.RE
-.\}
-.sp
+The \fIZMQ_EVENT_ACCEPTED\fR event triggers when a connection from a remote peer has been established with a socket\(cqs listen address\&. Value is the FD of the accepted socket\&.
.SS "ZMQ_EVENT_ACCEPT_FAILED: could not accept client connection"
.sp
-The \fIZMQ_EVENT_ACCEPT_FAILED\fR event triggers when a connection attempt to a socket\(cqs bound address fails\&.
-.PP
-\fBEvent metadata:\fR.
-.sp
-.if n \{\
-.RS 4
-.\}
-.nf
-data\&.accept_failed\&.addr // listen address
-data\&.accept_failed\&.err // errno value
-.fi
-.if n \{\
-.RE
-.\}
-.sp
+The \fIZMQ_EVENT_ACCEPT_FAILED\fR event triggers when a connection attempt to a socket\(cqs bound address fails\&. Value is the errno generated by accept\&.
.SS "ZMQ_EVENT_CLOSED: connection closed"
.sp
-The \fIZMQ_EVENT_CLOSED\fR event triggers when a connection\(cqs underlying descriptor has been closed\&.
-.PP
-\fBEvent metadata:\fR.
-.sp
-.if n \{\
-.RS 4
-.\}
-.nf
-data\&.closed\&.addr // address
-data\&.closed\&.fd // socket descriptor
-.fi
-.if n \{\
-.RE
-.\}
-.sp
+The \fIZMQ_EVENT_CLOSED\fR event triggers when a connection\(cqs underlying descriptor has been closed\&. Value is the former FD of the for the closed socket\&. FD has been closed already!
.SS "ZMQ_EVENT_CLOSE_FAILED: connection couldn\(cqt be closed"
.sp
-The \fIZMQ_EVENT_CLOSE_FAILED\fR event triggers when a descriptor could not be released back to the OS\&.
-.PP
-\fBEvent metadata:\fR.
-.sp
-.if n \{\
-.RS 4
-.\}
-.nf
-data\&.close_failed\&.addr // address
-data\&.close_failed\&.err // errno value
-.fi
-.if n \{\
-.RE
-.\}
-.sp
+The \fIZMQ_EVENT_CLOSE_FAILED\fR event triggers when a descriptor could not be released back to the OS\&. Implementation note: ONLY FOR IPC SOCKETS\&. Value is the errno generated by unlink\&.
.SS "ZMQ_EVENT_DISCONNECTED: broken session"
.sp
-The \fIZMQ_EVENT_DISCONNECTED\fR event triggers when the stream engine (tcp and ipc specific) detects a corrupted / broken session\&.
-.PP
-\fBEvent metadata:\fR.
-.sp
-.if n \{\
-.RS 4
-.\}
-.nf
-data\&.disconnected\&.addr // address
-data\&.disconnected\&.fd // socket descriptor
-.fi
-.if n \{\
-.RE
-.\}
-.sp
+The \fIZMQ_EVENT_DISCONNECTED\fR event triggers when the stream engine (tcp and ipc specific) detects a corrupted / broken session\&. Value is the FD of the socket\&.
.SH "RETURN VALUE"
.sp
The \fIzmq_socket_monitor()\fR function returns a value of 0 or greater if successful\&. Otherwise it returns \-1 and sets \fIerrno\fR to one of the values defined below\&.
.RS 4
.\}
.nf
+#include <stdio\&.h>
+#include <zmq\&.h>
+#include <pthread\&.h>
+#include <string\&.h>
+#include <assert\&.h>
+
+static int read_msg(void* s, zmq_event_t* event, char* ep)
+{
+ int rc ;
+ zmq_msg_t msg1; // binary part
+ zmq_msg_init (&msg1);
+ zmq_msg_t msg2; // address part
+ zmq_msg_init (&msg2);
+ rc = zmq_msg_recv (&msg1, s, 0);
+ if (rc == \-1 && zmq_errno() == ETERM)
+ return 1 ;
+ assert (rc != \-1);
+ assert (zmq_msg_more(&msg1) != 0);
+ rc = zmq_msg_recv (&msg2, s, 0);
+ if (rc == \-1 && zmq_errno() == ETERM)
+ return 1;
+ assert (rc != \-1);
+ assert (zmq_msg_more(&msg2) == 0);
+ // copy binary data to event struct
+ const char* data = (char*)zmq_msg_data(&msg1);
+ memcpy(&(event\->event), data, sizeof(event\->event));
+ memcpy(&(event\->value), data+sizeof(event\->event), sizeof(event\->value));
+ // copy address part
+ const size_t len = zmq_msg_size(&msg2) ;
+ ep = memcpy(ep, zmq_msg_data(&msg2), len);
+ *(ep + len) = 0 ;
+ return 0 ;
+}
+
// REP socket monitor thread
static void *rep_socket_monitor (void *ctx)
{
zmq_event_t event;
+ static char addr[1025] ;
int rc;
+ printf("starting monitor\&.\&.\&.\en");
+
void *s = zmq_socket (ctx, ZMQ_PAIR);
assert (s);
rc = zmq_connect (s, "inproc://monitor\&.rep");
assert (rc == 0);
- while (true) {
- zmq_msg_t msg;
- zmq_msg_init (&msg);
- rc = zmq_recvmsg (s, &msg, 0);
- if (rc == \-1 && zmq_errno() == ETERM) break;
- assert (rc != \-1);
- memcpy (&event, zmq_msg_data (&msg), sizeof (event));
+ while (!read_msg(s, &event, addr)) {
switch (event\&.event) {
case ZMQ_EVENT_LISTENING:
- printf ("listening socket descriptor %d\en", event\&.data\&.listening\&.fd);
- printf ("listening socket address %s\en", event\&.data\&.listening\&.addr);
+ printf ("listening socket descriptor %d\en", event\&.value);
+ printf ("listening socket address %s\en", addr);
break;
case ZMQ_EVENT_ACCEPTED:
- printf ("accepted socket descriptor %d\en", event\&.data\&.accepted\&.fd);
- printf ("accepted socket address %s\en", event\&.data\&.accepted\&.addr);
+ printf ("accepted socket descriptor %d\en", event\&.value);
+ printf ("accepted socket address %s\en", addr);
break;
case ZMQ_EVENT_CLOSE_FAILED:
- printf ("socket close failure error code %d\en", event\&.data\&.close_failed\&.err);
- printf ("socket address %s\en", event\&.data\&.close_failed\&.addr);
+ printf ("socket close failure error code %d\en", event\&.value);
+ printf ("socket address %s\en", addr);
break;
case ZMQ_EVENT_CLOSED:
- printf ("closed socket descriptor %d\en", event\&.data\&.closed\&.fd);
- printf ("closed socket address %s\en", event\&.data\&.closed\&.addr);
+ printf ("closed socket descriptor %d\en", event\&.value);
+ printf ("closed socket address %s\en", addr);
break;
case ZMQ_EVENT_DISCONNECTED:
- printf ("disconnected socket descriptor %d\en", event\&.data\&.disconnected\&.fd);
- printf ("disconnected socket address %s\en", event\&.data\&.disconnected\&.addr);
+ printf ("disconnected socket descriptor %d\en", event\&.value);
+ printf ("disconnected socket address %s\en", addr);
break;
}
- zmq_msg_close (&msg);
}
zmq_close (s);
return NULL;
}
-// Create the infrastructure
-void *ctx = zmq_init (1);
-assert (ctx);
+int main()
+{
+ const char* addr = "tcp://127\&.0\&.0\&.1:6666" ;
+ pthread_t thread ;
+
+ // Create the infrastructure
+ void *ctx = zmq_init (1);
+ assert (ctx);
-// REP socket
-rep = zmq_socket (ctx, ZMQ_REP);
-assert (rep);
+ // REP socket
+ void* rep = zmq_socket (ctx, ZMQ_REP);
+ assert (rep);
-// REP socket monitor, all events
-rc = zmq_socket_monitor (rep, "inproc://monitor\&.rep", ZMQ_EVENT_ALL);
-assert (rc == 0);
-rc = pthread_create (&threads [0], NULL, rep_socket_monitor, ctx);
-assert (rc == 0);
+ // REP socket monitor, all events
+ int rc = zmq_socket_monitor (rep, "inproc://monitor\&.rep", ZMQ_EVENT_ALL);
+ assert (rc == 0);
+ rc = pthread_create (&thread, NULL, rep_socket_monitor, ctx);
+ assert (rc == 0);
-rc = zmq_bind (rep, addr);
-assert (rc == 0);
+ rc = zmq_bind (rep, addr);
+ assert (rc == 0);
-// Allow some time for event detection
-zmq_sleep (1);
+ // Allow some time for event detection
+ zmq_sleep (1);
-// Close the REP socket
-rc = zmq_close (rep);
-assert (rc == 0);
+ // Close the REP socket
+ rc = zmq_close (rep);
+ assert (rc == 0);
-zmq_term (ctx);
+ zmq_term (ctx);
+
+ return 0 ;
+}
.fi
.if n \{\
.RE
\fBzmq\fR(7)
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Lourens Naud\('e <\m[blue]\fBlourens@methodmissing\&.com\fR\m[]\&\s-2\u[1]\d\s+2>
-.SH "NOTES"
-.IP " 1." 4
-lourens@methodmissing.com
-.RS 4
-\%mailto:lourens@methodmissing.com
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
<h2 id="_description">DESCRIPTION</h2>\r
<div class="sectionbody">\r
<div class="paragraph"><p>The <em>zmq_socket_monitor()</em> function shall spawn a <em>PAIR</em> socket that publishes\r
-socket state changes (events) over the inproc:// transport to a given endpoint.\r
-Messages are <em>zmq_event_t</em> structs. It’s recommended to connect via a <em>PAIR</em>\r
-socket in another application thread and handle monitoring events there. It’s\r
-possible to also supply a bitmask (<em>ZMQ_EVENT_ALL</em> or any combination of the\r
-<em>ZMQ_EVENT_*</em> constants) of the events you’re interested in.</p></div>\r
+socket state changes (events) over the inproc:// transport to a given endpoint.</p></div>\r
+<div class="paragraph"><p>Messages consist of 2 Frames, the first containing the event-id and the\r
+associated value. The second frame holds the affected endpoint as string.</p></div>\r
+<div class="paragraph"><p>The layout of the first Frame is:\r
+ 16 bit event id\r
+ 32 bit event value</p></div>\r
+<div class="paragraph"><p>event id and value are in the native byte order (for the machine the\r
+application is running on). There is no padding between the fields.</p></div>\r
+<div class="paragraph"><p>The event value has to be interpreted in the context of the event id.\r
+See <em>Supported events</em> below for details.</p></div>\r
<div class="listingblock">\r
<div class="content">\r
-<pre><tt>// monitoring thread\r
-static void *req_socket_monitor (void *ctx)\r
-{\r
- zmq_event_t event;\r
- int rc;\r
-\r
- void *s = zmq_socket (ctx, ZMQ_PAIR);\r
- assert (s);\r
-\r
- rc = zmq_connect (s, "inproc://monitor.req");\r
- assert (rc == 0);\r
- while (true) {\r
- zmq_msg_t msg;\r
- zmq_msg_init (&msg);\r
- rc = zmq_recvmsg (s, &msg, 0);\r
- if (rc == -1 && zmq_errno() == ETERM) break;\r
- assert (rc != -1);\r
- memcpy (&event, zmq_msg_data (&msg), sizeof (event));\r
- switch (event.event) {\r
- case ZMQ_EVENT_CONNECTED:\r
- // handle socket connected event\r
- break;\r
- case ZMQ_EVENT_CLOSED:\r
- // handle socket closed event\r
- break;\r
- }\r
- }\r
- zmq_close (s);\r
- return NULL;\r
-}\r
-\r
-// register a monitor endpoint for all socket events\r
-rc = zmq_socket_monitor (req, "inproc://monitor.req", ZMQ_EVENT_ALL);\r
-assert (rc == 0);\r
-\r
-// spawn a monitoring thread\r
-rc = pthread_create (&threads [0], NULL, req_socket_monitor, ctx);\r
-assert (rc == 0);</tt></pre>\r
+<pre><tt>Only connection oriented (tcp and ipc) transports are supported in this initial\r
+implementation.</tt></pre>\r
</div></div>\r
-<div class="paragraph"><p>Only connection oriented (tcp and ipc) transports are supported in this initial\r
-implementation.</p></div>\r
-<div class="paragraph"><p>Supported events are:</p></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_supported_events">Supported events</h2>\r
+<div class="sectionbody">\r
<div class="sect2">\r
<h3 id="_zmq_event_connected_connection_established">ZMQ_EVENT_CONNECTED: connection established</h3>\r
<div class="paragraph"><p>The <em>ZMQ_EVENT_CONNECTED</em> event triggers when a connection has been established\r
-to a remote peer. This can happen either synchronous or asynchronous.</p></div>\r
-<div class="listingblock">\r
-<div class="title">Event metadata:</div>\r
-<div class="content">\r
-<pre><tt>data.connected.addr // peer address\r
-data.connected.fd // socket descriptor</tt></pre>\r
-</div></div>\r
+to a remote peer. This can happen either synchronous or asynchronous.\r
+Value is the FD of the newly connected socket.</p></div>\r
</div>\r
<div class="sect2">\r
<h3 id="_zmq_event_connect_delayed_synchronous_connect_failed_it_8217_s_being_polled">ZMQ_EVENT_CONNECT_DELAYED: synchronous connect failed, it’s being polled</h3>\r
<div class="paragraph"><p>The <em>ZMQ_EVENT_CONNECT_DELAYED</em> event triggers when an immediate connection\r
-attempt is delayed and it’s completion’s being polled for.</p></div>\r
-<div class="listingblock">\r
-<div class="title">Event metadata:</div>\r
-<div class="content">\r
-<pre><tt>data.connect_delayed.addr // peer address\r
-data.connect_delayed.err // errno value</tt></pre>\r
-</div></div>\r
+attempt is delayed and its completion is being polled for.\r
+Value has no meaning.</p></div>\r
</div>\r
<div class="sect2">\r
<h3 id="_zmq_event_connect_retried_asynchronous_connect_reconnection_attempt">ZMQ_EVENT_CONNECT_RETRIED: asynchronous connect / reconnection attempt</h3>\r
<div class="paragraph"><p>The <em>ZMQ_EVENT_CONNECT_RETRIED</em> event triggers when a connection attempt\r
is being handled by reconnect timer. The reconnect interval’s recomputed\r
-for each attempt.</p></div>\r
-<div class="listingblock">\r
-<div class="title">Event metadata:</div>\r
-<div class="content">\r
-<pre><tt>data.connect_retried.addr // peer address\r
-data.connect_retried.interval // computed reconnect interval</tt></pre>\r
-</div></div>\r
+for each attempt.\r
+Value is the reconnect interval.</p></div>\r
</div>\r
<div class="sect2">\r
<h3 id="_zmq_event_listening_socket_bound_to_an_address_ready_to_accept_connections">ZMQ_EVENT_LISTENING: socket bound to an address, ready to accept connections</h3>\r
<div class="paragraph"><p>The <em>ZMQ_EVENT_LISTENING</em> event triggers when a socket’s successfully bound\r
-to a an interface.</p></div>\r
-<div class="listingblock">\r
-<div class="title">Event metadata:</div>\r
-<div class="content">\r
-<pre><tt>data.listening.addr // listen address\r
-data.listening.fd // socket descriptor</tt></pre>\r
-</div></div>\r
+to a an interface.\r
+Value is the FD of the newly bound socket.</p></div>\r
</div>\r
<div class="sect2">\r
<h3 id="_zmq_event_bind_failed_socket_could_not_bind_to_an_address">ZMQ_EVENT_BIND_FAILED: socket could not bind to an address</h3>\r
<div class="paragraph"><p>The <em>ZMQ_EVENT_BIND_FAILED</em> event triggers when a socket could not bind to\r
-a given interface.</p></div>\r
-<div class="listingblock">\r
-<div class="title">Event metadata:</div>\r
-<div class="content">\r
-<pre><tt>data.bind_failed.addr // listen address\r
-data.bind_failed.err // errno value</tt></pre>\r
-</div></div>\r
+a given interface.\r
+Value is the errno generated by the bind call.</p></div>\r
</div>\r
<div class="sect2">\r
<h3 id="_zmq_event_accepted_connection_accepted_to_bound_interface">ZMQ_EVENT_ACCEPTED: connection accepted to bound interface</h3>\r
<div class="paragraph"><p>The <em>ZMQ_EVENT_ACCEPTED</em> event triggers when a connection from a remote peer\r
-has been established with a socket’s listen address.</p></div>\r
-<div class="listingblock">\r
-<div class="title">Event metadata:</div>\r
-<div class="content">\r
-<pre><tt>data.accepted.addr // listen address\r
-data.accepted.fd // socket descriptor</tt></pre>\r
-</div></div>\r
+has been established with a socket’s listen address.\r
+Value is the FD of the accepted socket.</p></div>\r
</div>\r
<div class="sect2">\r
<h3 id="_zmq_event_accept_failed_could_not_accept_client_connection">ZMQ_EVENT_ACCEPT_FAILED: could not accept client connection</h3>\r
<div class="paragraph"><p>The <em>ZMQ_EVENT_ACCEPT_FAILED</em> event triggers when a connection attempt to\r
-a socket’s bound address fails.</p></div>\r
-<div class="listingblock">\r
-<div class="title">Event metadata:</div>\r
-<div class="content">\r
-<pre><tt>data.accept_failed.addr // listen address\r
-data.accept_failed.err // errno value</tt></pre>\r
-</div></div>\r
+a socket’s bound address fails.\r
+Value is the errno generated by accept.</p></div>\r
</div>\r
<div class="sect2">\r
<h3 id="_zmq_event_closed_connection_closed">ZMQ_EVENT_CLOSED: connection closed</h3>\r
<div class="paragraph"><p>The <em>ZMQ_EVENT_CLOSED</em> event triggers when a connection’s underlying descriptor\r
-has been closed.</p></div>\r
-<div class="listingblock">\r
-<div class="title">Event metadata:</div>\r
-<div class="content">\r
-<pre><tt>data.closed.addr // address\r
-data.closed.fd // socket descriptor</tt></pre>\r
-</div></div>\r
+has been closed.\r
+Value is the former FD of the for the closed socket. FD has been closed already!</p></div>\r
</div>\r
<div class="sect2">\r
<h3 id="_zmq_event_close_failed_connection_couldn_8217_t_be_closed">ZMQ_EVENT_CLOSE_FAILED: connection couldn’t be closed</h3>\r
<div class="paragraph"><p>The <em>ZMQ_EVENT_CLOSE_FAILED</em> event triggers when a descriptor could not be\r
-released back to the OS.</p></div>\r
-<div class="listingblock">\r
-<div class="title">Event metadata:</div>\r
-<div class="content">\r
-<pre><tt>data.close_failed.addr // address\r
-data.close_failed.err // errno value</tt></pre>\r
-</div></div>\r
+released back to the OS. Implementation note: ONLY FOR IPC SOCKETS.\r
+Value is the errno generated by unlink.</p></div>\r
</div>\r
<div class="sect2">\r
<h3 id="_zmq_event_disconnected_broken_session">ZMQ_EVENT_DISCONNECTED: broken session</h3>\r
<div class="paragraph"><p>The <em>ZMQ_EVENT_DISCONNECTED</em> event triggers when the stream engine (tcp and ipc\r
-specific) detects a corrupted / broken session.</p></div>\r
-<div class="listingblock">\r
-<div class="title">Event metadata:</div>\r
-<div class="content">\r
-<pre><tt>data.disconnected.addr // address\r
-data.disconnected.fd // socket descriptor</tt></pre>\r
-</div></div>\r
+specific) detects a corrupted / broken session.\r
+Value is the FD of the socket.</p></div>\r
</div>\r
</div>\r
</div>\r
<div class="listingblock">\r
<div class="title">Observing a <em>REP</em> socket’s connection state</div>\r
<div class="content">\r
-<pre><tt>// REP socket monitor thread\r
+<pre><tt>#include <stdio.h>\r
+#include <zmq.h>\r
+#include <pthread.h>\r
+#include <string.h>\r
+#include <assert.h>\r
+\r
+static int read_msg(void* s, zmq_event_t* event, char* ep)\r
+{\r
+ int rc ;\r
+ zmq_msg_t msg1; // binary part\r
+ zmq_msg_init (&msg1);\r
+ zmq_msg_t msg2; // address part\r
+ zmq_msg_init (&msg2);\r
+ rc = zmq_msg_recv (&msg1, s, 0);\r
+ if (rc == -1 && zmq_errno() == ETERM)\r
+ return 1 ;\r
+ assert (rc != -1);\r
+ assert (zmq_msg_more(&msg1) != 0);\r
+ rc = zmq_msg_recv (&msg2, s, 0);\r
+ if (rc == -1 && zmq_errno() == ETERM)\r
+ return 1;\r
+ assert (rc != -1);\r
+ assert (zmq_msg_more(&msg2) == 0);\r
+ // copy binary data to event struct\r
+ const char* data = (char*)zmq_msg_data(&msg1);\r
+ memcpy(&(event->event), data, sizeof(event->event));\r
+ memcpy(&(event->value), data+sizeof(event->event), sizeof(event->value));\r
+ // copy address part\r
+ const size_t len = zmq_msg_size(&msg2) ;\r
+ ep = memcpy(ep, zmq_msg_data(&msg2), len);\r
+ *(ep + len) = 0 ;\r
+ return 0 ;\r
+}\r
+\r
+// REP socket monitor thread\r
static void *rep_socket_monitor (void *ctx)\r
{\r
zmq_event_t event;\r
+ static char addr[1025] ;\r
int rc;\r
\r
+ printf("starting monitor...\n");\r
+\r
void *s = zmq_socket (ctx, ZMQ_PAIR);\r
assert (s);\r
\r
rc = zmq_connect (s, "inproc://monitor.rep");\r
assert (rc == 0);\r
- while (true) {\r
- zmq_msg_t msg;\r
- zmq_msg_init (&msg);\r
- rc = zmq_recvmsg (s, &msg, 0);\r
- if (rc == -1 && zmq_errno() == ETERM) break;\r
- assert (rc != -1);\r
- memcpy (&event, zmq_msg_data (&msg), sizeof (event));\r
+ while (!read_msg(s, &event, addr)) {\r
switch (event.event) {\r
case ZMQ_EVENT_LISTENING:\r
- printf ("listening socket descriptor %d\n", event.data.listening.fd);\r
- printf ("listening socket address %s\n", event.data.listening.addr);\r
+ printf ("listening socket descriptor %d\n", event.value);\r
+ printf ("listening socket address %s\n", addr);\r
break;\r
case ZMQ_EVENT_ACCEPTED:\r
- printf ("accepted socket descriptor %d\n", event.data.accepted.fd);\r
- printf ("accepted socket address %s\n", event.data.accepted.addr);\r
+ printf ("accepted socket descriptor %d\n", event.value);\r
+ printf ("accepted socket address %s\n", addr);\r
break;\r
case ZMQ_EVENT_CLOSE_FAILED:\r
- printf ("socket close failure error code %d\n", event.data.close_failed.err);\r
- printf ("socket address %s\n", event.data.close_failed.addr);\r
+ printf ("socket close failure error code %d\n", event.value);\r
+ printf ("socket address %s\n", addr);\r
break;\r
case ZMQ_EVENT_CLOSED:\r
- printf ("closed socket descriptor %d\n", event.data.closed.fd);\r
- printf ("closed socket address %s\n", event.data.closed.addr);\r
+ printf ("closed socket descriptor %d\n", event.value);\r
+ printf ("closed socket address %s\n", addr);\r
break;\r
case ZMQ_EVENT_DISCONNECTED:\r
- printf ("disconnected socket descriptor %d\n", event.data.disconnected.fd);\r
- printf ("disconnected socket address %s\n", event.data.disconnected.addr);\r
+ printf ("disconnected socket descriptor %d\n", event.value);\r
+ printf ("disconnected socket address %s\n", addr);\r
break;\r
}\r
- zmq_msg_close (&msg);\r
}\r
zmq_close (s);\r
return NULL;\r
}\r
\r
\r
-// Create the infrastructure\r
-void *ctx = zmq_init (1);\r
-assert (ctx);\r
+int main()\r
+{\r
+ const char* addr = "tcp://127.0.0.1:6666" ;\r
+ pthread_t thread ;\r
\r
-// REP socket\r
-rep = zmq_socket (ctx, ZMQ_REP);\r
-assert (rep);\r
+ // Create the infrastructure\r
+ void *ctx = zmq_init (1);\r
+ assert (ctx);\r
\r
-// REP socket monitor, all events\r
-rc = zmq_socket_monitor (rep, "inproc://monitor.rep", ZMQ_EVENT_ALL);\r
-assert (rc == 0);\r
-rc = pthread_create (&threads [0], NULL, rep_socket_monitor, ctx);\r
-assert (rc == 0);\r
+ // REP socket\r
+ void* rep = zmq_socket (ctx, ZMQ_REP);\r
+ assert (rep);\r
\r
-rc = zmq_bind (rep, addr);\r
-assert (rc == 0);\r
+ // REP socket monitor, all events\r
+ int rc = zmq_socket_monitor (rep, "inproc://monitor.rep", ZMQ_EVENT_ALL);\r
+ assert (rc == 0);\r
+ rc = pthread_create (&thread, NULL, rep_socket_monitor, ctx);\r
+ assert (rc == 0);\r
\r
-// Allow some time for event detection\r
-zmq_sleep (1);\r
+ rc = zmq_bind (rep, addr);\r
+ assert (rc == 0);\r
+\r
+ // Allow some time for event detection\r
+ zmq_sleep (1);\r
+\r
+ // Close the REP socket\r
+ rc = zmq_close (rep);\r
+ assert (rc == 0);\r
\r
-// Close the REP socket\r
-rc = zmq_close (rep);\r
-assert (rc == 0);\r
+ zmq_term (ctx);\r
\r
-zmq_term (ctx);</tt></pre>\r
+ return 0 ;\r
+}</tt></pre>\r
</div></div>\r
</div>\r
</div>\r
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Lourens Naudé <<a href="mailto:lourens@methodmissing.com">lourens@methodmissing.com</a>></p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-10-25 17:30:40 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
-----------
The _zmq_socket_monitor()_ function shall spawn a 'PAIR' socket that publishes
socket state changes (events) over the inproc:// transport to a given endpoint.
-Messages are 'zmq_event_t' structs. It's recommended to connect via a 'PAIR'
-socket in another application thread and handle monitoring events there. It's
-possible to also supply a bitmask ('ZMQ_EVENT_ALL' or any combination of the
-'ZMQ_EVENT_*' constants) of the events you're interested in.
-----
-// monitoring thread
-static void *req_socket_monitor (void *ctx)
-{
- zmq_event_t event;
- int rc;
+Messages consist of 2 Frames, the first containing the event-id and the
+associated value. The second frame holds the affected endpoint as string.
- void *s = zmq_socket (ctx, ZMQ_PAIR);
- assert (s);
+The layout of the first Frame is:
+ 16 bit event id
+ 32 bit event value
- rc = zmq_connect (s, "inproc://monitor.req");
- assert (rc == 0);
- while (true) {
- zmq_msg_t msg;
- zmq_msg_init (&msg);
- rc = zmq_recvmsg (s, &msg, 0);
- if (rc == -1 && zmq_errno() == ETERM) break;
- assert (rc != -1);
- memcpy (&event, zmq_msg_data (&msg), sizeof (event));
- switch (event.event) {
- case ZMQ_EVENT_CONNECTED:
- // handle socket connected event
- break;
- case ZMQ_EVENT_CLOSED:
- // handle socket closed event
- break;
- }
- }
- zmq_close (s);
- return NULL;
-}
+event id and value are in the native byte order (for the machine the
+application is running on). There is no padding between the fields.
-// register a monitor endpoint for all socket events
-rc = zmq_socket_monitor (req, "inproc://monitor.req", ZMQ_EVENT_ALL);
-assert (rc == 0);
+The event value has to be interpreted in the context of the event id.
+See 'Supported events' below for details.
-// spawn a monitoring thread
-rc = pthread_create (&threads [0], NULL, req_socket_monitor, ctx);
-assert (rc == 0);
----
Only connection oriented (tcp and ipc) transports are supported in this initial
implementation.
-Supported events are:
+----
+Supported events
+----------------
ZMQ_EVENT_CONNECTED: connection established
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_EVENT_CONNECTED' event triggers when a connection has been established
to a remote peer. This can happen either synchronous or asynchronous.
+Value is the FD of the newly connected socket.
-.Event metadata:
-----
-data.connected.addr // peer address
-data.connected.fd // socket descriptor
-----
ZMQ_EVENT_CONNECT_DELAYED: synchronous connect failed, it's being polled
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_EVENT_CONNECT_DELAYED' event triggers when an immediate connection
-attempt is delayed and it's completion's being polled for.
+attempt is delayed and its completion is being polled for.
+Value has no meaning.
-.Event metadata:
-----
-data.connect_delayed.addr // peer address
-data.connect_delayed.err // errno value
-----
ZMQ_EVENT_CONNECT_RETRIED: asynchronous connect / reconnection attempt
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_EVENT_CONNECT_RETRIED' event triggers when a connection attempt
is being handled by reconnect timer. The reconnect interval's recomputed
for each attempt.
+Value is the reconnect interval.
-.Event metadata:
-----
-data.connect_retried.addr // peer address
-data.connect_retried.interval // computed reconnect interval
-----
ZMQ_EVENT_LISTENING: socket bound to an address, ready to accept connections
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_EVENT_LISTENING' event triggers when a socket's successfully bound
to a an interface.
+Value is the FD of the newly bound socket.
-.Event metadata:
-----
-data.listening.addr // listen address
-data.listening.fd // socket descriptor
-----
ZMQ_EVENT_BIND_FAILED: socket could not bind to an address
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_EVENT_BIND_FAILED' event triggers when a socket could not bind to
a given interface.
+Value is the errno generated by the bind call.
-.Event metadata:
-----
-data.bind_failed.addr // listen address
-data.bind_failed.err // errno value
-----
ZMQ_EVENT_ACCEPTED: connection accepted to bound interface
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_EVENT_ACCEPTED' event triggers when a connection from a remote peer
has been established with a socket's listen address.
+Value is the FD of the accepted socket.
-.Event metadata:
-----
-data.accepted.addr // listen address
-data.accepted.fd // socket descriptor
-----
ZMQ_EVENT_ACCEPT_FAILED: could not accept client connection
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_EVENT_ACCEPT_FAILED' event triggers when a connection attempt to
a socket's bound address fails.
+Value is the errno generated by accept.
-.Event metadata:
-----
-data.accept_failed.addr // listen address
-data.accept_failed.err // errno value
-----
ZMQ_EVENT_CLOSED: connection closed
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_EVENT_CLOSED' event triggers when a connection's underlying descriptor
-has been closed.
+has been closed.
+Value is the former FD of the for the closed socket. FD has been closed already!
-.Event metadata:
-----
-data.closed.addr // address
-data.closed.fd // socket descriptor
-----
ZMQ_EVENT_CLOSE_FAILED: connection couldn't be closed
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_EVENT_CLOSE_FAILED' event triggers when a descriptor could not be
-released back to the OS.
+released back to the OS. Implementation note: ONLY FOR IPC SOCKETS.
+Value is the errno generated by unlink.
-.Event metadata:
-----
-data.close_failed.addr // address
-data.close_failed.err // errno value
-----
ZMQ_EVENT_DISCONNECTED: broken session
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_EVENT_DISCONNECTED' event triggers when the stream engine (tcp and ipc
specific) detects a corrupted / broken session.
+Value is the FD of the socket.
-.Event metadata:
-----
-data.disconnected.addr // address
-data.disconnected.fd // socket descriptor
-----
RETURN VALUE
------------
-------
.Observing a 'REP' socket's connection state
----
+#include <stdio.h>
+#include <zmq.h>
+#include <pthread.h>
+#include <string.h>
+#include <assert.h>
+
+static int read_msg(void* s, zmq_event_t* event, char* ep)
+{
+ int rc ;
+ zmq_msg_t msg1; // binary part
+ zmq_msg_init (&msg1);
+ zmq_msg_t msg2; // address part
+ zmq_msg_init (&msg2);
+ rc = zmq_msg_recv (&msg1, s, 0);
+ if (rc == -1 && zmq_errno() == ETERM)
+ return 1 ;
+ assert (rc != -1);
+ assert (zmq_msg_more(&msg1) != 0);
+ rc = zmq_msg_recv (&msg2, s, 0);
+ if (rc == -1 && zmq_errno() == ETERM)
+ return 1;
+ assert (rc != -1);
+ assert (zmq_msg_more(&msg2) == 0);
+ // copy binary data to event struct
+ const char* data = (char*)zmq_msg_data(&msg1);
+ memcpy(&(event->event), data, sizeof(event->event));
+ memcpy(&(event->value), data+sizeof(event->event), sizeof(event->value));
+ // copy address part
+ const size_t len = zmq_msg_size(&msg2) ;
+ ep = memcpy(ep, zmq_msg_data(&msg2), len);
+ *(ep + len) = 0 ;
+ return 0 ;
+}
+
// REP socket monitor thread
static void *rep_socket_monitor (void *ctx)
{
zmq_event_t event;
+ static char addr[1025] ;
int rc;
+ printf("starting monitor...\n");
+
void *s = zmq_socket (ctx, ZMQ_PAIR);
assert (s);
rc = zmq_connect (s, "inproc://monitor.rep");
assert (rc == 0);
- while (true) {
- zmq_msg_t msg;
- zmq_msg_init (&msg);
- rc = zmq_recvmsg (s, &msg, 0);
- if (rc == -1 && zmq_errno() == ETERM) break;
- assert (rc != -1);
- memcpy (&event, zmq_msg_data (&msg), sizeof (event));
+ while (!read_msg(s, &event, addr)) {
switch (event.event) {
case ZMQ_EVENT_LISTENING:
- printf ("listening socket descriptor %d\n", event.data.listening.fd);
- printf ("listening socket address %s\n", event.data.listening.addr);
+ printf ("listening socket descriptor %d\n", event.value);
+ printf ("listening socket address %s\n", addr);
break;
case ZMQ_EVENT_ACCEPTED:
- printf ("accepted socket descriptor %d\n", event.data.accepted.fd);
- printf ("accepted socket address %s\n", event.data.accepted.addr);
+ printf ("accepted socket descriptor %d\n", event.value);
+ printf ("accepted socket address %s\n", addr);
break;
case ZMQ_EVENT_CLOSE_FAILED:
- printf ("socket close failure error code %d\n", event.data.close_failed.err);
- printf ("socket address %s\n", event.data.close_failed.addr);
+ printf ("socket close failure error code %d\n", event.value);
+ printf ("socket address %s\n", addr);
break;
case ZMQ_EVENT_CLOSED:
- printf ("closed socket descriptor %d\n", event.data.closed.fd);
- printf ("closed socket address %s\n", event.data.closed.addr);
+ printf ("closed socket descriptor %d\n", event.value);
+ printf ("closed socket address %s\n", addr);
break;
case ZMQ_EVENT_DISCONNECTED:
- printf ("disconnected socket descriptor %d\n", event.data.disconnected.fd);
- printf ("disconnected socket address %s\n", event.data.disconnected.addr);
+ printf ("disconnected socket descriptor %d\n", event.value);
+ printf ("disconnected socket address %s\n", addr);
break;
}
- zmq_msg_close (&msg);
}
zmq_close (s);
return NULL;
}
-// Create the infrastructure
-void *ctx = zmq_init (1);
-assert (ctx);
+int main()
+{
+ const char* addr = "tcp://127.0.0.1:6666" ;
+ pthread_t thread ;
+
+ // Create the infrastructure
+ void *ctx = zmq_init (1);
+ assert (ctx);
+
+ // REP socket
+ void* rep = zmq_socket (ctx, ZMQ_REP);
+ assert (rep);
-// REP socket
-rep = zmq_socket (ctx, ZMQ_REP);
-assert (rep);
+ // REP socket monitor, all events
+ int rc = zmq_socket_monitor (rep, "inproc://monitor.rep", ZMQ_EVENT_ALL);
+ assert (rc == 0);
+ rc = pthread_create (&thread, NULL, rep_socket_monitor, ctx);
+ assert (rc == 0);
-// REP socket monitor, all events
-rc = zmq_socket_monitor (rep, "inproc://monitor.rep", ZMQ_EVENT_ALL);
-assert (rc == 0);
-rc = pthread_create (&threads [0], NULL, rep_socket_monitor, ctx);
-assert (rc == 0);
+ rc = zmq_bind (rep, addr);
+ assert (rc == 0);
-rc = zmq_bind (rep, addr);
-assert (rc == 0);
+ // Allow some time for event detection
+ zmq_sleep (1);
-// Allow some time for event detection
-zmq_sleep (1);
+ // Close the REP socket
+ rc = zmq_close (rep);
+ assert (rc == 0);
-// Close the REP socket
-rc = zmq_close (rep);
-assert (rc == 0);
+ zmq_term (ctx);
-zmq_term (ctx);
+ return 0 ;
+}
----
AUTHORS
-------
-This 0MQ manual page was written by Lourens Naudé <lourens@methodmissing.com>
\ No newline at end of file
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_strerror
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.1
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_STRERROR" "3" "11/23/2012" "0MQ 3\&.2\&.1" "0MQ Manual"
+.TH "ZMQ_STRERROR" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
\fBzmq\fR(7)
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Martin Sustrik <\m[blue]\fBsustrik@250bpm\&.com\fR\m[]\&\s-2\u[1]\d\s+2> and Martin Lucina <\m[blue]\fBmato@kotelna\&.sk\fR\m[]\&\s-2\u[2]\d\s+2>\&.
-.SH "NOTES"
-.IP " 1." 4
-sustrik@250bpm.com
-.RS 4
-\%mailto:sustrik@250bpm.com
-.RE
-.IP " 2." 4
-mato@kotelna.sk
-.RS 4
-\%mailto:mato@kotelna.sk
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Martin Sustrik <<a href="mailto:sustrik@250bpm.com">sustrik@250bpm.com</a>> and\r
-Martin Lucina <<a href="mailto:mato@kotelna.sk">mato@kotelna.sk</a>>.</p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-10-25 17:30:40 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
AUTHORS
-------
-This 0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
-Martin Lucina <mato@kotelna.sk>.
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
+
.\" Title: zmq_tcp
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.2
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_TCP" "7" "11/23/2012" "0MQ 3\&.2\&.2" "0MQ Manual"
+.TH "ZMQ_TCP" "7" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\}
The IPv4 or IPv6 address of the peer, in its numeric representation\&.
.RE
+.sp
+Note: A description of the ZeroMQ Message Transport Protocol (ZMTP) which is used by the TCP transport can be found at \m[blue]\fBhttp://rfc\&.zeromq\&.org/spec:15\fR\m[]
.SH "EXAMPLES"
.PP
\fBAssigning a local address to a socket\fR.
\fBzmq_bind\fR(3) \fBzmq_connect\fR(3) \fBzmq_pgm\fR(7) \fBzmq_ipc\fR(7) \fBzmq_inproc\fR(7) \fBzmq\fR(7)
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Pieter Hintjens <\m[blue]\fBph@imatix\&.com\fR\m[]\&\s-2\u[1]\d\s+2>, Martin Sustrik <\m[blue]\fBsustrik@250bpm\&.com\fR\m[]\&\s-2\u[2]\d\s+2> and Martin Lucina <\m[blue]\fBmato@kotelna\&.sk\fR\m[]\&\s-2\u[3]\d\s+2>\&.
-.SH "NOTES"
-.IP " 1." 4
-ph@imatix.com
-.RS 4
-\%mailto:ph@imatix.com
-.RE
-.IP " 2." 4
-sustrik@250bpm.com
-.RS 4
-\%mailto:sustrik@250bpm.com
-.RE
-.IP " 3." 4
-mato@kotelna.sk
-.RS 4
-\%mailto:mato@kotelna.sk
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
</p>\r
</li>\r
</ul></div>\r
+<div class="paragraph"><p>Note: A description of the ZeroMQ Message Transport Protocol (ZMTP) which is\r
+used by the TCP transport can be found at <a href="http://rfc.zeromq.org/spec:15">http://rfc.zeromq.org/spec:15</a></p></div>\r
</div>\r
</div>\r
</div>\r
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Pieter Hintjens <<a href="mailto:ph@imatix.com">ph@imatix.com</a>>,\r
-Martin Sustrik <<a href="mailto:sustrik@250bpm.com">sustrik@250bpm.com</a>> and Martin Lucina <<a href="mailto:mato@kotelna.sk">mato@kotelna.sk</a>>.</p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-11-14 10:09:14 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
* The DNS name of the peer.
* The IPv4 or IPv6 address of the peer, in its numeric representation.
+Note: A description of the ZeroMQ Message Transport Protocol (ZMTP) which is
+used by the TCP transport can be found at <http://rfc.zeromq.org/spec:15>
EXAMPLES
--------
AUTHORS
-------
-This 0MQ manual page was written by Pieter Hintjens <ph@imatix.com>,
-Martin Sustrik <sustrik@250bpm.com> and Martin Lucina <mato@kotelna.sk>.
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_term
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.1
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_TERM" "3" "11/23/2012" "0MQ 3\&.2\&.1" "0MQ Manual"
+.TH "ZMQ_TERM" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.sp
For further details regarding socket linger behaviour refer to the \fIZMQ_LINGER\fR option in \fBzmq_setsockopt\fR(3)\&.
.sp
-This function is deprecated by \fBzmq_ctx_destroy\fR(3)\&.
+This function is deprecated by \fBzmq_ctx_term\fR(3)\&.
.SH "RETURN VALUE"
.sp
The \fIzmq_term()\fR function shall return zero if successful\&. Otherwise it shall return \-1 and set \fIerrno\fR to one of the values defined below\&.
\fBzmq\fR(7) \fBzmq_init\fR(3) \fBzmq_close\fR(3) \fBzmq_setsockopt\fR(3)
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Martin Sustrik <\m[blue]\fBsustrik@250bpm\&.com\fR\m[]\&\s-2\u[1]\d\s+2> and Martin Lucina <\m[blue]\fBmato@kotelna\&.sk\fR\m[]\&\s-2\u[2]\d\s+2>\&.
-.SH "NOTES"
-.IP " 1." 4
-sustrik@250bpm.com
-.RS 4
-\%mailto:sustrik@250bpm.com
-.RE
-.IP " 2." 4
-mato@kotelna.sk
-.RS 4
-\%mailto:mato@kotelna.sk
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
</ol></div>\r
<div class="paragraph"><p>For further details regarding socket linger behaviour refer to the <em>ZMQ_LINGER</em>\r
option in <a href="zmq_setsockopt.html">zmq_setsockopt(3)</a>.</p></div>\r
-<div class="paragraph"><p>This function is deprecated by <a href="zmq_ctx_destroy.html">zmq_ctx_destroy(3)</a>.</p></div>\r
+<div class="paragraph"><p>This function is deprecated by <a href="zmq_ctx_term.html">zmq_ctx_term(3)</a>.</p></div>\r
</div>\r
</div>\r
<div class="sect1">\r
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Martin Sustrik <<a href="mailto:sustrik@250bpm.com">sustrik@250bpm.com</a>> and\r
-Martin Lucina <<a href="mailto:mato@kotelna.sk">mato@kotelna.sk</a>>.</p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-10-25 17:30:40 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
For further details regarding socket linger behaviour refer to the _ZMQ_LINGER_
option in linkzmq:zmq_setsockopt[3].
-This function is deprecated by linkzmq:zmq_ctx_destroy[3].
+This function is deprecated by linkzmq:zmq_ctx_term[3].
RETURN VALUE
------------
AUTHORS
-------
-This 0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
-Martin Lucina <mato@kotelna.sk>.
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_unbind
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.1
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_UNBIND" "3" "11/23/2012" "0MQ 3\&.2\&.1" "0MQ Manual"
+.TH "ZMQ_UNBIND" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
\fBzmq_bind\fR(3) \fBzmq_socket\fR(3) \fBzmq\fR(7)
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Martin Sustrik <\m[blue]\fBsustrik@250bpm\&.com\fR\m[]\&\s-2\u[1]\d\s+2>, Martin Lucina <\m[blue]\fBmato@kotelna\&.sk\fR\m[]\&\s-2\u[2]\d\s+2> and Ian Barber <\m[blue]\fBian\&.barber@gmail\&.com\fR\m[]\&\s-2\u[3]\d\s+2>
-.SH "NOTES"
-.IP " 1." 4
-sustrik@250bpm.com
-.RS 4
-\%mailto:sustrik@250bpm.com
-.RE
-.IP " 2." 4
-mato@kotelna.sk
-.RS 4
-\%mailto:mato@kotelna.sk
-.RE
-.IP " 3." 4
-ian.barber@gmail.com
-.RS 4
-\%mailto:ian.barber@gmail.com
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Martin Sustrik <<a href="mailto:sustrik@250bpm.com">sustrik@250bpm.com</a>>,\r
-Martin Lucina <<a href="mailto:mato@kotelna.sk">mato@kotelna.sk</a>> and Ian Barber <<a href="mailto:ian.barber@gmail.com">ian.barber@gmail.com</a>></p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-10-25 17:30:40 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
AUTHORS
-------
-This 0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com>,
-Martin Lucina <mato@kotelna.sk> and Ian Barber <ian.barber@gmail.com>
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
.\" Title: zmq_version
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2012
+.\" Date: 03/10/2014
.\" Manual: 0MQ Manual
-.\" Source: 0MQ 3.2.1
+.\" Source: 0MQ 4.0.1
.\" Language: English
.\"
-.TH "ZMQ_VERSION" "3" "11/23/2012" "0MQ 3\&.2\&.1" "0MQ Manual"
+.TH "ZMQ_VERSION" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
\fBzmq\fR(7)
.SH "AUTHORS"
.sp
-This 0MQ manual page was written by Martin Sustrik <\m[blue]\fBsustrik@250bpm\&.com\fR\m[]\&\s-2\u[1]\d\s+2> and Martin Lucina <\m[blue]\fBmato@kotelna\&.sk\fR\m[]\&\s-2\u[2]\d\s+2>\&.
-.SH "NOTES"
-.IP " 1." 4
-sustrik@250bpm.com
-.RS 4
-\%mailto:sustrik@250bpm.com
-.RE
-.IP " 2." 4
-mato@kotelna.sk
-.RS 4
-\%mailto:mato@kotelna.sk
-.RE
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
<div class="sect1">\r
<h2 id="_authors">AUTHORS</h2>\r
<div class="sectionbody">\r
-<div class="paragraph"><p>This ØMQ manual page was written by Martin Sustrik <<a href="mailto:sustrik@250bpm.com">sustrik@250bpm.com</a>> and\r
-Martin Lucina <<a href="mailto:mato@kotelna.sk">mato@kotelna.sk</a>>.</p></div>\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
</div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-ØMQ 3.2.2<br />\r
-Last updated 2012-10-25 17:30:40 KST\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
</div>\r
</div>\r
</body>\r
--------
linkzmq:zmq[7]
+
AUTHORS
-------
-This 0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
-Martin Lucina <mato@kotelna.sk>.
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
--- /dev/null
+'\" t
+.\" Title: zmq_z85_decode
+.\" Author: [see the "AUTHORS" section]
+.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
+.\" Date: 03/10/2014
+.\" Manual: 0MQ Manual
+.\" Source: 0MQ 4.0.1
+.\" Language: English
+.\"
+.TH "ZMQ_Z85_DECODE" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+zmq_z85_decode \- decode a binary key from Z85 printable text
+.SH "SYNOPSIS"
+.sp
+\fBuint8_t *zmq_z85_decode (uint8_t *dest, char *string);\fR
+.SH "DESCRIPTION"
+.sp
+The \fIzmq_z85_decode()\fR function shall decode \fIstring\fR into \fIdest\fR\&. The length of \fIstring\fR shall be divisible by 5\&. \fIdest\fR must be large enough for the decoded value (0\&.8 x strlen (string))\&.
+.sp
+The encoding shall follow the ZMQ RFC 32 specification\&.
+.SH "RETURN VALUE"
+.sp
+The \fIzmq_z85_decode()\fR function shall return \fIdest\fR if successful, else it shall return NULL\&.
+.SH "EXAMPLE"
+.PP
+\fBDecoding a CURVE key\fR.
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+char decoded [] = "rq:rM>}U?@Lns47E1%kR\&.o@n%FcmmsL/@{H8]yf7";
+uint8_t public_key [32];
+zmq_z85_decode (public_key, decoded);
+.fi
+.if n \{\
+.RE
+.\}
+.sp
+.SH "SEE ALSO"
+.sp
+\fBzmq_z85_decode\fR(3) \fBzmq_curve_keypair\fR(3) \fBzmq_curve\fR(7)
+.SH "AUTHORS"
+.sp
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"\r
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">\r
+<head>\r
+<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />\r
+<meta name="generator" content="AsciiDoc 8.6.6" />\r
+<title>zmq_z85_decode(3)</title>\r
+<style type="text/css">\r
+/* Shared CSS for AsciiDoc xhtml11 and html5 backends */\r
+\r
+/* Default font. */\r
+body {\r
+ font-family: Georgia,serif;\r
+}\r
+\r
+/* Title font. */\r
+h1, h2, h3, h4, h5, h6,\r
+div.title, caption.title,\r
+thead, p.table.header,\r
+#toctitle,\r
+#author, #revnumber, #revdate, #revremark,\r
+#footer {\r
+ font-family: Arial,Helvetica,sans-serif;\r
+}\r
+\r
+body {\r
+ margin: 1em 5% 1em 5%;\r
+}\r
+\r
+a {\r
+ color: blue;\r
+ text-decoration: underline;\r
+}\r
+a:visited {\r
+ color: fuchsia;\r
+}\r
+\r
+em {\r
+ font-style: italic;\r
+ color: navy;\r
+}\r
+\r
+strong {\r
+ font-weight: bold;\r
+ color: #083194;\r
+}\r
+\r
+h1, h2, h3, h4, h5, h6 {\r
+ color: #527bbd;\r
+ margin-top: 1.2em;\r
+ margin-bottom: 0.5em;\r
+ line-height: 1.3;\r
+}\r
+\r
+h1, h2, h3 {\r
+ border-bottom: 2px solid silver;\r
+}\r
+h2 {\r
+ padding-top: 0.5em;\r
+}\r
+h3 {\r
+ float: left;\r
+}\r
+h3 + * {\r
+ clear: left;\r
+}\r
+h5 {\r
+ font-size: 1.0em;\r
+}\r
+\r
+div.sectionbody {\r
+ margin-left: 0;\r
+}\r
+\r
+hr {\r
+ border: 1px solid silver;\r
+}\r
+\r
+p {\r
+ margin-top: 0.5em;\r
+ margin-bottom: 0.5em;\r
+}\r
+\r
+ul, ol, li > p {\r
+ margin-top: 0;\r
+}\r
+ul > li { color: #aaa; }\r
+ul > li > * { color: black; }\r
+\r
+pre {\r
+ padding: 0;\r
+ margin: 0;\r
+}\r
+\r
+#author {\r
+ color: #527bbd;\r
+ font-weight: bold;\r
+ font-size: 1.1em;\r
+}\r
+#email {\r
+}\r
+#revnumber, #revdate, #revremark {\r
+}\r
+\r
+#footer {\r
+ font-size: small;\r
+ border-top: 2px solid silver;\r
+ padding-top: 0.5em;\r
+ margin-top: 4.0em;\r
+}\r
+#footer-text {\r
+ float: left;\r
+ padding-bottom: 0.5em;\r
+}\r
+#footer-badges {\r
+ float: right;\r
+ padding-bottom: 0.5em;\r
+}\r
+\r
+#preamble {\r
+ margin-top: 1.5em;\r
+ margin-bottom: 1.5em;\r
+}\r
+div.imageblock, div.exampleblock, div.verseblock,\r
+div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,\r
+div.admonitionblock {\r
+ margin-top: 1.0em;\r
+ margin-bottom: 1.5em;\r
+}\r
+div.admonitionblock {\r
+ margin-top: 2.0em;\r
+ margin-bottom: 2.0em;\r
+ margin-right: 10%;\r
+ color: #606060;\r
+}\r
+\r
+div.content { /* Block element content. */\r
+ padding: 0;\r
+}\r
+\r
+/* Block element titles. */\r
+div.title, caption.title {\r
+ color: #527bbd;\r
+ font-weight: bold;\r
+ text-align: left;\r
+ margin-top: 1.0em;\r
+ margin-bottom: 0.5em;\r
+}\r
+div.title + * {\r
+ margin-top: 0;\r
+}\r
+\r
+td div.title:first-child {\r
+ margin-top: 0.0em;\r
+}\r
+div.content div.title:first-child {\r
+ margin-top: 0.0em;\r
+}\r
+div.content + div.title {\r
+ margin-top: 0.0em;\r
+}\r
+\r
+div.sidebarblock > div.content {\r
+ background: #ffffee;\r
+ border: 1px solid #dddddd;\r
+ border-left: 4px solid #f0f0f0;\r
+ padding: 0.5em;\r
+}\r
+\r
+div.listingblock > div.content {\r
+ border: 1px solid #dddddd;\r
+ border-left: 5px solid #f0f0f0;\r
+ background: #f8f8f8;\r
+ padding: 0.5em;\r
+}\r
+\r
+div.quoteblock, div.verseblock {\r
+ padding-left: 1.0em;\r
+ margin-left: 1.0em;\r
+ margin-right: 10%;\r
+ border-left: 5px solid #f0f0f0;\r
+ color: #888;\r
+}\r
+\r
+div.quoteblock > div.attribution {\r
+ padding-top: 0.5em;\r
+ text-align: right;\r
+}\r
+\r
+div.verseblock > pre.content {\r
+ font-family: inherit;\r
+ font-size: inherit;\r
+}\r
+div.verseblock > div.attribution {\r
+ padding-top: 0.75em;\r
+ text-align: left;\r
+}\r
+/* DEPRECATED: Pre version 8.2.7 verse style literal block. */\r
+div.verseblock + div.attribution {\r
+ text-align: left;\r
+}\r
+\r
+div.admonitionblock .icon {\r
+ vertical-align: top;\r
+ font-size: 1.1em;\r
+ font-weight: bold;\r
+ text-decoration: underline;\r
+ color: #527bbd;\r
+ padding-right: 0.5em;\r
+}\r
+div.admonitionblock td.content {\r
+ padding-left: 0.5em;\r
+ border-left: 3px solid #dddddd;\r
+}\r
+\r
+div.exampleblock > div.content {\r
+ border-left: 3px solid #dddddd;\r
+ padding-left: 0.5em;\r
+}\r
+\r
+div.imageblock div.content { padding-left: 0; }\r
+span.image img { border-style: none; }\r
+a.image:visited { color: white; }\r
+\r
+dl {\r
+ margin-top: 0.8em;\r
+ margin-bottom: 0.8em;\r
+}\r
+dt {\r
+ margin-top: 0.5em;\r
+ margin-bottom: 0;\r
+ font-style: normal;\r
+ color: navy;\r
+}\r
+dd > *:first-child {\r
+ margin-top: 0.1em;\r
+}\r
+\r
+ul, ol {\r
+ list-style-position: outside;\r
+}\r
+ol.arabic {\r
+ list-style-type: decimal;\r
+}\r
+ol.loweralpha {\r
+ list-style-type: lower-alpha;\r
+}\r
+ol.upperalpha {\r
+ list-style-type: upper-alpha;\r
+}\r
+ol.lowerroman {\r
+ list-style-type: lower-roman;\r
+}\r
+ol.upperroman {\r
+ list-style-type: upper-roman;\r
+}\r
+\r
+div.compact ul, div.compact ol,\r
+div.compact p, div.compact p,\r
+div.compact div, div.compact div {\r
+ margin-top: 0.1em;\r
+ margin-bottom: 0.1em;\r
+}\r
+\r
+tfoot {\r
+ font-weight: bold;\r
+}\r
+td > div.verse {\r
+ white-space: pre;\r
+}\r
+\r
+div.hdlist {\r
+ margin-top: 0.8em;\r
+ margin-bottom: 0.8em;\r
+}\r
+div.hdlist tr {\r
+ padding-bottom: 15px;\r
+}\r
+dt.hdlist1.strong, td.hdlist1.strong {\r
+ font-weight: bold;\r
+}\r
+td.hdlist1 {\r
+ vertical-align: top;\r
+ font-style: normal;\r
+ padding-right: 0.8em;\r
+ color: navy;\r
+}\r
+td.hdlist2 {\r
+ vertical-align: top;\r
+}\r
+div.hdlist.compact tr {\r
+ margin: 0;\r
+ padding-bottom: 0;\r
+}\r
+\r
+.comment {\r
+ background: yellow;\r
+}\r
+\r
+.footnote, .footnoteref {\r
+ font-size: 0.8em;\r
+}\r
+\r
+span.footnote, span.footnoteref {\r
+ vertical-align: super;\r
+}\r
+\r
+#footnotes {\r
+ margin: 20px 0 20px 0;\r
+ padding: 7px 0 0 0;\r
+}\r
+\r
+#footnotes div.footnote {\r
+ margin: 0 0 5px 0;\r
+}\r
+\r
+#footnotes hr {\r
+ border: none;\r
+ border-top: 1px solid silver;\r
+ height: 1px;\r
+ text-align: left;\r
+ margin-left: 0;\r
+ width: 20%;\r
+ min-width: 100px;\r
+}\r
+\r
+div.colist td {\r
+ padding-right: 0.5em;\r
+ padding-bottom: 0.3em;\r
+ vertical-align: top;\r
+}\r
+div.colist td img {\r
+ margin-top: 0.3em;\r
+}\r
+\r
+@media print {\r
+ #footer-badges { display: none; }\r
+}\r
+\r
+#toc {\r
+ margin-bottom: 2.5em;\r
+}\r
+\r
+#toctitle {\r
+ color: #527bbd;\r
+ font-size: 1.1em;\r
+ font-weight: bold;\r
+ margin-top: 1.0em;\r
+ margin-bottom: 0.1em;\r
+}\r
+\r
+div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {\r
+ margin-top: 0;\r
+ margin-bottom: 0;\r
+}\r
+div.toclevel2 {\r
+ margin-left: 2em;\r
+ font-size: 0.9em;\r
+}\r
+div.toclevel3 {\r
+ margin-left: 4em;\r
+ font-size: 0.9em;\r
+}\r
+div.toclevel4 {\r
+ margin-left: 6em;\r
+ font-size: 0.9em;\r
+}\r
+\r
+span.aqua { color: aqua; }\r
+span.black { color: black; }\r
+span.blue { color: blue; }\r
+span.fuchsia { color: fuchsia; }\r
+span.gray { color: gray; }\r
+span.green { color: green; }\r
+span.lime { color: lime; }\r
+span.maroon { color: maroon; }\r
+span.navy { color: navy; }\r
+span.olive { color: olive; }\r
+span.purple { color: purple; }\r
+span.red { color: red; }\r
+span.silver { color: silver; }\r
+span.teal { color: teal; }\r
+span.white { color: white; }\r
+span.yellow { color: yellow; }\r
+\r
+span.aqua-background { background: aqua; }\r
+span.black-background { background: black; }\r
+span.blue-background { background: blue; }\r
+span.fuchsia-background { background: fuchsia; }\r
+span.gray-background { background: gray; }\r
+span.green-background { background: green; }\r
+span.lime-background { background: lime; }\r
+span.maroon-background { background: maroon; }\r
+span.navy-background { background: navy; }\r
+span.olive-background { background: olive; }\r
+span.purple-background { background: purple; }\r
+span.red-background { background: red; }\r
+span.silver-background { background: silver; }\r
+span.teal-background { background: teal; }\r
+span.white-background { background: white; }\r
+span.yellow-background { background: yellow; }\r
+\r
+span.big { font-size: 2em; }\r
+span.small { font-size: 0.6em; }\r
+\r
+span.underline { text-decoration: underline; }\r
+span.overline { text-decoration: overline; }\r
+span.line-through { text-decoration: line-through; }\r
+\r
+\r
+/*\r
+ * xhtml11 specific\r
+ *\r
+ * */\r
+\r
+tt {\r
+ font-family: monospace;\r
+ font-size: inherit;\r
+ color: navy;\r
+}\r
+\r
+div.tableblock {\r
+ margin-top: 1.0em;\r
+ margin-bottom: 1.5em;\r
+}\r
+div.tableblock > table {\r
+ border: 3px solid #527bbd;\r
+}\r
+thead, p.table.header {\r
+ font-weight: bold;\r
+ color: #527bbd;\r
+}\r
+p.table {\r
+ margin-top: 0;\r
+}\r
+/* Because the table frame attribute is overriden by CSS in most browsers. */\r
+div.tableblock > table[frame="void"] {\r
+ border-style: none;\r
+}\r
+div.tableblock > table[frame="hsides"] {\r
+ border-left-style: none;\r
+ border-right-style: none;\r
+}\r
+div.tableblock > table[frame="vsides"] {\r
+ border-top-style: none;\r
+ border-bottom-style: none;\r
+}\r
+\r
+\r
+/*\r
+ * html5 specific\r
+ *\r
+ * */\r
+\r
+.monospaced {\r
+ font-family: monospace;\r
+ font-size: inherit;\r
+ color: navy;\r
+}\r
+\r
+table.tableblock {\r
+ margin-top: 1.0em;\r
+ margin-bottom: 1.5em;\r
+}\r
+thead, p.tableblock.header {\r
+ font-weight: bold;\r
+ color: #527bbd;\r
+}\r
+p.tableblock {\r
+ margin-top: 0;\r
+}\r
+table.tableblock {\r
+ border-width: 3px;\r
+ border-spacing: 0px;\r
+ border-style: solid;\r
+ border-color: #527bbd;\r
+ border-collapse: collapse;\r
+}\r
+th.tableblock, td.tableblock {\r
+ border-width: 1px;\r
+ padding: 4px;\r
+ border-style: solid;\r
+ border-color: #527bbd;\r
+}\r
+\r
+table.tableblock.frame-topbot {\r
+ border-left-style: hidden;\r
+ border-right-style: hidden;\r
+}\r
+table.tableblock.frame-sides {\r
+ border-top-style: hidden;\r
+ border-bottom-style: hidden;\r
+}\r
+table.tableblock.frame-none {\r
+ border-style: hidden;\r
+}\r
+\r
+th.tableblock.halign-left, td.tableblock.halign-left {\r
+ text-align: left;\r
+}\r
+th.tableblock.halign-center, td.tableblock.halign-center {\r
+ text-align: center;\r
+}\r
+th.tableblock.halign-right, td.tableblock.halign-right {\r
+ text-align: right;\r
+}\r
+\r
+th.tableblock.valign-top, td.tableblock.valign-top {\r
+ vertical-align: top;\r
+}\r
+th.tableblock.valign-middle, td.tableblock.valign-middle {\r
+ vertical-align: middle;\r
+}\r
+th.tableblock.valign-bottom, td.tableblock.valign-bottom {\r
+ vertical-align: bottom;\r
+}\r
+\r
+\r
+/*\r
+ * manpage specific\r
+ *\r
+ * */\r
+\r
+body.manpage h1 {\r
+ padding-top: 0.5em;\r
+ padding-bottom: 0.5em;\r
+ border-top: 2px solid silver;\r
+ border-bottom: 2px solid silver;\r
+}\r
+body.manpage h2 {\r
+ border-style: none;\r
+}\r
+body.manpage div.sectionbody {\r
+ margin-left: 3em;\r
+}\r
+\r
+@media print {\r
+ body.manpage div#toc { display: none; }\r
+}\r
+</style>\r
+<script type="text/javascript">\r
+/*<+'])');\r
+ // Function that scans the DOM tree for header elements (the DOM2\r
+ // nodeIterator API would be a better technique but not supported by all\r
+ // browsers).\r
+ var iterate = function (el) {\r
+ for (var i = el.firstChild; i != null; i = i.nextSibling) {\r
+ if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {\r
+ var mo = re.exec(i.tagName);\r
+ if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {\r
+ result[result.length] = new TocEntry(i, getText(i), mo[1]-1);\r
+ }\r
+ iterate(i);\r
+ }\r
+ }\r
+ }\r
+ iterate(el);\r
+ return result;\r
+ }\r
+\r
+ var toc = document.getElementById("toc");\r
+ if (!toc) {\r
+ return;\r
+ }\r
+\r
+ // Delete existing TOC entries in case we're reloading the TOC.\r
+ var tocEntriesToRemove = [];\r
+ var i;\r
+ for (i = 0; i < toc.childNodes.length; i++) {\r
+ var entry = toc.childNodes[i];\r
+ if (entry.nodeName == 'div'\r
+ && entry.getAttribute("class")\r
+ && entry.getAttribute("class").match(/^toclevel/))\r
+ tocEntriesToRemove.push(entry);\r
+ }\r
+ for (i = 0; i < tocEntriesToRemove.length; i++) {\r
+ toc.removeChild(tocEntriesToRemove[i]);\r
+ }\r
+\r
+ // Rebuild TOC entries.\r
+ var entries = tocEntries(document.getElementById("content"), toclevels);\r
+ for (var i = 0; i < entries.length; ++i) {\r
+ var entry = entries[i];\r
+ if (entry.element.id == "")\r
+ entry.element.id = "_toc_" + i;\r
+ var a = document.createElement("a");\r
+ a.href = "#" + entry.element.id;\r
+ a.appendChild(document.createTextNode(entry.text));\r
+ var div = document.createElement("div");\r
+ div.appendChild(a);\r
+ div.className = "toclevel" + entry.toclevel;\r
+ toc.appendChild(div);\r
+ }\r
+ if (entries.length == 0)\r
+ toc.parentNode.removeChild(toc);\r
+},\r
+\r
+\r
+/////////////////////////////////////////////////////////////////////\r
+// Footnotes generator\r
+/////////////////////////////////////////////////////////////////////\r
+\r
+/* Based on footnote generation code from:\r
+ * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html\r
+ */\r
+\r
+footnotes: function () {\r
+ // Delete existing footnote entries in case we're reloading the footnodes.\r
+ var i;\r
+ var noteholder = document.getElementById("footnotes");\r
+ if (!noteholder) {\r
+ return;\r
+ }\r
+ var entriesToRemove = [];\r
+ for (i = 0; i < noteholder.childNodes.length; i++) {\r
+ var entry = noteholder.childNodes[i];\r
+ if (entry.nodeName == 'div' && entry.getAttribute("class") == "footnote")\r
+ entriesToRemove.push(entry);\r
+ }\r
+ for (i = 0; i < entriesToRemove.length; i++) {\r
+ noteholder.removeChild(entriesToRemove[i]);\r
+ }\r
+\r
+ // Rebuild footnote entries.\r
+ var cont = document.getElementById("content");\r
+ var spans = cont.getElementsByTagName("span");\r
+ var refs = {};\r
+ var n = 0;\r
+ for (i=0; i<spans.length; i++) {\r
+ if (spans[i].className == "footnote") {\r
+ n++;\r
+ var note = spans[i].getAttribute("data-note");\r
+ if (!note) {\r
+ // Use [\s\S] in place of . so multi-line matches work.\r
+ // Because JavaScript has no s (dotall) regex flag.\r
+ note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];\r
+ spans[i].innerHTML =\r
+ "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +\r
+ "' title='View footnote' class='footnote'>" + n + "</a>]";\r
+ spans[i].setAttribute("data-note", note);\r
+ }\r
+ noteholder.innerHTML +=\r
+ "<div class='footnote' id='_footnote_" + n + "'>" +\r
+ "<a href='#_footnoteref_" + n + "' title='Return to text'>" +\r
+ n + "</a>. " + note + "</div>";\r
+ var id =spans[i].getAttribute("id");\r
+ if (id != null) refs["#"+id] = n;\r
+ }\r
+ }\r
+ if (n == 0)\r
+ noteholder.parentNode.removeChild(noteholder);\r
+ else {\r
+ // Process footnoterefs.\r
+ for (i=0; i<spans.length; i++) {\r
+ if (spans[i].className == "footnoteref") {\r
+ var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");\r
+ href = href.match(/#.*/)[0]; // Because IE return full URL.\r
+ n = refs[href];\r
+ spans[i].innerHTML =\r
+ "[<a href='#_footnote_" + n +\r
+ "' title='View footnote' class='footnote'>" + n + "</a>]";\r
+ }\r
+ }\r
+ }\r
+},\r
+\r
+install: function(toclevels) {\r
+ var timerId;\r
+\r
+ function reinstall() {\r
+ asciidoc.footnotes();\r
+ if (toclevels) {\r
+ asciidoc.toc(toclevels);\r
+ }\r
+ }\r
+\r
+ function reinstallAndRemoveTimer() {\r
+ clearInterval(timerId);\r
+ reinstall();\r
+ }\r
+\r
+ timerId = setInterval(reinstall, 500);\r
+ if (document.addEventListener)\r
+ document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);\r
+ else\r
+ window.onload = reinstallAndRemoveTimer;\r
+}\r
+\r
+}\r
+asciidoc.install();\r
+/*]]>*/\r
+</script>\r
+</head>\r
+<body class="manpage">\r
+<div id="header">\r
+<h1>\r
+zmq_z85_decode(3) Manual Page\r
+</h1>\r
+<h2>NAME</h2>\r
+<div class="sectionbody">\r
+<p>zmq_z85_decode -\r
+ decode a binary key from Z85 printable text\r
+</p>\r
+</div>\r
+</div>\r
+<div id="content">\r
+<div class="sect1">\r
+<h2 id="_synopsis">SYNOPSIS</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p><strong>uint8_t *zmq_z85_decode (uint8_t *dest, char *string);</strong></p></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_description">DESCRIPTION</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>The <em>zmq_z85_decode()</em> function shall decode <em>string</em> into <em>dest</em>.\r
+The length of <em>string</em> shall be divisible by 5. <em>dest</em> must be large\r
+enough for the decoded value (0.8 x strlen (string)).</p></div>\r
+<div class="paragraph"><p>The encoding shall follow the ZMQ RFC 32 specification.</p></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_return_value">RETURN VALUE</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>The <em>zmq_z85_decode()</em> function shall return <em>dest</em> if successful, else it\r
+shall return NULL.</p></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_example">EXAMPLE</h2>\r
+<div class="sectionbody">\r
+<div class="listingblock">\r
+<div class="title">Decoding a CURVE key</div>\r
+<div class="content">\r
+<pre><tt>char decoded [] = "rq:rM>}U?@Lns47E1%kR.o@n%FcmmsL/@{H8]yf7";\r
+uint8_t public_key [32];\r
+zmq_z85_decode (public_key, decoded);</tt></pre>\r
+</div></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_see_also">SEE ALSO</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p><a href="zmq_z85_decode.html">zmq_z85_decode(3)</a>\r
+<a href="zmq_curve_keypair.html">zmq_curve_keypair(3)</a>\r
+<a href="zmq_curve.html">zmq_curve(7)</a></p></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_authors">AUTHORS</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
+</div>\r
+</div>\r
+</div>\r
+<div id="footnotes"><hr /></div>\r
+<div id="footer">\r
+<div id="footer-text">\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
+</div>\r
+</div>\r
+</body>\r
+</html>\r
--- /dev/null
+zmq_z85_decode(3)
+=================
+
+
+NAME
+----
+zmq_z85_decode - decode a binary key from Z85 printable text
+
+
+SYNOPSIS
+--------
+*uint8_t *zmq_z85_decode (uint8_t *dest, char *string);*
+
+
+DESCRIPTION
+-----------
+The _zmq_z85_decode()_ function shall decode 'string' into 'dest'.
+The length of 'string' shall be divisible by 5. 'dest' must be large
+enough for the decoded value (0.8 x strlen (string)).
+
+The encoding shall follow the ZMQ RFC 32 specification.
+
+
+RETURN VALUE
+------------
+The _zmq_z85_decode()_ function shall return 'dest' if successful, else it
+shall return NULL.
+
+
+EXAMPLE
+-------
+.Decoding a CURVE key
+----
+char decoded [] = "rq:rM>}U?@Lns47E1%kR.o@n%FcmmsL/@{H8]yf7";
+uint8_t public_key [32];
+zmq_z85_decode (public_key, decoded);
+----
+
+
+SEE ALSO
+--------
+linkzmq:zmq_z85_decode[3]
+linkzmq:zmq_curve_keypair[3]
+linkzmq:zmq_curve[7]
+
+
+AUTHORS
+-------
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
--- /dev/null
+'\" t
+.\" Title: zmq_z85_encode
+.\" Author: [see the "AUTHORS" section]
+.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
+.\" Date: 03/10/2014
+.\" Manual: 0MQ Manual
+.\" Source: 0MQ 4.0.1
+.\" Language: English
+.\"
+.TH "ZMQ_Z85_ENCODE" "3" "03/10/2014" "0MQ 4\&.0\&.1" "0MQ Manual"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+zmq_z85_encode \- encode a binary key as Z85 printable text
+.SH "SYNOPSIS"
+.sp
+\fBchar *zmq_z85_encode (char *dest, uint8_t *data, size_t size);\fR
+.SH "DESCRIPTION"
+.sp
+The \fIzmq_z85_encode()\fR function shall encode the binary block specified by \fIdata\fR and \fIsize\fR into a string in \fIdest\fR\&. The size of the binary block must be divisible by 4\&. The \fIdest\fR must have sufficient space for size * 1\&.25 plus 1 for a null terminator\&. A 32\-byte CURVE key is encoded as 40 ASCII characters plus a null terminator\&.
+.sp
+The encoding shall follow the ZMQ RFC 32 specification\&.
+.SH "RETURN VALUE"
+.sp
+The \fIzmq_z85_encode()\fR function shall return \fIdest\fR if successful, else it shall return NULL\&.
+.SH "EXAMPLE"
+.PP
+\fBEncoding a CURVE key\fR.
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+#include <sodium\&.h>
+uint8_t public_key [32];
+uint8_t secret_key [32];
+int rc = crypto_box_keypair (public_key, secret_key);
+assert (rc == 0);
+char encoded [41];
+zmq_z85_encode (encoded, public_key, 32);
+puts (encoded);
+.fi
+.if n \{\
+.RE
+.\}
+.sp
+.SH "SEE ALSO"
+.sp
+\fBzmq_z85_decode\fR(3) \fBzmq_curve_keypair\fR(3) \fBzmq_curve\fR(7)
+.SH "AUTHORS"
+.sp
+This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"\r
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">\r
+<head>\r
+<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />\r
+<meta name="generator" content="AsciiDoc 8.6.6" />\r
+<title>zmq_z85_encode(3)</title>\r
+<style type="text/css">\r
+/* Shared CSS for AsciiDoc xhtml11 and html5 backends */\r
+\r
+/* Default font. */\r
+body {\r
+ font-family: Georgia,serif;\r
+}\r
+\r
+/* Title font. */\r
+h1, h2, h3, h4, h5, h6,\r
+div.title, caption.title,\r
+thead, p.table.header,\r
+#toctitle,\r
+#author, #revnumber, #revdate, #revremark,\r
+#footer {\r
+ font-family: Arial,Helvetica,sans-serif;\r
+}\r
+\r
+body {\r
+ margin: 1em 5% 1em 5%;\r
+}\r
+\r
+a {\r
+ color: blue;\r
+ text-decoration: underline;\r
+}\r
+a:visited {\r
+ color: fuchsia;\r
+}\r
+\r
+em {\r
+ font-style: italic;\r
+ color: navy;\r
+}\r
+\r
+strong {\r
+ font-weight: bold;\r
+ color: #083194;\r
+}\r
+\r
+h1, h2, h3, h4, h5, h6 {\r
+ color: #527bbd;\r
+ margin-top: 1.2em;\r
+ margin-bottom: 0.5em;\r
+ line-height: 1.3;\r
+}\r
+\r
+h1, h2, h3 {\r
+ border-bottom: 2px solid silver;\r
+}\r
+h2 {\r
+ padding-top: 0.5em;\r
+}\r
+h3 {\r
+ float: left;\r
+}\r
+h3 + * {\r
+ clear: left;\r
+}\r
+h5 {\r
+ font-size: 1.0em;\r
+}\r
+\r
+div.sectionbody {\r
+ margin-left: 0;\r
+}\r
+\r
+hr {\r
+ border: 1px solid silver;\r
+}\r
+\r
+p {\r
+ margin-top: 0.5em;\r
+ margin-bottom: 0.5em;\r
+}\r
+\r
+ul, ol, li > p {\r
+ margin-top: 0;\r
+}\r
+ul > li { color: #aaa; }\r
+ul > li > * { color: black; }\r
+\r
+pre {\r
+ padding: 0;\r
+ margin: 0;\r
+}\r
+\r
+#author {\r
+ color: #527bbd;\r
+ font-weight: bold;\r
+ font-size: 1.1em;\r
+}\r
+#email {\r
+}\r
+#revnumber, #revdate, #revremark {\r
+}\r
+\r
+#footer {\r
+ font-size: small;\r
+ border-top: 2px solid silver;\r
+ padding-top: 0.5em;\r
+ margin-top: 4.0em;\r
+}\r
+#footer-text {\r
+ float: left;\r
+ padding-bottom: 0.5em;\r
+}\r
+#footer-badges {\r
+ float: right;\r
+ padding-bottom: 0.5em;\r
+}\r
+\r
+#preamble {\r
+ margin-top: 1.5em;\r
+ margin-bottom: 1.5em;\r
+}\r
+div.imageblock, div.exampleblock, div.verseblock,\r
+div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,\r
+div.admonitionblock {\r
+ margin-top: 1.0em;\r
+ margin-bottom: 1.5em;\r
+}\r
+div.admonitionblock {\r
+ margin-top: 2.0em;\r
+ margin-bottom: 2.0em;\r
+ margin-right: 10%;\r
+ color: #606060;\r
+}\r
+\r
+div.content { /* Block element content. */\r
+ padding: 0;\r
+}\r
+\r
+/* Block element titles. */\r
+div.title, caption.title {\r
+ color: #527bbd;\r
+ font-weight: bold;\r
+ text-align: left;\r
+ margin-top: 1.0em;\r
+ margin-bottom: 0.5em;\r
+}\r
+div.title + * {\r
+ margin-top: 0;\r
+}\r
+\r
+td div.title:first-child {\r
+ margin-top: 0.0em;\r
+}\r
+div.content div.title:first-child {\r
+ margin-top: 0.0em;\r
+}\r
+div.content + div.title {\r
+ margin-top: 0.0em;\r
+}\r
+\r
+div.sidebarblock > div.content {\r
+ background: #ffffee;\r
+ border: 1px solid #dddddd;\r
+ border-left: 4px solid #f0f0f0;\r
+ padding: 0.5em;\r
+}\r
+\r
+div.listingblock > div.content {\r
+ border: 1px solid #dddddd;\r
+ border-left: 5px solid #f0f0f0;\r
+ background: #f8f8f8;\r
+ padding: 0.5em;\r
+}\r
+\r
+div.quoteblock, div.verseblock {\r
+ padding-left: 1.0em;\r
+ margin-left: 1.0em;\r
+ margin-right: 10%;\r
+ border-left: 5px solid #f0f0f0;\r
+ color: #888;\r
+}\r
+\r
+div.quoteblock > div.attribution {\r
+ padding-top: 0.5em;\r
+ text-align: right;\r
+}\r
+\r
+div.verseblock > pre.content {\r
+ font-family: inherit;\r
+ font-size: inherit;\r
+}\r
+div.verseblock > div.attribution {\r
+ padding-top: 0.75em;\r
+ text-align: left;\r
+}\r
+/* DEPRECATED: Pre version 8.2.7 verse style literal block. */\r
+div.verseblock + div.attribution {\r
+ text-align: left;\r
+}\r
+\r
+div.admonitionblock .icon {\r
+ vertical-align: top;\r
+ font-size: 1.1em;\r
+ font-weight: bold;\r
+ text-decoration: underline;\r
+ color: #527bbd;\r
+ padding-right: 0.5em;\r
+}\r
+div.admonitionblock td.content {\r
+ padding-left: 0.5em;\r
+ border-left: 3px solid #dddddd;\r
+}\r
+\r
+div.exampleblock > div.content {\r
+ border-left: 3px solid #dddddd;\r
+ padding-left: 0.5em;\r
+}\r
+\r
+div.imageblock div.content { padding-left: 0; }\r
+span.image img { border-style: none; }\r
+a.image:visited { color: white; }\r
+\r
+dl {\r
+ margin-top: 0.8em;\r
+ margin-bottom: 0.8em;\r
+}\r
+dt {\r
+ margin-top: 0.5em;\r
+ margin-bottom: 0;\r
+ font-style: normal;\r
+ color: navy;\r
+}\r
+dd > *:first-child {\r
+ margin-top: 0.1em;\r
+}\r
+\r
+ul, ol {\r
+ list-style-position: outside;\r
+}\r
+ol.arabic {\r
+ list-style-type: decimal;\r
+}\r
+ol.loweralpha {\r
+ list-style-type: lower-alpha;\r
+}\r
+ol.upperalpha {\r
+ list-style-type: upper-alpha;\r
+}\r
+ol.lowerroman {\r
+ list-style-type: lower-roman;\r
+}\r
+ol.upperroman {\r
+ list-style-type: upper-roman;\r
+}\r
+\r
+div.compact ul, div.compact ol,\r
+div.compact p, div.compact p,\r
+div.compact div, div.compact div {\r
+ margin-top: 0.1em;\r
+ margin-bottom: 0.1em;\r
+}\r
+\r
+tfoot {\r
+ font-weight: bold;\r
+}\r
+td > div.verse {\r
+ white-space: pre;\r
+}\r
+\r
+div.hdlist {\r
+ margin-top: 0.8em;\r
+ margin-bottom: 0.8em;\r
+}\r
+div.hdlist tr {\r
+ padding-bottom: 15px;\r
+}\r
+dt.hdlist1.strong, td.hdlist1.strong {\r
+ font-weight: bold;\r
+}\r
+td.hdlist1 {\r
+ vertical-align: top;\r
+ font-style: normal;\r
+ padding-right: 0.8em;\r
+ color: navy;\r
+}\r
+td.hdlist2 {\r
+ vertical-align: top;\r
+}\r
+div.hdlist.compact tr {\r
+ margin: 0;\r
+ padding-bottom: 0;\r
+}\r
+\r
+.comment {\r
+ background: yellow;\r
+}\r
+\r
+.footnote, .footnoteref {\r
+ font-size: 0.8em;\r
+}\r
+\r
+span.footnote, span.footnoteref {\r
+ vertical-align: super;\r
+}\r
+\r
+#footnotes {\r
+ margin: 20px 0 20px 0;\r
+ padding: 7px 0 0 0;\r
+}\r
+\r
+#footnotes div.footnote {\r
+ margin: 0 0 5px 0;\r
+}\r
+\r
+#footnotes hr {\r
+ border: none;\r
+ border-top: 1px solid silver;\r
+ height: 1px;\r
+ text-align: left;\r
+ margin-left: 0;\r
+ width: 20%;\r
+ min-width: 100px;\r
+}\r
+\r
+div.colist td {\r
+ padding-right: 0.5em;\r
+ padding-bottom: 0.3em;\r
+ vertical-align: top;\r
+}\r
+div.colist td img {\r
+ margin-top: 0.3em;\r
+}\r
+\r
+@media print {\r
+ #footer-badges { display: none; }\r
+}\r
+\r
+#toc {\r
+ margin-bottom: 2.5em;\r
+}\r
+\r
+#toctitle {\r
+ color: #527bbd;\r
+ font-size: 1.1em;\r
+ font-weight: bold;\r
+ margin-top: 1.0em;\r
+ margin-bottom: 0.1em;\r
+}\r
+\r
+div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {\r
+ margin-top: 0;\r
+ margin-bottom: 0;\r
+}\r
+div.toclevel2 {\r
+ margin-left: 2em;\r
+ font-size: 0.9em;\r
+}\r
+div.toclevel3 {\r
+ margin-left: 4em;\r
+ font-size: 0.9em;\r
+}\r
+div.toclevel4 {\r
+ margin-left: 6em;\r
+ font-size: 0.9em;\r
+}\r
+\r
+span.aqua { color: aqua; }\r
+span.black { color: black; }\r
+span.blue { color: blue; }\r
+span.fuchsia { color: fuchsia; }\r
+span.gray { color: gray; }\r
+span.green { color: green; }\r
+span.lime { color: lime; }\r
+span.maroon { color: maroon; }\r
+span.navy { color: navy; }\r
+span.olive { color: olive; }\r
+span.purple { color: purple; }\r
+span.red { color: red; }\r
+span.silver { color: silver; }\r
+span.teal { color: teal; }\r
+span.white { color: white; }\r
+span.yellow { color: yellow; }\r
+\r
+span.aqua-background { background: aqua; }\r
+span.black-background { background: black; }\r
+span.blue-background { background: blue; }\r
+span.fuchsia-background { background: fuchsia; }\r
+span.gray-background { background: gray; }\r
+span.green-background { background: green; }\r
+span.lime-background { background: lime; }\r
+span.maroon-background { background: maroon; }\r
+span.navy-background { background: navy; }\r
+span.olive-background { background: olive; }\r
+span.purple-background { background: purple; }\r
+span.red-background { background: red; }\r
+span.silver-background { background: silver; }\r
+span.teal-background { background: teal; }\r
+span.white-background { background: white; }\r
+span.yellow-background { background: yellow; }\r
+\r
+span.big { font-size: 2em; }\r
+span.small { font-size: 0.6em; }\r
+\r
+span.underline { text-decoration: underline; }\r
+span.overline { text-decoration: overline; }\r
+span.line-through { text-decoration: line-through; }\r
+\r
+\r
+/*\r
+ * xhtml11 specific\r
+ *\r
+ * */\r
+\r
+tt {\r
+ font-family: monospace;\r
+ font-size: inherit;\r
+ color: navy;\r
+}\r
+\r
+div.tableblock {\r
+ margin-top: 1.0em;\r
+ margin-bottom: 1.5em;\r
+}\r
+div.tableblock > table {\r
+ border: 3px solid #527bbd;\r
+}\r
+thead, p.table.header {\r
+ font-weight: bold;\r
+ color: #527bbd;\r
+}\r
+p.table {\r
+ margin-top: 0;\r
+}\r
+/* Because the table frame attribute is overriden by CSS in most browsers. */\r
+div.tableblock > table[frame="void"] {\r
+ border-style: none;\r
+}\r
+div.tableblock > table[frame="hsides"] {\r
+ border-left-style: none;\r
+ border-right-style: none;\r
+}\r
+div.tableblock > table[frame="vsides"] {\r
+ border-top-style: none;\r
+ border-bottom-style: none;\r
+}\r
+\r
+\r
+/*\r
+ * html5 specific\r
+ *\r
+ * */\r
+\r
+.monospaced {\r
+ font-family: monospace;\r
+ font-size: inherit;\r
+ color: navy;\r
+}\r
+\r
+table.tableblock {\r
+ margin-top: 1.0em;\r
+ margin-bottom: 1.5em;\r
+}\r
+thead, p.tableblock.header {\r
+ font-weight: bold;\r
+ color: #527bbd;\r
+}\r
+p.tableblock {\r
+ margin-top: 0;\r
+}\r
+table.tableblock {\r
+ border-width: 3px;\r
+ border-spacing: 0px;\r
+ border-style: solid;\r
+ border-color: #527bbd;\r
+ border-collapse: collapse;\r
+}\r
+th.tableblock, td.tableblock {\r
+ border-width: 1px;\r
+ padding: 4px;\r
+ border-style: solid;\r
+ border-color: #527bbd;\r
+}\r
+\r
+table.tableblock.frame-topbot {\r
+ border-left-style: hidden;\r
+ border-right-style: hidden;\r
+}\r
+table.tableblock.frame-sides {\r
+ border-top-style: hidden;\r
+ border-bottom-style: hidden;\r
+}\r
+table.tableblock.frame-none {\r
+ border-style: hidden;\r
+}\r
+\r
+th.tableblock.halign-left, td.tableblock.halign-left {\r
+ text-align: left;\r
+}\r
+th.tableblock.halign-center, td.tableblock.halign-center {\r
+ text-align: center;\r
+}\r
+th.tableblock.halign-right, td.tableblock.halign-right {\r
+ text-align: right;\r
+}\r
+\r
+th.tableblock.valign-top, td.tableblock.valign-top {\r
+ vertical-align: top;\r
+}\r
+th.tableblock.valign-middle, td.tableblock.valign-middle {\r
+ vertical-align: middle;\r
+}\r
+th.tableblock.valign-bottom, td.tableblock.valign-bottom {\r
+ vertical-align: bottom;\r
+}\r
+\r
+\r
+/*\r
+ * manpage specific\r
+ *\r
+ * */\r
+\r
+body.manpage h1 {\r
+ padding-top: 0.5em;\r
+ padding-bottom: 0.5em;\r
+ border-top: 2px solid silver;\r
+ border-bottom: 2px solid silver;\r
+}\r
+body.manpage h2 {\r
+ border-style: none;\r
+}\r
+body.manpage div.sectionbody {\r
+ margin-left: 3em;\r
+}\r
+\r
+@media print {\r
+ body.manpage div#toc { display: none; }\r
+}\r
+</style>\r
+<script type="text/javascript">\r
+/*<+'])');\r
+ // Function that scans the DOM tree for header elements (the DOM2\r
+ // nodeIterator API would be a better technique but not supported by all\r
+ // browsers).\r
+ var iterate = function (el) {\r
+ for (var i = el.firstChild; i != null; i = i.nextSibling) {\r
+ if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {\r
+ var mo = re.exec(i.tagName);\r
+ if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {\r
+ result[result.length] = new TocEntry(i, getText(i), mo[1]-1);\r
+ }\r
+ iterate(i);\r
+ }\r
+ }\r
+ }\r
+ iterate(el);\r
+ return result;\r
+ }\r
+\r
+ var toc = document.getElementById("toc");\r
+ if (!toc) {\r
+ return;\r
+ }\r
+\r
+ // Delete existing TOC entries in case we're reloading the TOC.\r
+ var tocEntriesToRemove = [];\r
+ var i;\r
+ for (i = 0; i < toc.childNodes.length; i++) {\r
+ var entry = toc.childNodes[i];\r
+ if (entry.nodeName == 'div'\r
+ && entry.getAttribute("class")\r
+ && entry.getAttribute("class").match(/^toclevel/))\r
+ tocEntriesToRemove.push(entry);\r
+ }\r
+ for (i = 0; i < tocEntriesToRemove.length; i++) {\r
+ toc.removeChild(tocEntriesToRemove[i]);\r
+ }\r
+\r
+ // Rebuild TOC entries.\r
+ var entries = tocEntries(document.getElementById("content"), toclevels);\r
+ for (var i = 0; i < entries.length; ++i) {\r
+ var entry = entries[i];\r
+ if (entry.element.id == "")\r
+ entry.element.id = "_toc_" + i;\r
+ var a = document.createElement("a");\r
+ a.href = "#" + entry.element.id;\r
+ a.appendChild(document.createTextNode(entry.text));\r
+ var div = document.createElement("div");\r
+ div.appendChild(a);\r
+ div.className = "toclevel" + entry.toclevel;\r
+ toc.appendChild(div);\r
+ }\r
+ if (entries.length == 0)\r
+ toc.parentNode.removeChild(toc);\r
+},\r
+\r
+\r
+/////////////////////////////////////////////////////////////////////\r
+// Footnotes generator\r
+/////////////////////////////////////////////////////////////////////\r
+\r
+/* Based on footnote generation code from:\r
+ * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html\r
+ */\r
+\r
+footnotes: function () {\r
+ // Delete existing footnote entries in case we're reloading the footnodes.\r
+ var i;\r
+ var noteholder = document.getElementById("footnotes");\r
+ if (!noteholder) {\r
+ return;\r
+ }\r
+ var entriesToRemove = [];\r
+ for (i = 0; i < noteholder.childNodes.length; i++) {\r
+ var entry = noteholder.childNodes[i];\r
+ if (entry.nodeName == 'div' && entry.getAttribute("class") == "footnote")\r
+ entriesToRemove.push(entry);\r
+ }\r
+ for (i = 0; i < entriesToRemove.length; i++) {\r
+ noteholder.removeChild(entriesToRemove[i]);\r
+ }\r
+\r
+ // Rebuild footnote entries.\r
+ var cont = document.getElementById("content");\r
+ var spans = cont.getElementsByTagName("span");\r
+ var refs = {};\r
+ var n = 0;\r
+ for (i=0; i<spans.length; i++) {\r
+ if (spans[i].className == "footnote") {\r
+ n++;\r
+ var note = spans[i].getAttribute("data-note");\r
+ if (!note) {\r
+ // Use [\s\S] in place of . so multi-line matches work.\r
+ // Because JavaScript has no s (dotall) regex flag.\r
+ note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];\r
+ spans[i].innerHTML =\r
+ "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +\r
+ "' title='View footnote' class='footnote'>" + n + "</a>]";\r
+ spans[i].setAttribute("data-note", note);\r
+ }\r
+ noteholder.innerHTML +=\r
+ "<div class='footnote' id='_footnote_" + n + "'>" +\r
+ "<a href='#_footnoteref_" + n + "' title='Return to text'>" +\r
+ n + "</a>. " + note + "</div>";\r
+ var id =spans[i].getAttribute("id");\r
+ if (id != null) refs["#"+id] = n;\r
+ }\r
+ }\r
+ if (n == 0)\r
+ noteholder.parentNode.removeChild(noteholder);\r
+ else {\r
+ // Process footnoterefs.\r
+ for (i=0; i<spans.length; i++) {\r
+ if (spans[i].className == "footnoteref") {\r
+ var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");\r
+ href = href.match(/#.*/)[0]; // Because IE return full URL.\r
+ n = refs[href];\r
+ spans[i].innerHTML =\r
+ "[<a href='#_footnote_" + n +\r
+ "' title='View footnote' class='footnote'>" + n + "</a>]";\r
+ }\r
+ }\r
+ }\r
+},\r
+\r
+install: function(toclevels) {\r
+ var timerId;\r
+\r
+ function reinstall() {\r
+ asciidoc.footnotes();\r
+ if (toclevels) {\r
+ asciidoc.toc(toclevels);\r
+ }\r
+ }\r
+\r
+ function reinstallAndRemoveTimer() {\r
+ clearInterval(timerId);\r
+ reinstall();\r
+ }\r
+\r
+ timerId = setInterval(reinstall, 500);\r
+ if (document.addEventListener)\r
+ document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);\r
+ else\r
+ window.onload = reinstallAndRemoveTimer;\r
+}\r
+\r
+}\r
+asciidoc.install();\r
+/*]]>*/\r
+</script>\r
+</head>\r
+<body class="manpage">\r
+<div id="header">\r
+<h1>\r
+zmq_z85_encode(3) Manual Page\r
+</h1>\r
+<h2>NAME</h2>\r
+<div class="sectionbody">\r
+<p>zmq_z85_encode -\r
+ encode a binary key as Z85 printable text\r
+</p>\r
+</div>\r
+</div>\r
+<div id="content">\r
+<div class="sect1">\r
+<h2 id="_synopsis">SYNOPSIS</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p><strong>char *zmq_z85_encode (char *dest, uint8_t *data, size_t size);</strong></p></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_description">DESCRIPTION</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>The <em>zmq_z85_encode()</em> function shall encode the binary block specified\r
+by <em>data</em> and <em>size</em> into a string in <em>dest</em>. The size of the binary block\r
+must be divisible by 4. The <em>dest</em> must have sufficient space for size * 1.25\r
+plus 1 for a null terminator. A 32-byte CURVE key is encoded as 40 ASCII\r
+characters plus a null terminator.</p></div>\r
+<div class="paragraph"><p>The encoding shall follow the ZMQ RFC 32 specification.</p></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_return_value">RETURN VALUE</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>The <em>zmq_z85_encode()</em> function shall return <em>dest</em> if successful, else it\r
+shall return NULL.</p></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_example">EXAMPLE</h2>\r
+<div class="sectionbody">\r
+<div class="listingblock">\r
+<div class="title">Encoding a CURVE key</div>\r
+<div class="content">\r
+<pre><tt>#include <sodium.h>\r
+uint8_t public_key [32];\r
+uint8_t secret_key [32];\r
+int rc = crypto_box_keypair (public_key, secret_key);\r
+assert (rc == 0);\r
+char encoded [41];\r
+zmq_z85_encode (encoded, public_key, 32);\r
+puts (encoded);</tt></pre>\r
+</div></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_see_also">SEE ALSO</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p><a href="zmq_z85_decode.html">zmq_z85_decode(3)</a>\r
+<a href="zmq_curve_keypair.html">zmq_curve_keypair(3)</a>\r
+<a href="zmq_curve.html">zmq_curve(7)</a></p></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_authors">AUTHORS</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>This page was written by the ØMQ community. To make a change please\r
+read the ØMQ Contribution Policy at <a href="http://www.zeromq.org/docs:contributing">http://www.zeromq.org/docs:contributing</a>.</p></div>\r
+</div>\r
+</div>\r
+</div>\r
+<div id="footnotes"><hr /></div>\r
+<div id="footer">\r
+<div id="footer-text">\r
+ØMQ 4.0.4<br />\r
+Last updated 2013-11-13 18:57:50 CET\r
+</div>\r
+</div>\r
+</body>\r
+</html>\r
--- /dev/null
+zmq_z85_encode(3)
+=================
+
+
+NAME
+----
+zmq_z85_encode - encode a binary key as Z85 printable text
+
+
+SYNOPSIS
+--------
+*char *zmq_z85_encode (char *dest, uint8_t *data, size_t size);*
+
+
+DESCRIPTION
+-----------
+The _zmq_z85_encode()_ function shall encode the binary block specified
+by 'data' and 'size' into a string in 'dest'. The size of the binary block
+must be divisible by 4. The 'dest' must have sufficient space for size * 1.25
+plus 1 for a null terminator. A 32-byte CURVE key is encoded as 40 ASCII
+characters plus a null terminator.
+
+The encoding shall follow the ZMQ RFC 32 specification.
+
+
+RETURN VALUE
+------------
+The _zmq_z85_encode()_ function shall return 'dest' if successful, else it
+shall return NULL.
+
+
+EXAMPLE
+-------
+.Encoding a CURVE key
+----
+#include <sodium.h>
+uint8_t public_key [32];
+uint8_t secret_key [32];
+int rc = crypto_box_keypair (public_key, secret_key);
+assert (rc == 0);
+char encoded [41];
+zmq_z85_encode (encoded, public_key, 32);
+puts (encoded);
+----
+
+
+SEE ALSO
+--------
+linkzmq:zmq_z85_decode[3]
+linkzmq:zmq_curve_keypair[3]
+linkzmq:zmq_curve[7]
+
+
+AUTHORS
+-------
+This page was written by the 0MQ community. To make a change please
+read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
$(top_srcdir)/config/ltsugar.m4 \
$(top_srcdir)/config/ltversion.m4 \
$(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
/*
- Copyright (c) 2007-2012 iMatix Corporation
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2011 VMware, Inc.
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ *************************************************************************
+ NOTE to contributors. This file comprises the principal public contract
+ for ZeroMQ API users (along with zmq_utils.h). Any change to this file
+ supplied in a stable release SHOULD not break existing applications.
+ In practice this means that the value of constants must not change, and
+ that old values may not be reused for new constants.
+ *************************************************************************
*/
#ifndef __ZMQ_H_INCLUDED__
#define __ZMQ_H_INCLUDED__
+/* Version macros for compile-time API version detection */
+#define ZMQ_VERSION_MAJOR 4
+#define ZMQ_VERSION_MINOR 0
+#define ZMQ_VERSION_PATCH 4
+
+#define ZMQ_MAKE_VERSION(major, minor, patch) \
+ ((major) * 10000 + (minor) * 100 + (patch))
+#define ZMQ_VERSION \
+ ZMQ_MAKE_VERSION(ZMQ_VERSION_MAJOR, ZMQ_VERSION_MINOR, ZMQ_VERSION_PATCH)
+
#ifdef __cplusplus
extern "C" {
#endif
-#if !defined WINCE
+#if !defined _WIN32_WCE
#include <errno.h>
#endif
#include <stddef.h>
/* Handle DSO symbol visibility */
#if defined _WIN32
-# if defined DLL_EXPORT
+# if defined ZMQ_STATIC
+# define ZMQ_EXPORT
+# elif defined DLL_EXPORT
# define ZMQ_EXPORT __declspec(dllexport)
# else
# define ZMQ_EXPORT __declspec(dllimport)
# endif
#endif
-/******************************************************************************/
-/* 0MQ versioning support. */
-/******************************************************************************/
-
-/* Version macros for compile-time API version detection */
-#define ZMQ_VERSION_MAJOR 3
-#define ZMQ_VERSION_MINOR 2
-#define ZMQ_VERSION_PATCH 2
-
-#define ZMQ_MAKE_VERSION(major, minor, patch) \
- ((major) * 10000 + (minor) * 100 + (patch))
-#define ZMQ_VERSION \
- ZMQ_MAKE_VERSION(ZMQ_VERSION_MAJOR, ZMQ_VERSION_MINOR, ZMQ_VERSION_PATCH)
+/* Define integer types needed for event interface */
+#if defined ZMQ_HAVE_SOLARIS || defined ZMQ_HAVE_OPENVMS
+# include <inttypes.h>
+#elif defined _MSC_VER && _MSC_VER < 1600
+# ifndef int32_t
+typedef __int32 int32_t;
+# endif
+# ifndef uint16_t
+typedef unsigned __int16 uint16_t;
+# endif
+# ifndef uint8_t
+typedef unsigned __int8 uint8_t;
+# endif
+#else
+# include <stdint.h>
+#endif
-/* Run-time API version detection */
-ZMQ_EXPORT void zmq_version (int *major, int *minor, int *patch);
/******************************************************************************/
/* 0MQ errors. */
#define ETERM (ZMQ_HAUSNUMERO + 53)
#define EMTHREAD (ZMQ_HAUSNUMERO + 54)
+/* Run-time API version detection */
+ZMQ_EXPORT void zmq_version (int *major, int *minor, int *patch);
+
/* This function retrieves the errno as it is known to 0MQ library. The goal */
/* of this function is to make the code 100% portable, including where 0MQ */
/* compiled with certain CRT library (on Windows) is linked to an */
/* Default for new contexts */
#define ZMQ_IO_THREADS_DFLT 1
-#define ZMQ_MAX_SOCKETS_DFLT 1024
+#define ZMQ_MAX_SOCKETS_DFLT 1023
ZMQ_EXPORT void *zmq_ctx_new (void);
-ZMQ_EXPORT int zmq_ctx_destroy (void *context);
+ZMQ_EXPORT int zmq_ctx_term (void *context);
+ZMQ_EXPORT int zmq_ctx_shutdown (void *ctx_);
ZMQ_EXPORT int zmq_ctx_set (void *context, int option, int optval);
ZMQ_EXPORT int zmq_ctx_get (void *context, int option);
/* Old (legacy) API */
ZMQ_EXPORT void *zmq_init (int io_threads);
ZMQ_EXPORT int zmq_term (void *context);
+ZMQ_EXPORT int zmq_ctx_destroy (void *context);
/******************************************************************************/
/* 0MQ socket definition. */
/******************************************************************************/
-/* Socket types. */
+/* Socket types. */
#define ZMQ_PAIR 0
#define ZMQ_PUB 1
#define ZMQ_SUB 2
#define ZMQ_PUSH 8
#define ZMQ_XPUB 9
#define ZMQ_XSUB 10
+#define ZMQ_STREAM 11
/* Deprecated aliases */
#define ZMQ_XREQ ZMQ_DEALER
#define ZMQ_MULTICAST_HOPS 25
#define ZMQ_RCVTIMEO 27
#define ZMQ_SNDTIMEO 28
-#define ZMQ_IPV4ONLY 31
#define ZMQ_LAST_ENDPOINT 32
#define ZMQ_ROUTER_MANDATORY 33
#define ZMQ_TCP_KEEPALIVE 34
#define ZMQ_TCP_KEEPALIVE_IDLE 36
#define ZMQ_TCP_KEEPALIVE_INTVL 37
#define ZMQ_TCP_ACCEPT_FILTER 38
-#define ZMQ_DELAY_ATTACH_ON_CONNECT 39
+#define ZMQ_IMMEDIATE 39
#define ZMQ_XPUB_VERBOSE 40
-
+#define ZMQ_ROUTER_RAW 41
+#define ZMQ_IPV6 42
+#define ZMQ_MECHANISM 43
+#define ZMQ_PLAIN_SERVER 44
+#define ZMQ_PLAIN_USERNAME 45
+#define ZMQ_PLAIN_PASSWORD 46
+#define ZMQ_CURVE_SERVER 47
+#define ZMQ_CURVE_PUBLICKEY 48
+#define ZMQ_CURVE_SECRETKEY 49
+#define ZMQ_CURVE_SERVERKEY 50
+#define ZMQ_PROBE_ROUTER 51
+#define ZMQ_REQ_CORRELATE 52
+#define ZMQ_REQ_RELAXED 53
+#define ZMQ_CONFLATE 54
+#define ZMQ_ZAP_DOMAIN 55
/* Message options */
#define ZMQ_MORE 1
#define ZMQ_DONTWAIT 1
#define ZMQ_SNDMORE 2
-/* Deprecated aliases */
-#define ZMQ_NOBLOCK ZMQ_DONTWAIT
-#define ZMQ_FAIL_UNROUTABLE ZMQ_ROUTER_MANDATORY
-#define ZMQ_ROUTER_BEHAVIOR ZMQ_ROUTER_MANDATORY
+/* Security mechanisms */
+#define ZMQ_NULL 0
+#define ZMQ_PLAIN 1
+#define ZMQ_CURVE 2
+
+/* Deprecated options and aliases */
+#define ZMQ_IPV4ONLY 31
+#define ZMQ_DELAY_ATTACH_ON_CONNECT ZMQ_IMMEDIATE
+#define ZMQ_NOBLOCK ZMQ_DONTWAIT
+#define ZMQ_FAIL_UNROUTABLE ZMQ_ROUTER_MANDATORY
+#define ZMQ_ROUTER_BEHAVIOR ZMQ_ROUTER_MANDATORY
/******************************************************************************/
/* 0MQ socket events and monitoring */
#define ZMQ_EVENT_CLOSED 128
#define ZMQ_EVENT_CLOSE_FAILED 256
#define ZMQ_EVENT_DISCONNECTED 512
+#define ZMQ_EVENT_MONITOR_STOPPED 1024
#define ZMQ_EVENT_ALL ( ZMQ_EVENT_CONNECTED | ZMQ_EVENT_CONNECT_DELAYED | \
ZMQ_EVENT_CONNECT_RETRIED | ZMQ_EVENT_LISTENING | \
ZMQ_EVENT_BIND_FAILED | ZMQ_EVENT_ACCEPTED | \
ZMQ_EVENT_ACCEPT_FAILED | ZMQ_EVENT_CLOSED | \
- ZMQ_EVENT_CLOSE_FAILED | ZMQ_EVENT_DISCONNECTED )
+ ZMQ_EVENT_CLOSE_FAILED | ZMQ_EVENT_DISCONNECTED | \
+ ZMQ_EVENT_MONITOR_STOPPED)
-/* Socket event data (union member per event) */
+/* Socket event data */
typedef struct {
- int event;
- union {
- struct {
- char *addr;
- int fd;
- } connected;
- struct {
- char *addr;
- int err;
- } connect_delayed;
- struct {
- char *addr;
- int interval;
- } connect_retried;
- struct {
- char *addr;
- int fd;
- } listening;
- struct {
- char *addr;
- int err;
- } bind_failed;
- struct {
- char *addr;
- int fd;
- } accepted;
- struct {
- char *addr;
- int err;
- } accept_failed;
- struct {
- char *addr;
- int fd;
- } closed;
- struct {
- char *addr;
- int err;
- } close_failed;
- struct {
- char *addr;
- int fd;
- } disconnected;
- } data;
+ uint16_t event; // id of the event as bitfield
+ int32_t value ; // value is either error code, fd or reconnect interval
} zmq_event_t;
ZMQ_EXPORT void *zmq_socket (void *, int type);
ZMQ_EXPORT int zmq_close (void *s);
ZMQ_EXPORT int zmq_setsockopt (void *s, int option, const void *optval,
- size_t optvallen);
+ size_t optvallen);
ZMQ_EXPORT int zmq_getsockopt (void *s, int option, void *optval,
size_t *optvallen);
ZMQ_EXPORT int zmq_bind (void *s, const char *addr);
ZMQ_EXPORT int zmq_unbind (void *s, const char *addr);
ZMQ_EXPORT int zmq_disconnect (void *s, const char *addr);
ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
+ZMQ_EXPORT int zmq_send_const (void *s, const void *buf, size_t len, int flags);
ZMQ_EXPORT int zmq_recv (void *s, void *buf, size_t len, int flags);
ZMQ_EXPORT int zmq_socket_monitor (void *s, const char *addr, int events);
short revents;
} zmq_pollitem_t;
+#define ZMQ_POLLITEMS_DFLT 16
+
ZMQ_EXPORT int zmq_poll (zmq_pollitem_t *items, int nitems, long timeout);
/* Built-in message proxy (3-way) */
ZMQ_EXPORT int zmq_proxy (void *frontend, void *backend, void *capture);
+/* Encode a binary key as printable text using ZMQ RFC 32 */
+ZMQ_EXPORT char *zmq_z85_encode (char *dest, uint8_t *data, size_t size);
+
+/* Encode a binary key from printable text per ZMQ RFC 32 */
+ZMQ_EXPORT uint8_t *zmq_z85_decode (uint8_t *dest, char *string);
+
/* Deprecated aliases */
#define ZMQ_STREAMER 1
#define ZMQ_FORWARDER 2
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
#ifndef __ZMQ_UTILS_H_INCLUDED__
#define __ZMQ_UTILS_H_INCLUDED__
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+/* Define integer types needed for event interface */
+#if defined ZMQ_HAVE_SOLARIS || defined ZMQ_HAVE_OPENVMS
+# include <inttypes.h>
+#elif defined _MSC_VER && _MSC_VER < 1600
+# ifndef int32_t
+typedef __int32 int32_t;
+# endif
+# ifndef uint16_t
+typedef unsigned __int16 uint16_t;
+# endif
+#else
+# include <stdint.h>
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
/* Handle DSO symbol visibility */
#if defined _WIN32
-# if defined DLL_EXPORT
+# if defined ZMQ_STATIC
+# define ZMQ_EXPORT
+# elif defined DLL_EXPORT
# define ZMQ_EXPORT __declspec(dllexport)
# else
# define ZMQ_EXPORT __declspec(dllimport)
# endif
#endif
+/* These functions are documented by man pages */
+
+/* Encode data with Z85 encoding. Returns encoded data */
+ZMQ_EXPORT char *zmq_z85_encode (char *dest, uint8_t *data, size_t size);
+
+/* Decode data with Z85 encoding. Returns decoded data */
+ZMQ_EXPORT uint8_t *zmq_z85_decode (uint8_t *dest, char *string);
+
+/* Generate z85-encoded public and private keypair with libsodium. */
+/* Returns 0 on success. */
+ZMQ_EXPORT int zmq_curve_keypair (char *z85_public_key, char *z85_secret_key);
+
+typedef void (zmq_thread_fn) (void*);
+
+/* These functions are not documented by man pages */
+
/* Helper functions are used by perf tests so that they don't have to care */
/* about minutiae of time-related functions on different OS platforms. */
/* Sleeps for specified number of seconds. */
ZMQ_EXPORT void zmq_sleep (int seconds_);
+/* Start a thread. Returns a handle to the thread. */
+ZMQ_EXPORT void *zmq_threadstart (zmq_thread_fn* func, void* arg);
+
+/* Wait for thread to complete then free up resources. */
+ZMQ_EXPORT void zmq_threadclose (void* thread);
+
#undef ZMQ_EXPORT
#ifdef __cplusplus
$(top_srcdir)/config/ltsugar.m4 \
$(top_srcdir)/config/ltversion.m4 \
$(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
/*
- Copyright (c) 2007-2012 iMatix Corporation
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
#include <stdlib.h>
#include <string.h>
-#include "../src/platform.hpp"
+#include "platform.hpp"
#if defined ZMQ_HAVE_WINDOWS
#include <windows.h>
#include <stdlib.h>
#include <string.h>
-#include "../src/platform.hpp"
+#include "platform.hpp"
#if defined ZMQ_HAVE_WINDOWS
#include <windows.h>
/*
- Copyright (c) 2007-2012 iMatix Corporation
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
/*
- Copyright (c) 2007-2012 iMatix Corporation
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
/*
- Copyright (c) 2007-2012 iMatix Corporation
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
}
for (i = 0; i != message_count; i++) {
-
rc = zmq_msg_init_size (&msg, message_size);
if (rc != 0) {
printf ("error in zmq_msg_init_size: %s\n", zmq_strerror (errno));
return -1;
}
-#if defined ZMQ_MAKE_VALGRIND_HAPPY
- memset (zmq_msg_data (&msg), 0, message_size);
-#endif
-
rc = zmq_sendmsg (s, &msg, 0);
if (rc < 0) {
printf ("error in zmq_sendmsg: %s\n", zmq_strerror (errno));
command.hpp \
config.hpp \
ctx.hpp \
+ curve_client.hpp \
+ curve_server.hpp \
decoder.hpp \
devpoll.hpp \
dist.hpp \
i_encoder.hpp \
i_decoder.hpp \
i_engine.hpp \
- i_msg_sink.hpp \
- i_msg_source.hpp \
i_poll_events.hpp \
io_object.hpp \
io_thread.hpp \
lb.hpp \
likely.hpp \
mailbox.hpp \
+ mechanism.hpp \
msg.hpp \
mtrie.hpp \
mutex.hpp \
+ null_mechanism.hpp \
object.hpp \
options.hpp \
own.hpp \
pgm_sender.hpp \
pgm_socket.hpp \
pipe.hpp \
+ plain_mechanism.hpp \
platform.hpp \
poll.hpp \
poller.hpp \
signaler.hpp \
socket_base.hpp \
stdint.hpp \
+ stream.hpp \
stream_engine.hpp \
sub.hpp \
tcp.hpp \
dealer.hpp \
xsub.hpp \
ypipe.hpp \
+ ypipe_base.hpp \
yqueue.hpp \
address.cpp \
clock.cpp \
ctx.cpp \
- decoder.cpp \
+ curve_client.cpp \
+ curve_server.cpp \
devpoll.cpp \
dist.cpp \
- encoder.cpp \
epoll.cpp \
err.cpp \
fq.cpp \
kqueue.cpp \
lb.cpp \
mailbox.cpp \
+ mechanism.cpp \
msg.cpp \
mtrie.cpp \
+ null_mechanism.cpp \
object.cpp \
options.cpp \
own.cpp \
pgm_sender.cpp \
pgm_socket.cpp \
pipe.cpp \
+ plain_mechanism.cpp \
poll.cpp \
poller_base.cpp \
pull.cpp \
session_base.cpp \
signaler.cpp \
socket_base.cpp \
+ stream.cpp \
stream_engine.cpp \
sub.cpp \
tcp.cpp \
router.cpp \
dealer.cpp \
v1_decoder.cpp \
- v1_decoder.hpp \
v1_encoder.cpp \
+ v1_decoder.hpp \
v1_encoder.hpp \
- v1_protocol.hpp \
+ v2_decoder.cpp \
+ v2_decoder.hpp \
+ v2_encoder.cpp \
+ v2_encoder.hpp \
+ v2_protocol.hpp \
xsub.cpp \
zmq.cpp \
- zmq_utils.cpp
+ zmq_utils.cpp \
+ raw_decoder.hpp \
+ raw_decoder.cpp \
+ raw_encoder.hpp \
+ raw_encoder.cpp \
+ ypipe_conflate.hpp \
+ dbuffer.hpp
if ON_MINGW
libzmq_la_LDFLAGS = -no-undefined -avoid-version -version-info @LTVER@ @LIBZMQ_EXTRA_LDFLAGS@
if ON_ANDROID
libzmq_la_LDFLAGS = -avoid-version -version-info @LTVER@ @LIBZMQ_EXTRA_LDFLAGS@
else
-libzmq_la_LDFLAGS = -version-info @LTVER@ @LIBZMQ_EXTRA_LDFLAGS@
+if ON_LINUX
+libzmq_la_LDFLAGS = -version-info @LTVER@ @LIBZMQ_EXTRA_LDFLAGS@ -Wl,--version-script=$(srcdir)/libzmq.vers
+else
+libzmq_la_LDFLAGS = -version-info @LTVER@ @LIBZMQ_EXTRA_LDFLAGS@ -Wl
endif
endif
+endif
+
+EXTRA_DIST = libzmq.vers
libzmq_la_CXXFLAGS = @LIBZMQ_EXTRA_CXXFLAGS@
$(top_srcdir)/config/ltsugar.m4 \
$(top_srcdir)/config/ltversion.m4 \
$(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@BUILD_PGM_TRUE@libzmq_la_DEPENDENCIES = \
@BUILD_PGM_TRUE@ $(top_srcdir)/@pgm_srcdir@/libpgm_noinst.la
am_libzmq_la_OBJECTS = libzmq_la-address.lo libzmq_la-clock.lo \
- libzmq_la-ctx.lo libzmq_la-decoder.lo libzmq_la-devpoll.lo \
- libzmq_la-dist.lo libzmq_la-encoder.lo libzmq_la-epoll.lo \
- libzmq_la-err.lo libzmq_la-fq.lo libzmq_la-io_object.lo \
- libzmq_la-io_thread.lo libzmq_la-ip.lo \
- libzmq_la-ipc_address.lo libzmq_la-ipc_connecter.lo \
- libzmq_la-ipc_listener.lo libzmq_la-kqueue.lo libzmq_la-lb.lo \
- libzmq_la-mailbox.lo libzmq_la-msg.lo libzmq_la-mtrie.lo \
- libzmq_la-object.lo libzmq_la-options.lo libzmq_la-own.lo \
- libzmq_la-pair.lo libzmq_la-pgm_receiver.lo \
- libzmq_la-pgm_sender.lo libzmq_la-pgm_socket.lo \
- libzmq_la-pipe.lo libzmq_la-poll.lo libzmq_la-poller_base.lo \
- libzmq_la-pull.lo libzmq_la-push.lo libzmq_la-proxy.lo \
- libzmq_la-reaper.lo libzmq_la-pub.lo libzmq_la-random.lo \
- libzmq_la-rep.lo libzmq_la-req.lo libzmq_la-select.lo \
- libzmq_la-session_base.lo libzmq_la-signaler.lo \
- libzmq_la-socket_base.lo libzmq_la-stream_engine.lo \
+ libzmq_la-ctx.lo libzmq_la-curve_client.lo \
+ libzmq_la-curve_server.lo libzmq_la-devpoll.lo \
+ libzmq_la-dist.lo libzmq_la-epoll.lo libzmq_la-err.lo \
+ libzmq_la-fq.lo libzmq_la-io_object.lo libzmq_la-io_thread.lo \
+ libzmq_la-ip.lo libzmq_la-ipc_address.lo \
+ libzmq_la-ipc_connecter.lo libzmq_la-ipc_listener.lo \
+ libzmq_la-kqueue.lo libzmq_la-lb.lo libzmq_la-mailbox.lo \
+ libzmq_la-mechanism.lo libzmq_la-msg.lo libzmq_la-mtrie.lo \
+ libzmq_la-null_mechanism.lo libzmq_la-object.lo \
+ libzmq_la-options.lo libzmq_la-own.lo libzmq_la-pair.lo \
+ libzmq_la-pgm_receiver.lo libzmq_la-pgm_sender.lo \
+ libzmq_la-pgm_socket.lo libzmq_la-pipe.lo \
+ libzmq_la-plain_mechanism.lo libzmq_la-poll.lo \
+ libzmq_la-poller_base.lo libzmq_la-pull.lo libzmq_la-push.lo \
+ libzmq_la-proxy.lo libzmq_la-reaper.lo libzmq_la-pub.lo \
+ libzmq_la-random.lo libzmq_la-rep.lo libzmq_la-req.lo \
+ libzmq_la-select.lo libzmq_la-session_base.lo \
+ libzmq_la-signaler.lo libzmq_la-socket_base.lo \
+ libzmq_la-stream.lo libzmq_la-stream_engine.lo \
libzmq_la-sub.lo libzmq_la-tcp.lo libzmq_la-tcp_address.lo \
libzmq_la-tcp_connecter.lo libzmq_la-tcp_listener.lo \
libzmq_la-thread.lo libzmq_la-trie.lo libzmq_la-xpub.lo \
libzmq_la-router.lo libzmq_la-dealer.lo \
libzmq_la-v1_decoder.lo libzmq_la-v1_encoder.lo \
- libzmq_la-xsub.lo libzmq_la-zmq.lo libzmq_la-zmq_utils.lo
+ libzmq_la-v2_decoder.lo libzmq_la-v2_encoder.lo \
+ libzmq_la-xsub.lo libzmq_la-zmq.lo libzmq_la-zmq_utils.lo \
+ libzmq_la-raw_decoder.lo libzmq_la-raw_encoder.lo
libzmq_la_OBJECTS = $(am_libzmq_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
command.hpp \
config.hpp \
ctx.hpp \
+ curve_client.hpp \
+ curve_server.hpp \
decoder.hpp \
devpoll.hpp \
dist.hpp \
i_encoder.hpp \
i_decoder.hpp \
i_engine.hpp \
- i_msg_sink.hpp \
- i_msg_source.hpp \
i_poll_events.hpp \
io_object.hpp \
io_thread.hpp \
lb.hpp \
likely.hpp \
mailbox.hpp \
+ mechanism.hpp \
msg.hpp \
mtrie.hpp \
mutex.hpp \
+ null_mechanism.hpp \
object.hpp \
options.hpp \
own.hpp \
pgm_sender.hpp \
pgm_socket.hpp \
pipe.hpp \
+ plain_mechanism.hpp \
platform.hpp \
poll.hpp \
poller.hpp \
signaler.hpp \
socket_base.hpp \
stdint.hpp \
+ stream.hpp \
stream_engine.hpp \
sub.hpp \
tcp.hpp \
dealer.hpp \
xsub.hpp \
ypipe.hpp \
+ ypipe_base.hpp \
yqueue.hpp \
address.cpp \
clock.cpp \
ctx.cpp \
- decoder.cpp \
+ curve_client.cpp \
+ curve_server.cpp \
devpoll.cpp \
dist.cpp \
- encoder.cpp \
epoll.cpp \
err.cpp \
fq.cpp \
kqueue.cpp \
lb.cpp \
mailbox.cpp \
+ mechanism.cpp \
msg.cpp \
mtrie.cpp \
+ null_mechanism.cpp \
object.cpp \
options.cpp \
own.cpp \
pgm_sender.cpp \
pgm_socket.cpp \
pipe.cpp \
+ plain_mechanism.cpp \
poll.cpp \
poller_base.cpp \
pull.cpp \
session_base.cpp \
signaler.cpp \
socket_base.cpp \
+ stream.cpp \
stream_engine.cpp \
sub.cpp \
tcp.cpp \
router.cpp \
dealer.cpp \
v1_decoder.cpp \
- v1_decoder.hpp \
v1_encoder.cpp \
+ v1_decoder.hpp \
v1_encoder.hpp \
- v1_protocol.hpp \
+ v2_decoder.cpp \
+ v2_decoder.hpp \
+ v2_encoder.cpp \
+ v2_encoder.hpp \
+ v2_protocol.hpp \
xsub.cpp \
zmq.cpp \
- zmq_utils.cpp
-
-@ON_ANDROID_FALSE@@ON_MINGW_FALSE@libzmq_la_LDFLAGS = -version-info @LTVER@ @LIBZMQ_EXTRA_LDFLAGS@
+ zmq_utils.cpp \
+ raw_decoder.hpp \
+ raw_decoder.cpp \
+ raw_encoder.hpp \
+ raw_encoder.cpp \
+ ypipe_conflate.hpp \
+ dbuffer.hpp
+
+@ON_ANDROID_FALSE@@ON_LINUX_FALSE@@ON_MINGW_FALSE@libzmq_la_LDFLAGS = -version-info @LTVER@ @LIBZMQ_EXTRA_LDFLAGS@ -Wl
+@ON_ANDROID_FALSE@@ON_LINUX_TRUE@@ON_MINGW_FALSE@libzmq_la_LDFLAGS = -version-info @LTVER@ @LIBZMQ_EXTRA_LDFLAGS@ -Wl,--version-script=$(srcdir)/libzmq.vers
@ON_ANDROID_TRUE@@ON_MINGW_FALSE@libzmq_la_LDFLAGS = -avoid-version -version-info @LTVER@ @LIBZMQ_EXTRA_LDFLAGS@
@ON_MINGW_TRUE@libzmq_la_LDFLAGS = -no-undefined -avoid-version -version-info @LTVER@ @LIBZMQ_EXTRA_LDFLAGS@
+EXTRA_DIST = libzmq.vers
libzmq_la_CXXFLAGS = @LIBZMQ_EXTRA_CXXFLAGS@
@BUILD_PGM_TRUE@libzmq_la_CPPFLAGS = -I$(top_srcdir)/@pgm_srcdir@/include/
@BUILD_PGM_TRUE@libzmq_la_LIBADD = $(top_srcdir)/@pgm_srcdir@/libpgm_noinst.la
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-address.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-clock.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-ctx.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-curve_client.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-curve_server.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-dealer.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-decoder.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-devpoll.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-dist.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-encoder.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-epoll.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-err.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-fq.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-kqueue.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-lb.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-mailbox.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-mechanism.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-msg.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-mtrie.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-null_mechanism.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-object.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-options.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-own.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-pgm_sender.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-pgm_socket.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-pipe.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-plain_mechanism.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-poll.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-poller_base.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-proxy.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-pull.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-push.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-random.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-raw_decoder.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-raw_encoder.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-reaper.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-rep.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-req.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-session_base.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-signaler.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-socket_base.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-stream.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-stream_engine.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-sub.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-tcp.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-trie.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-v1_decoder.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-v1_encoder.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-v2_decoder.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-v2_encoder.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-xpub.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-xsub.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libzmq_la-zmq.Plo@am__quote@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libzmq_la_CPPFLAGS) $(CPPFLAGS) $(libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o libzmq_la-ctx.lo `test -f 'ctx.cpp' || echo '$(srcdir)/'`ctx.cpp
-libzmq_la-decoder.lo: decoder.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libzmq_la_CPPFLAGS) $(CPPFLAGS) $(libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT libzmq_la-decoder.lo -MD -MP -MF $(DEPDIR)/libzmq_la-decoder.Tpo -c -o libzmq_la-decoder.lo `test -f 'decoder.cpp' || echo '$(srcdir)/'`decoder.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libzmq_la-decoder.Tpo $(DEPDIR)/libzmq_la-decoder.Plo
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='decoder.cpp' object='libzmq_la-decoder.lo' libtool=yes @AMDEPBACKSLASH@
+libzmq_la-curve_client.lo: curve_client.cpp
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libzmq_la_CPPFLAGS) $(CPPFLAGS) $(libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT libzmq_la-curve_client.lo -MD -MP -MF $(DEPDIR)/libzmq_la-curve_client.Tpo -c -o libzmq_la-curve_client.lo `test -f 'curve_client.cpp' || echo '$(srcdir)/'`curve_client.cpp
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libzmq_la-curve_client.Tpo $(DEPDIR)/libzmq_la-curve_client.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='curve_client.cpp' object='libzmq_la-curve_client.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libzmq_la_CPPFLAGS) $(CPPFLAGS) $(libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o libzmq_la-decoder.lo `test -f 'decoder.cpp' || echo '$(srcdir)/'`decoder.cpp
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libzmq_la_CPPFLAGS) $(CPPFLAGS) $(libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o libzmq_la-curve_client.lo `test -f 'curve_client.cpp' || echo '$(srcdir)/'`curve_client.cpp
+
+libzmq_la-curve_server.lo: curve_server.cpp
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libzmq_la_CPPFLAGS) $(CPPFLAGS) $(libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT libzmq_la-curve_server.lo -MD -MP -MF $(DEPDIR)/libzmq_la-curve_server.Tpo -c -o libzmq_la-curve_server.lo `test -f 'curve_server.cpp' || echo '$(srcdir)/'`curve_server.cpp
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libzmq_la-curve_server.Tpo $(DEPDIR)/libzmq_la-curve_server.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='curve_server.cpp' object='libzmq_la-curve_server.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libzmq_la_CPPFLAGS) $(CPPFLAGS) $(libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o libzmq_la-curve_server.lo `test -f 'curve_server.cpp' || echo '$(srcdir)/'`curve_server.cpp
libzmq_la-devpoll.lo: devpoll.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libzmq_la_CPPFLAGS) $(CPPFLAGS) $(libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT libzmq_la-devpoll.lo -MD -MP -MF $(DEPDIR)/libzmq_la-devpoll.Tpo -c -o libzmq_la-devpoll.lo `test -f 'devpoll.cpp' || echo '$(srcdir)/'`devpoll.cpp
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libzmq_la_CPPFLAGS) $(CPPFLAGS) $(libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o libzmq_la-dist.lo `test -f 'dist.cpp' || echo '$(srcdir)/'`dist.cpp
-libzmq_la-encoder.lo: encoder.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libzmq_la_CPPFLAGS) $(CPPFLAGS) $(libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT libzmq_la-encoder.lo -MD -MP -MF $(DEPDIR)/libzmq_la-encoder.Tpo -c -o libzmq_la-encoder.lo `test -f 'encoder.cpp' || echo '$(srcdir)/'`encoder.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libzmq_la-encoder.Tpo $(DEPDIR)/libzmq_la-encoder.Plo
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='encoder.cpp' object='libzmq_la-encoder.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libzmq_la_CPPFLAGS) $(CPPFLAGS) $(libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o libzmq_la-encoder.lo `test -f 'encoder.cpp' || echo '$(srcdir)/'`encoder.cpp
-
libzmq_la-epoll.lo: epoll.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libzmq_la_CPPFLAGS) $(CPPFLAGS) $(libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT libzmq_la-epoll.lo -MD -MP -MF $(DEPDIR)/libzmq_la-epoll.Tpo -c -o libzmq_la-epoll.lo `test -f 'epoll.cpp' || echo '$(srcdir)/'`epoll.cpp
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libzmq_la-epoll.Tpo $(DEPDIR)/libzmq_la-epoll.Plo
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libzmq_la_CPPFLAGS) $(CPPFLAGS) $(libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o libzmq_la-mailbox.lo `test -f 'mailbox.cpp' || echo '$(srcdir)/'`mailbox.cpp
+libzmq_la-mechanism.lo: mechanism.cpp
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libzmq_la_CPPFLAGS) $(CPPFLAGS) $(libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT libzmq_la-mechanism.lo -MD -MP -MF $(DEPDIR)/libzmq_la-mechanism.Tpo -c -o libzmq_la-mechanism.lo `test -f 'mechanism.cpp' || echo '$(srcdir)/'`mechanism.cpp
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libzmq_la-mechanism.Tpo $(DEPDIR)/libzmq_la-mechanism.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='mechanism.cpp' object='libzmq_la-mechanism.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libzmq_la_CPPFLAGS) $(CPPFLAGS) $(libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o libzmq_la-mechanism.lo `test -f 'mechanism.cpp' || echo '$(srcdir)/'`mechanism.cpp
+
libzmq_la-msg.lo: msg.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libzmq_la_CPPFLAGS) $(CPPFLAGS) $(libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT libzmq_la-msg.lo -MD -MP -MF $(DEPDIR)/libzmq_la-msg.Tpo -c -o libzmq_la-msg.lo `test -f 'msg.cpp' || echo '$(srcdir)/'`msg.cpp
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libzmq_la-msg.Tpo $(DEPDIR)/libzmq_la-msg.Plo
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libzmq_la_CPPFLAGS) $(CPPFLAGS) $(libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o libzmq_la-mtrie.lo `test -f 'mtrie.cpp' || echo '$(srcdir)/'`mtrie.cpp
+libzmq_la-null_mechanism.lo: null_mechanism.cpp
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libzmq_la_CPPFLAGS) $(CPPFLAGS) $(libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT libzmq_la-null_mechanism.lo -MD -MP -MF $(DEPDIR)/libzmq_la-null_mechanism.Tpo -c -o libzmq_la-null_mechanism.lo `test -f 'null_mechanism.cpp' || echo '$(srcdir)/'`null_mechanism.cpp
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libzmq_la-null_mechanism.Tpo $(DEPDIR)/libzmq_la-null_mechanism.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='null_mechanism.cpp' object='libzmq_la-null_mechanism.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libzmq_la_CPPFLAGS) $(CPPFLAGS) $(libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o libzmq_la-null_mechanism.lo `test -f 'null_mechanism.cpp' || echo '$(srcdir)/'`null_mechanism.cpp
+
libzmq_la-object.lo: object.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libzmq_la_CPPFLAGS) $(CPPFLAGS) $(libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT libzmq_la-object.lo -MD -MP -MF $(DEPDIR)/libzmq_la-object.Tpo -c -o libzmq_la-object.lo `test -f 'object.cpp' || echo '$(srcdir)/'`object.cpp
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libzmq_la-object.Tpo $(DEPDIR)/libzmq_la-object.Plo
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libzmq_la_CPPFLAGS) $(CPPFLAGS) $(libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o libzmq_la-pipe.lo `test -f 'pipe.cpp' || echo '$(srcdir)/'`pipe.cpp
+libzmq_la-plain_mechanism.lo: plain_mechanism.cpp
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libzmq_la_CPPFLAGS) $(CPPFLAGS) $(libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT libzmq_la-plain_mechanism.lo -MD -MP -MF $(DEPDIR)/libzmq_la-plain_mechanism.Tpo -c -o libzmq_la-plain_mechanism.lo `test -f 'plain_mechanism.cpp' || echo '$(srcdir)/'`plain_mechanism.cpp
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libzmq_la-plain_mechanism.Tpo $(DEPDIR)/libzmq_la-plain_mechanism.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='plain_mechanism.cpp' object='libzmq_la-plain_mechanism.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libzmq_la_CPPFLAGS) $(CPPFLAGS) $(libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o libzmq_la-plain_mechanism.lo `test -f 'plain_mechanism.cpp' || echo '$(srcdir)/'`plain_mechanism.cpp
+
libzmq_la-poll.lo: poll.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libzmq_la_CPPFLAGS) $(CPPFLAGS) $(libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT libzmq_la-poll.lo -MD -MP -MF $(DEPDIR)/libzmq_la-poll.Tpo -c -o libzmq_la-poll.lo `test -f 'poll.cpp' || echo '$(srcdir)/'`poll.cpp
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libzmq_la-poll.Tpo $(DEPDIR)/libzmq_la-poll.Plo
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libzmq_la_CPPFLAGS) $(CPPFLAGS) $(libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o libzmq_la-socket_base.lo `test -f 'socket_base.cpp' || echo '$(srcdir)/'`socket_base.cpp
+libzmq_la-stream.lo: stream.cpp
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libzmq_la_CPPFLAGS) $(CPPFLAGS) $(libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT libzmq_la-stream.lo -MD -MP -MF $(DEPDIR)/libzmq_la-stream.Tpo -c -o libzmq_la-stream.lo `test -f 'stream.cpp' || echo '$(srcdir)/'`stream.cpp
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libzmq_la-stream.Tpo $(DEPDIR)/libzmq_la-stream.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='stream.cpp' object='libzmq_la-stream.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libzmq_la_CPPFLAGS) $(CPPFLAGS) $(libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o libzmq_la-stream.lo `test -f 'stream.cpp' || echo '$(srcdir)/'`stream.cpp
+
libzmq_la-stream_engine.lo: stream_engine.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libzmq_la_CPPFLAGS) $(CPPFLAGS) $(libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT libzmq_la-stream_engine.lo -MD -MP -MF $(DEPDIR)/libzmq_la-stream_engine.Tpo -c -o libzmq_la-stream_engine.lo `test -f 'stream_engine.cpp' || echo '$(srcdir)/'`stream_engine.cpp
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libzmq_la-stream_engine.Tpo $(DEPDIR)/libzmq_la-stream_engine.Plo
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libzmq_la_CPPFLAGS) $(CPPFLAGS) $(libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o libzmq_la-v1_encoder.lo `test -f 'v1_encoder.cpp' || echo '$(srcdir)/'`v1_encoder.cpp
+libzmq_la-v2_decoder.lo: v2_decoder.cpp
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libzmq_la_CPPFLAGS) $(CPPFLAGS) $(libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT libzmq_la-v2_decoder.lo -MD -MP -MF $(DEPDIR)/libzmq_la-v2_decoder.Tpo -c -o libzmq_la-v2_decoder.lo `test -f 'v2_decoder.cpp' || echo '$(srcdir)/'`v2_decoder.cpp
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libzmq_la-v2_decoder.Tpo $(DEPDIR)/libzmq_la-v2_decoder.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='v2_decoder.cpp' object='libzmq_la-v2_decoder.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libzmq_la_CPPFLAGS) $(CPPFLAGS) $(libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o libzmq_la-v2_decoder.lo `test -f 'v2_decoder.cpp' || echo '$(srcdir)/'`v2_decoder.cpp
+
+libzmq_la-v2_encoder.lo: v2_encoder.cpp
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libzmq_la_CPPFLAGS) $(CPPFLAGS) $(libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT libzmq_la-v2_encoder.lo -MD -MP -MF $(DEPDIR)/libzmq_la-v2_encoder.Tpo -c -o libzmq_la-v2_encoder.lo `test -f 'v2_encoder.cpp' || echo '$(srcdir)/'`v2_encoder.cpp
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libzmq_la-v2_encoder.Tpo $(DEPDIR)/libzmq_la-v2_encoder.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='v2_encoder.cpp' object='libzmq_la-v2_encoder.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libzmq_la_CPPFLAGS) $(CPPFLAGS) $(libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o libzmq_la-v2_encoder.lo `test -f 'v2_encoder.cpp' || echo '$(srcdir)/'`v2_encoder.cpp
+
libzmq_la-xsub.lo: xsub.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libzmq_la_CPPFLAGS) $(CPPFLAGS) $(libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT libzmq_la-xsub.lo -MD -MP -MF $(DEPDIR)/libzmq_la-xsub.Tpo -c -o libzmq_la-xsub.lo `test -f 'xsub.cpp' || echo '$(srcdir)/'`xsub.cpp
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libzmq_la-xsub.Tpo $(DEPDIR)/libzmq_la-xsub.Plo
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libzmq_la_CPPFLAGS) $(CPPFLAGS) $(libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o libzmq_la-zmq_utils.lo `test -f 'zmq_utils.cpp' || echo '$(srcdir)/'`zmq_utils.cpp
+libzmq_la-raw_decoder.lo: raw_decoder.cpp
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libzmq_la_CPPFLAGS) $(CPPFLAGS) $(libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT libzmq_la-raw_decoder.lo -MD -MP -MF $(DEPDIR)/libzmq_la-raw_decoder.Tpo -c -o libzmq_la-raw_decoder.lo `test -f 'raw_decoder.cpp' || echo '$(srcdir)/'`raw_decoder.cpp
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libzmq_la-raw_decoder.Tpo $(DEPDIR)/libzmq_la-raw_decoder.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='raw_decoder.cpp' object='libzmq_la-raw_decoder.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libzmq_la_CPPFLAGS) $(CPPFLAGS) $(libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o libzmq_la-raw_decoder.lo `test -f 'raw_decoder.cpp' || echo '$(srcdir)/'`raw_decoder.cpp
+
+libzmq_la-raw_encoder.lo: raw_encoder.cpp
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libzmq_la_CPPFLAGS) $(CPPFLAGS) $(libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT libzmq_la-raw_encoder.lo -MD -MP -MF $(DEPDIR)/libzmq_la-raw_encoder.Tpo -c -o libzmq_la-raw_encoder.lo `test -f 'raw_encoder.cpp' || echo '$(srcdir)/'`raw_encoder.cpp
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libzmq_la-raw_encoder.Tpo $(DEPDIR)/libzmq_la-raw_encoder.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='raw_encoder.cpp' object='libzmq_la-raw_encoder.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libzmq_la_CPPFLAGS) $(CPPFLAGS) $(libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o libzmq_la-raw_encoder.lo `test -f 'raw_encoder.cpp' || echo '$(srcdir)/'`raw_encoder.cpp
+
mostlyclean-libtool:
-rm -f *.lo
/*
- Copyright (c) 2012 Spotify AB
- Copyright (c) 2012 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
}
}
#if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_OPENVMS
- else if (protocol == "ipc") {
+ else
+ if (protocol == "ipc") {
if (resolved.ipc_addr) {
delete resolved.ipc_addr;
resolved.ipc_addr = 0;
int zmq::address_t::to_string (std::string &addr_) const
{
if (protocol == "tcp") {
- if (resolved.tcp_addr) {
+ if (resolved.tcp_addr)
return resolved.tcp_addr->to_string(addr_);
- }
}
#if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_OPENVMS
- else if (protocol == "ipc") {
- if (resolved.ipc_addr) {
+ else
+ if (protocol == "ipc") {
+ if (resolved.ipc_addr)
return resolved.ipc_addr->to_string(addr_);
- }
}
#endif
/*
- Copyright (c) 2012 Spotify AB
- Copyright (c) 2012 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
#define ZMQ_ATOMIC_COUNTER_WINDOWS
#elif (defined ZMQ_HAVE_SOLARIS || defined ZMQ_HAVE_NETBSD)
#define ZMQ_ATOMIC_COUNTER_ATOMIC_H
+#elif defined __tile__
+#define ZMQ_ATOMIC_COUNTER_TILE
#else
#define ZMQ_ATOMIC_COUNTER_MUTEX
#endif
#include "windows.hpp"
#elif defined ZMQ_ATOMIC_COUNTER_ATOMIC_H
#include <atomic.h>
+#elif defined ZMQ_ATOMIC_COUNTER_TILE
+#include <arch/atomic.h>
#endif
namespace zmq
#elif defined ZMQ_ATOMIC_COUNTER_ATOMIC_H
integer_t new_value = atomic_add_32_nv (&value, increment_);
old_value = new_value - increment_;
+#elif defined ZMQ_ATOMIC_COUNTER_TILE
+ old_value = arch_atomic_add (&value, increment_);
#elif defined ZMQ_ATOMIC_COUNTER_X86
__asm__ volatile (
"lock; xadd %0, %1 \n\t"
int32_t delta = - ((int32_t) decrement);
integer_t nv = atomic_add_32_nv (&value, delta);
return nv != 0;
+#elif defined ZMQ_ATOMIC_COUNTER_TILE
+ int32_t delta = - ((int32_t) decrement);
+ integer_t nv = arch_atomic_add (&value, delta);
+ return nv != 0;
#elif defined ZMQ_ATOMIC_COUNTER_X86
integer_t oldval = -decrement;
volatile integer_t *val = &value;
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
#define ZMQ_ATOMIC_PTR_X86
#elif defined __ARM_ARCH_7A__ && defined __GNUC__
#define ZMQ_ATOMIC_PTR_ARM
+#elif defined __tile__
+#define ZMQ_ATOMIC_PTR_TILE
#elif defined ZMQ_HAVE_WINDOWS
#define ZMQ_ATOMIC_PTR_WINDOWS
#elif (defined ZMQ_HAVE_SOLARIS || defined ZMQ_HAVE_NETBSD)
#include "windows.hpp"
#elif defined ZMQ_ATOMIC_PTR_ATOMIC_H
#include <atomic.h>
+#elif defined ZMQ_ATOMIC_PTR_TILE
+#include <arch/atomic.h>
#endif
namespace zmq
return (T*) InterlockedExchangePointer ((PVOID*) &ptr, val_);
#elif defined ZMQ_ATOMIC_PTR_ATOMIC_H
return (T*) atomic_swap_ptr (&ptr, val_);
+#elif defined ZMQ_ATOMIC_PTR_TILE
+ return (T*) arch_atomic_exchange (&ptr, val_);
#elif defined ZMQ_ATOMIC_PTR_X86
T *old;
__asm__ volatile (
(volatile PVOID*) &ptr, val_, cmp_);
#elif defined ZMQ_ATOMIC_PTR_ATOMIC_H
return (T*) atomic_cas_ptr (&ptr, cmp_, val_);
+#elif defined ZMQ_ATOMIC_PTR_TILE
+ return (T*) arch_atomic_val_compare_and_exchange (&ptr, cmp_, val_);
#elif defined ZMQ_ATOMIC_PTR_X86
T *old;
__asm__ volatile (
/*
- Copyright (c) 2010 250bpm s.r.o.
- Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
#define __ZMQ_BLOB_HPP_INCLUDED__
#include <string>
+#include <string.h>
// Borrowed from id3lib_strings.h:
// They seem to be doing something for MSC, but since I only have gcc, I'll just do that
/*
- Copyright (c) 2010-2011 250bpm s.r.o.
- Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
#include "likely.hpp"
#include "config.hpp"
#include "err.hpp"
+#include "mutex.hpp"
#include <stddef.h>
#if defined _MSC_VER
-#if defined WINCE
+#if defined _WIN32_WCE
#include <cmnintrin.h>
#else
#include <intrin.h>
#include <time.h>
#endif
+#ifdef ZMQ_HAVE_WINDOWS
+typedef ULONGLONG (*f_compatible_get_tick_count64)();
+
+static zmq::mutex_t compatible_get_tick_count64_mutex;
+
+ULONGLONG compatible_get_tick_count64()
+{
+ compatible_get_tick_count64_mutex.lock();
+ static DWORD s_wrap = 0;
+ static DWORD s_last_tick = 0;
+ const DWORD current_tick = ::GetTickCount();
+ if (current_tick < s_last_tick)
+ ++s_wrap;
+
+ s_last_tick = current_tick;
+ const ULONGLONG result = (static_cast<ULONGLONG>(s_wrap) << 32) + static_cast<ULONGLONG>(current_tick);
+ compatible_get_tick_count64_mutex.unlock();
+ return result;
+}
+
+f_compatible_get_tick_count64 init_compatible_get_tick_count64()
+{
+ f_compatible_get_tick_count64 func = NULL;
+ HMODULE module = ::LoadLibraryA("Kernel32.dll");
+ if (module != NULL)
+ func = reinterpret_cast<f_compatible_get_tick_count64>(::GetProcAddress(module, "GetTickCount64"));
+
+ if (func == NULL)
+ func = compatible_get_tick_count64;
+
+ return func;
+}
+
+static f_compatible_get_tick_count64 my_get_tick_count64 = init_compatible_get_tick_count64();
+#endif
+
zmq::clock_t::clock_t () :
last_tsc (rdtsc ()),
+#ifdef ZMQ_HAVE_WINDOWS
+ last_time (static_cast<uint64_t>((*my_get_tick_count64)()))
+#else
last_time (now_us () / 1000)
+#endif
{
}
// Convert the tick number into the number of seconds
// since the system was started.
- double ticks_div = (double) (ticksPerSecond.QuadPart / 1000000);
+ double ticks_div = ticksPerSecond.QuadPart / 1000000.0;
return (uint64_t) (tick.QuadPart / ticks_div);
#elif defined HAVE_CLOCK_GETTIME && defined CLOCK_MONOTONIC
struct timespec tv;
int rc = clock_gettime (CLOCK_MONOTONIC, &tv);
// Fix case where system has clock_gettime but CLOCK_MONOTONIC is not supported.
- // This should be a configuration check, but I looked into it and writing an
+ // This should be a configuration check, but I looked into it and writing an
// AC_FUNC_CLOCK_MONOTONIC seems beyond my powers.
if( rc != 0) {
// Use POSIX gettimeofday function to get precise time.
// If TSC is not supported, get precise time and chop off the microseconds.
if (!tsc)
+ {
+#ifdef ZMQ_HAVE_WINDOWS
+ // Under Windows, now_us is not so reliable since QueryPerformanceCounter
+ // does not guarantee that it will use a hardware that offers a monotonic timer.
+ // So, lets use GetTickCount when GetTickCount64 is not available with an workaround
+ // to its 32 bit limitation.
+ return static_cast<uint64_t>((*my_get_tick_count64)());
+#else
return now_us () / 1000;
+#endif
+ }
// If TSC haven't jumped back (in case of migration to a different
// CPU core) and if not too much time elapsed since last measurement,
return last_time;
last_tsc = tsc;
+#ifdef ZMQ_HAVE_WINDOWS
+ last_time = static_cast<uint64_t>((*my_get_tick_count64)());
+#else
last_time = now_us () / 1000;
+#endif
return last_time;
}
#elif defined(__s390__)
uint64_t tsc;
asm("\tstck\t%0\n" : "=Q" (tsc) : : "cc");
- tsc >>= 12; /* convert to microseconds just to be consistent */
return(tsc);
#else
return 0;
/*
- Copyright (c) 2010-2011 250bpm s.r.o.
- Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
term_ack,
reap,
reaped,
+ inproc_connected,
done
} type;
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
/*
- Copyright (c) 2007-2012 iMatix Corporation
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2014 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
#include "err.hpp"
#include "msg.hpp"
+#define ZMQ_CTX_TAG_VALUE_GOOD 0xabadcafe
+#define ZMQ_CTX_TAG_VALUE_BAD 0xdeadbeef
+
+int clipped_maxsocket(int max_requested)
+{
+ if (max_requested >= zmq::poller_t::max_fds () && zmq::poller_t::max_fds () != -1)
+ max_requested = zmq::poller_t::max_fds () - 1; // -1 because we need room for the repear mailbox.
+
+ return max_requested;
+}
+
zmq::ctx_t::ctx_t () :
- tag (0xabadcafe),
+ tag (ZMQ_CTX_TAG_VALUE_GOOD),
starting (true),
terminating (false),
reaper (NULL),
slot_count (0),
slots (NULL),
- max_sockets (ZMQ_MAX_SOCKETS_DFLT),
- io_thread_count (ZMQ_IO_THREADS_DFLT)
+ max_sockets (clipped_maxsocket (ZMQ_MAX_SOCKETS_DFLT)),
+ io_thread_count (ZMQ_IO_THREADS_DFLT),
+ ipv6 (false)
{
+#ifdef HAVE_FORK
+ pid = getpid();
+#endif
}
bool zmq::ctx_t::check_tag ()
{
- return tag == 0xabadcafe;
+ return tag == ZMQ_CTX_TAG_VALUE_GOOD;
}
zmq::ctx_t::~ctx_t ()
delete io_threads [i];
// Deallocate the reaper thread object.
- if (reaper)
- delete reaper;
+ delete reaper;
// Deallocate the array of mailboxes. No special work is
// needed as mailboxes themselves were deallocated with their
// corresponding io_thread/socket objects.
- if (slots)
- free (slots);
+ free (slots);
// Remove the tag, so that the object is considered dead.
- tag = 0xdeadbeef;
+ tag = ZMQ_CTX_TAG_VALUE_BAD;
}
int zmq::ctx_t::terminate ()
{
+ // Connect up any pending inproc connections, otherwise we will hang
+ pending_connections_t copy = pending_connections;
+ for (pending_connections_t::iterator p = copy.begin (); p != copy.end (); ++p) {
+ zmq::socket_base_t *s = create_socket (ZMQ_PAIR);
+ s->bind (p->first.c_str ());
+ s->close ();
+ }
+
slot_sync.lock ();
if (!starting) {
+#ifdef HAVE_FORK
+ if (pid != getpid())
+ {
+ // we are a forked child process. Close all file descriptors
+ // inherited from the parent.
+ for (sockets_t::size_type i = 0; i != sockets.size (); i++)
+ {
+ sockets[i]->get_mailbox()->forked();
+ }
+
+ term_mailbox.forked();
+ }
+#endif
// Check whether termination was already underway, but interrupted and now
// restarted.
bool restarted = terminating;
terminating = true;
- slot_sync.unlock ();
// First attempt to terminate the context.
if (!restarted) {
// First send stop command to sockets so that any blocking calls
// can be interrupted. If there are no sockets we can ask reaper
// thread to stop.
- slot_sync.lock ();
for (sockets_t::size_type i = 0; i != sockets.size (); i++)
sockets [i]->stop ();
if (sockets.empty ())
reaper->stop ();
- slot_sync.unlock ();
}
+ slot_sync.unlock();
// Wait till reaper thread closes all the sockets.
command_t cmd;
return 0;
}
+int zmq::ctx_t::shutdown ()
+{
+ slot_sync.lock ();
+ if (!starting && !terminating) {
+ terminating = true;
+
+ // Send stop command to sockets so that any blocking calls
+ // can be interrupted. If there are no sockets we can ask reaper
+ // thread to stop.
+ for (sockets_t::size_type i = 0; i != sockets.size (); i++)
+ sockets [i]->stop ();
+ if (sockets.empty ())
+ reaper->stop ();
+ }
+ slot_sync.unlock ();
+
+ return 0;
+}
+
int zmq::ctx_t::set (int option_, int optval_)
{
int rc = 0;
- if (option_ == ZMQ_MAX_SOCKETS && optval_ >= 1) {
+ if (option_ == ZMQ_MAX_SOCKETS && optval_ >= 1 && optval_ == clipped_maxsocket (optval_)) {
opt_sync.lock ();
max_sockets = optval_;
opt_sync.unlock ();
io_thread_count = optval_;
opt_sync.unlock ();
}
+ else
+ if (option_ == ZMQ_IPV6 && optval_ >= 0) {
+ opt_sync.lock ();
+ ipv6 = (optval_ != 0);
+ opt_sync.unlock ();
+ }
else {
errno = EINVAL;
rc = -1;
else
if (option_ == ZMQ_IO_THREADS)
rc = io_thread_count;
+ else
+ if (option_ == ZMQ_IPV6)
+ rc = ipv6;
else {
errno = EINVAL;
rc = -1;
starting = false;
// Initialise the array of mailboxes. Additional three slots are for
- // zmq_term thread and reaper thread.
+ // zmq_ctx_term thread and reaper thread.
opt_sync.lock ();
int mazmq = max_sockets;
int ios = io_thread_count;
slots = (mailbox_t**) malloc (sizeof (mailbox_t*) * slot_count);
alloc_assert (slots);
- // Initialise the infrastructure for zmq_term thread.
+ // Initialise the infrastructure for zmq_ctx_term thread.
slots [term_tid] = &term_mailbox;
// Create the reaper thread.
}
}
- // Once zmq_term() was called, we can't create new sockets.
+ // Once zmq_ctx_term() was called, we can't create new sockets.
if (terminating) {
slot_sync.unlock ();
errno = ETERM;
// Remove the socket from the list of sockets.
sockets.erase (socket_);
- // If zmq_term() was already called and there are no more socket
+ // If zmq_ctx_term() was already called and there are no more socket
// we can ask reaper thread to terminate.
if (terminating && sockets.empty ())
reaper->stop ();
return endpoint;
}
+void zmq::ctx_t::pend_connection (const char *addr_, pending_connection_t &pending_connection_)
+{
+ endpoints_sync.lock ();
+
+ endpoints_t::iterator it = endpoints.find (addr_);
+ if (it == endpoints.end ())
+ {
+ // Still no bind.
+ pending_connection_.endpoint.socket->inc_seqnum ();
+ pending_connections.insert (pending_connections_t::value_type (std::string (addr_), pending_connection_));
+ }
+ else
+ {
+ // Bind has happened in the mean time, connect directly
+ connect_inproc_sockets(it->second.socket, it->second.options, pending_connection_, connect_side);
+ }
+
+ endpoints_sync.unlock ();
+}
+
+void zmq::ctx_t::connect_pending (const char *addr_, zmq::socket_base_t *bind_socket_)
+{
+ endpoints_sync.lock ();
+
+ std::pair<pending_connections_t::iterator, pending_connections_t::iterator> pending = pending_connections.equal_range(addr_);
+
+ for (pending_connections_t::iterator p = pending.first; p != pending.second; ++p)
+ {
+ connect_inproc_sockets(bind_socket_, endpoints[addr_].options, p->second, bind_side);
+ }
+
+ pending_connections.erase(pending.first, pending.second);
+
+ endpoints_sync.unlock ();
+}
+
+void zmq::ctx_t::connect_inproc_sockets(zmq::socket_base_t *bind_socket_, options_t& bind_options, pending_connection_t &pending_connection_, side side_)
+{
+ bind_socket_->inc_seqnum();
+ pending_connection_.bind_pipe->set_tid(bind_socket_->get_tid());
+
+ if (side_ == bind_side)
+ {
+ command_t cmd;
+ cmd.type = command_t::bind;
+ cmd.args.bind.pipe = pending_connection_.bind_pipe;
+ bind_socket_->process_command(cmd);
+ bind_socket_->send_inproc_connected(pending_connection_.endpoint.socket);
+ }
+ else
+ {
+ pending_connection_.connect_pipe->send_bind(bind_socket_, pending_connection_.bind_pipe, false);
+ }
+
+ int sndhwm = 0;
+ if (pending_connection_.endpoint.options.sndhwm != 0 && bind_options.rcvhwm != 0)
+ sndhwm = pending_connection_.endpoint.options.sndhwm + bind_options.rcvhwm;
+ int rcvhwm = 0;
+ if (pending_connection_.endpoint.options.rcvhwm != 0 && bind_options.sndhwm != 0)
+ rcvhwm = pending_connection_.endpoint.options.rcvhwm + bind_options.sndhwm;
+
+ bool conflate = pending_connection_.endpoint.options.conflate &&
+ (pending_connection_.endpoint.options.type == ZMQ_DEALER ||
+ pending_connection_.endpoint.options.type == ZMQ_PULL ||
+ pending_connection_.endpoint.options.type == ZMQ_PUSH ||
+ pending_connection_.endpoint.options.type == ZMQ_PUB ||
+ pending_connection_.endpoint.options.type == ZMQ_SUB);
+
+ int hwms [2] = {conflate? -1 : sndhwm, conflate? -1 : rcvhwm};
+ pending_connection_.connect_pipe->set_hwms(hwms [1], hwms [0]);
+ pending_connection_.bind_pipe->set_hwms(hwms [0], hwms [1]);
+
+ if (bind_options.recv_identity) {
+
+ msg_t id;
+ int rc = id.init_size (pending_connection_.endpoint.options.identity_size);
+ errno_assert (rc == 0);
+ memcpy (id.data (), pending_connection_.endpoint.options.identity, pending_connection_.endpoint.options.identity_size);
+ id.set_flags (msg_t::identity);
+ bool written = pending_connection_.connect_pipe->write (&id);
+ zmq_assert (written);
+ pending_connection_.connect_pipe->flush ();
+ }
+ if (pending_connection_.endpoint.options.recv_identity) {
+ msg_t id;
+ int rc = id.init_size (bind_options.identity_size);
+ errno_assert (rc == 0);
+ memcpy (id.data (), bind_options.identity, bind_options.identity_size);
+ id.set_flags (msg_t::identity);
+ bool written = pending_connection_.bind_pipe->write (&id);
+ zmq_assert (written);
+ pending_connection_.bind_pipe->flush ();
+ }
+}
+
// The last used socket ID, or 0 if no socket was used so far. Note that this
// is a global variable. Thus, even sockets created in different contexts have
// unique IDs.
/*
- Copyright (c) 2007-2012 iMatix Corporation
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
class io_thread_t;
class socket_base_t;
class reaper_t;
+ class pipe_t;
// Information associated with inproc endpoint. Note that endpoint options
// are registered as well so that the peer can access them without a need
options_t options;
};
+ struct pending_connection_t
+ {
+ endpoint_t endpoint;
+ pipe_t* connect_pipe;
+ pipe_t* bind_pipe;
+ };
+
// Context object encapsulates all the global state associated with
// the library.
// after the last one is closed.
int terminate ();
+ // This function starts the terminate process by unblocking any blocking
+ // operations currently in progress and stopping any more socket activity
+ // (except zmq_close).
+ // This function is non-blocking.
+ // terminate must still be called afterwards.
+ // This function is optional, terminate will unblock any current
+ // operations as well.
+ int shutdown();
+
// Set and get context properties.
int set (int option_, int optval_);
int get (int option_);
int register_endpoint (const char *addr_, endpoint_t &endpoint_);
void unregister_endpoints (zmq::socket_base_t *socket_);
endpoint_t find_endpoint (const char *addr_);
+ void pend_connection (const char *addr_, pending_connection_t &pending_connection_);
+ void connect_pending (const char *addr_, zmq::socket_base_t *bind_socket_);
enum {
term_tid = 0,
sockets_t sockets;
// List of unused thread slots.
- typedef std::vector <uint32_t> emtpy_slots_t;
- emtpy_slots_t empty_slots;
+ typedef std::vector <uint32_t> empty_slots_t;
+ empty_slots_t empty_slots;
// If true, zmq_init has been called but no socket has been created
// yet. Launching of I/O threads is delayed.
typedef std::map <std::string, endpoint_t> endpoints_t;
endpoints_t endpoints;
+ // List of inproc connection endpoints pending a bind
+ typedef std::multimap <std::string, pending_connection_t> pending_connections_t;
+ pending_connections_t pending_connections;
+
// Synchronisation of access to the list of inproc endpoints.
mutex_t endpoints_sync;
// Number of I/O threads to launch.
int io_thread_count;
+ // Is IPv6 enabled on this context?
+ bool ipv6;
+
// Synchronisation of access to context options.
mutex_t opt_sync;
ctx_t (const ctx_t&);
const ctx_t &operator = (const ctx_t&);
+
+#ifdef HAVE_FORK
+ // the process that created this context. Used to detect forking.
+ pid_t pid;
+#endif
+ enum side { connect_side, bind_side };
+ void connect_inproc_sockets(zmq::socket_base_t *bind_socket_, options_t& bind_options, pending_connection_t &pending_connection_, side side_);
};
}
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "platform.hpp"
+
+#ifdef HAVE_LIBSODIUM
+
+#include <sodium.h>
+
+#ifdef ZMQ_HAVE_WINDOWS
+#include "windows.hpp"
+#endif
+
+#include "msg.hpp"
+#include "session_base.hpp"
+#include "err.hpp"
+#include "curve_client.hpp"
+#include "wire.hpp"
+
+zmq::curve_client_t::curve_client_t (const options_t &options_) :
+ mechanism_t (options_),
+ state (send_hello)
+{
+ memcpy (public_key, options_.curve_public_key, crypto_box_PUBLICKEYBYTES);
+ memcpy (secret_key, options_.curve_secret_key, crypto_box_SECRETKEYBYTES);
+ memcpy (server_key, options_.curve_server_key, crypto_box_PUBLICKEYBYTES);
+
+ // Generate short-term key pair
+ const int rc = crypto_box_keypair (cn_public, cn_secret);
+ zmq_assert (rc == 0);
+}
+
+zmq::curve_client_t::~curve_client_t ()
+{
+}
+
+int zmq::curve_client_t::next_handshake_command (msg_t *msg_)
+{
+ int rc = 0;
+
+ switch (state) {
+ case send_hello:
+ rc = produce_hello (msg_);
+ if (rc == 0)
+ state = expect_welcome;
+ break;
+ case send_initiate:
+ rc = produce_initiate (msg_);
+ if (rc == 0)
+ state = expect_ready;
+ break;
+ default:
+ errno = EAGAIN;
+ rc = -1;
+ }
+ return rc;
+}
+
+int zmq::curve_client_t::process_handshake_command (msg_t *msg_)
+{
+ int rc = 0;
+
+ switch (state) {
+ case expect_welcome:
+ rc = process_welcome (msg_);
+ if (rc == 0)
+ state = send_initiate;
+ break;
+ case expect_ready:
+ rc = process_ready (msg_);
+ if (rc == 0)
+ state = connected;
+ break;
+ default:
+ errno = EPROTO;
+ rc = -1;
+ break;
+ }
+ if (rc == 0) {
+ rc = msg_->close ();
+ errno_assert (rc == 0);
+ rc = msg_->init ();
+ errno_assert (rc == 0);
+ }
+ return rc;
+}
+
+int zmq::curve_client_t::encode (msg_t *msg_)
+{
+ zmq_assert (state == connected);
+
+ uint8_t flags = 0;
+ if (msg_->flags () & msg_t::more)
+ flags |= 0x01;
+
+ uint8_t message_nonce [crypto_box_NONCEBYTES];
+ memcpy (message_nonce, "CurveZMQMESSAGEC", 16);
+ memcpy (message_nonce + 16, &cn_nonce, 8);
+
+ const size_t mlen = crypto_box_ZEROBYTES + 1 + msg_->size ();
+
+ uint8_t *message_plaintext = static_cast <uint8_t *> (malloc (mlen));
+ alloc_assert (message_plaintext);
+
+ memset (message_plaintext, 0, crypto_box_ZEROBYTES);
+ message_plaintext [crypto_box_ZEROBYTES] = flags;
+ memcpy (message_plaintext + crypto_box_ZEROBYTES + 1,
+ msg_->data (), msg_->size ());
+
+ uint8_t *message_box = static_cast <uint8_t *> (malloc (mlen));
+ alloc_assert (message_box);
+
+ int rc = crypto_box_afternm (message_box, message_plaintext,
+ mlen, message_nonce, cn_precom);
+ zmq_assert (rc == 0);
+
+ rc = msg_->close ();
+ zmq_assert (rc == 0);
+
+ rc = msg_->init_size (16 + mlen - crypto_box_BOXZEROBYTES);
+ zmq_assert (rc == 0);
+
+ uint8_t *message = static_cast <uint8_t *> (msg_->data ());
+
+ memcpy (message, "\x07MESSAGE", 8);
+ memcpy (message + 8, &cn_nonce, 8);
+ memcpy (message + 16, message_box + crypto_box_BOXZEROBYTES,
+ mlen - crypto_box_BOXZEROBYTES);
+
+ free (message_plaintext);
+ free (message_box);
+
+ cn_nonce++;
+
+ return 0;
+}
+
+int zmq::curve_client_t::decode (msg_t *msg_)
+{
+ zmq_assert (state == connected);
+
+ if (msg_->size () < 33) {
+ errno = EPROTO;
+ return -1;
+ }
+
+ const uint8_t *message = static_cast <uint8_t *> (msg_->data ());
+ if (memcmp (message, "\x07MESSAGE", 8)) {
+ errno = EPROTO;
+ return -1;
+ }
+
+ uint8_t message_nonce [crypto_box_NONCEBYTES];
+ memcpy (message_nonce, "CurveZMQMESSAGES", 16);
+ memcpy (message_nonce + 16, message + 8, 8);
+
+ const size_t clen = crypto_box_BOXZEROBYTES + (msg_->size () - 16);
+
+ uint8_t *message_plaintext = static_cast <uint8_t *> (malloc (clen));
+ alloc_assert (message_plaintext);
+
+ uint8_t *message_box = static_cast <uint8_t *> (malloc (clen));
+ alloc_assert (message_box);
+
+ memset (message_box, 0, crypto_box_BOXZEROBYTES);
+ memcpy (message_box + crypto_box_BOXZEROBYTES,
+ message + 16, msg_->size () - 16);
+
+ int rc = crypto_box_open_afternm (message_plaintext, message_box,
+ clen, message_nonce, cn_precom);
+ if (rc == 0) {
+ rc = msg_->close ();
+ zmq_assert (rc == 0);
+
+ rc = msg_->init_size (clen - 1 - crypto_box_ZEROBYTES);
+ zmq_assert (rc == 0);
+
+ const uint8_t flags = message_plaintext [crypto_box_ZEROBYTES];
+ if (flags & 0x01)
+ msg_->set_flags (msg_t::more);
+
+ memcpy (msg_->data (),
+ message_plaintext + crypto_box_ZEROBYTES + 1,
+ msg_->size ());
+ }
+ else
+ errno = EPROTO;
+
+ free (message_plaintext);
+ free (message_box);
+
+ return rc;
+}
+
+bool zmq::curve_client_t::is_handshake_complete () const
+{
+ return state == connected;
+}
+
+int zmq::curve_client_t::produce_hello (msg_t *msg_)
+{
+ uint8_t hello_nonce [crypto_box_NONCEBYTES];
+ uint8_t hello_plaintext [crypto_box_ZEROBYTES + 64];
+ uint8_t hello_box [crypto_box_BOXZEROBYTES + 80];
+
+ // Prepare the full nonce
+ memcpy (hello_nonce, "CurveZMQHELLO---", 16);
+ memcpy (hello_nonce + 16, &cn_nonce, 8);
+
+ // Create Box [64 * %x0](C'->S)
+ memset (hello_plaintext, 0, sizeof hello_plaintext);
+
+ int rc = crypto_box (hello_box, hello_plaintext,
+ sizeof hello_plaintext,
+ hello_nonce, server_key, cn_secret);
+ zmq_assert (rc == 0);
+
+ rc = msg_->init_size (200);
+ errno_assert (rc == 0);
+ uint8_t *hello = static_cast <uint8_t *> (msg_->data ());
+
+ memcpy (hello, "\x05HELLO", 6);
+ // CurveZMQ major and minor version numbers
+ memcpy (hello + 6, "\1\0", 2);
+ // Anti-amplification padding
+ memset (hello + 8, 0, 72);
+ // Client public connection key
+ memcpy (hello + 80, cn_public, crypto_box_PUBLICKEYBYTES);
+ // Short nonce, prefixed by "CurveZMQHELLO---"
+ memcpy (hello + 112, hello_nonce + 16, 8);
+ // Signature, Box [64 * %x0](C'->S)
+ memcpy (hello + 120, hello_box + crypto_box_BOXZEROBYTES, 80);
+
+ cn_nonce++;
+
+ return 0;
+}
+
+int zmq::curve_client_t::process_welcome (msg_t *msg_)
+{
+ if (msg_->size () != 168) {
+ errno = EPROTO;
+ return -1;
+ }
+
+ const uint8_t * welcome = static_cast <uint8_t *> (msg_->data ());
+ if (memcmp (welcome, "\x07WELCOME", 8)) {
+ errno = EPROTO;
+ return -1;
+ }
+
+ uint8_t welcome_nonce [crypto_box_NONCEBYTES];
+ uint8_t welcome_plaintext [crypto_box_ZEROBYTES + 128];
+ uint8_t welcome_box [crypto_box_BOXZEROBYTES + 144];
+
+ // Open Box [S' + cookie](C'->S)
+ memset (welcome_box, 0, crypto_box_BOXZEROBYTES);
+ memcpy (welcome_box + crypto_box_BOXZEROBYTES, welcome + 24, 144);
+
+ memcpy (welcome_nonce, "WELCOME-", 8);
+ memcpy (welcome_nonce + 8, welcome + 8, 16);
+
+ int rc = crypto_box_open (welcome_plaintext, welcome_box,
+ sizeof welcome_box,
+ welcome_nonce, server_key, cn_secret);
+ if (rc != 0) {
+ errno = EPROTO;
+ return -1;
+ }
+
+ memcpy (cn_server, welcome_plaintext + crypto_box_ZEROBYTES, 32);
+ memcpy (cn_cookie, welcome_plaintext + crypto_box_ZEROBYTES + 32, 16 + 80);
+
+ // Message independent precomputation
+ rc = crypto_box_beforenm (cn_precom, cn_server, cn_secret);
+ zmq_assert (rc == 0);
+
+ return 0;
+}
+
+int zmq::curve_client_t::produce_initiate (msg_t *msg_)
+{
+ uint8_t vouch_nonce [crypto_box_NONCEBYTES];
+ uint8_t vouch_plaintext [crypto_box_ZEROBYTES + 64];
+ uint8_t vouch_box [crypto_box_BOXZEROBYTES + 80];
+
+ // Create vouch = Box [C',S](C->S')
+ memset (vouch_plaintext, 0, crypto_box_ZEROBYTES);
+ memcpy (vouch_plaintext + crypto_box_ZEROBYTES, cn_public, 32);
+ memcpy (vouch_plaintext + crypto_box_ZEROBYTES + 32, server_key, 32);
+
+ memcpy (vouch_nonce, "VOUCH---", 8);
+ randombytes (vouch_nonce + 8, 16);
+
+ int rc = crypto_box (vouch_box, vouch_plaintext,
+ sizeof vouch_plaintext,
+ vouch_nonce, cn_server, secret_key);
+ zmq_assert (rc == 0);
+
+ // Assume here that metadata is limited to 256 bytes
+ uint8_t initiate_nonce [crypto_box_NONCEBYTES];
+ uint8_t initiate_plaintext [crypto_box_ZEROBYTES + 128 + 256];
+ uint8_t initiate_box [crypto_box_BOXZEROBYTES + 144 + 256];
+
+ // Create Box [C + vouch + metadata](C'->S')
+ memset (initiate_plaintext, 0, crypto_box_ZEROBYTES);
+ memcpy (initiate_plaintext + crypto_box_ZEROBYTES,
+ public_key, 32);
+ memcpy (initiate_plaintext + crypto_box_ZEROBYTES + 32,
+ vouch_nonce + 8, 16);
+ memcpy (initiate_plaintext + crypto_box_ZEROBYTES + 48,
+ vouch_box + crypto_box_BOXZEROBYTES, 80);
+
+ // Metadata starts after vouch
+ uint8_t *ptr = initiate_plaintext + crypto_box_ZEROBYTES + 128;
+
+ // Add socket type property
+ const char *socket_type = socket_type_string (options.type);
+ ptr += add_property (ptr, "Socket-Type", socket_type, strlen (socket_type));
+
+ // Add identity property
+ if (options.type == ZMQ_REQ
+ || options.type == ZMQ_DEALER
+ || options.type == ZMQ_ROUTER)
+ ptr += add_property (ptr, "Identity",
+ options.identity, options.identity_size);
+
+ const size_t mlen = ptr - initiate_plaintext;
+
+ memcpy (initiate_nonce, "CurveZMQINITIATE", 16);
+ memcpy (initiate_nonce + 16, &cn_nonce, 8);
+
+ rc = crypto_box (initiate_box, initiate_plaintext,
+ mlen, initiate_nonce, cn_server, cn_secret);
+ zmq_assert (rc == 0);
+
+ rc = msg_->init_size (113 + mlen - crypto_box_BOXZEROBYTES);
+ errno_assert (rc == 0);
+
+ uint8_t *initiate = static_cast <uint8_t *> (msg_->data ());
+
+ memcpy (initiate, "\x08INITIATE", 9);
+ // Cookie provided by the server in the WELCOME command
+ memcpy (initiate + 9, cn_cookie, 96);
+ // Short nonce, prefixed by "CurveZMQINITIATE"
+ memcpy (initiate + 105, &cn_nonce, 8);
+ // Box [C + vouch + metadata](C'->S')
+ memcpy (initiate + 113, initiate_box + crypto_box_BOXZEROBYTES,
+ mlen - crypto_box_BOXZEROBYTES);
+ cn_nonce++;
+
+ return 0;
+}
+
+int zmq::curve_client_t::process_ready (msg_t *msg_)
+{
+ if (msg_->size () < 30) {
+ errno = EPROTO;
+ return -1;
+ }
+
+ const uint8_t *ready = static_cast <uint8_t *> (msg_->data ());
+ if (memcmp (ready, "\x05READY", 6)) {
+ errno = EPROTO;
+ return -1;
+ }
+
+ const size_t clen = (msg_->size () - 14) + crypto_box_BOXZEROBYTES;
+
+ uint8_t ready_nonce [crypto_box_NONCEBYTES];
+ uint8_t ready_plaintext [crypto_box_ZEROBYTES + 256];
+ uint8_t ready_box [crypto_box_BOXZEROBYTES + 16 + 256];
+
+ memset (ready_box, 0, crypto_box_BOXZEROBYTES);
+ memcpy (ready_box + crypto_box_BOXZEROBYTES,
+ ready + 14, clen - crypto_box_BOXZEROBYTES);
+
+ memcpy (ready_nonce, "CurveZMQREADY---", 16);
+ memcpy (ready_nonce + 16, ready + 6, 8);
+
+ int rc = crypto_box_open_afternm (ready_plaintext, ready_box,
+ clen, ready_nonce, cn_precom);
+
+ if (rc != 0) {
+ errno = EPROTO;
+ return -1;
+ }
+
+ rc = parse_metadata (ready_plaintext + crypto_box_ZEROBYTES,
+ clen - crypto_box_ZEROBYTES);
+ return rc;
+}
+
+#endif
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __ZMQ_CURVE_CLIENT_HPP_INCLUDED__
+#define __ZMQ_CURVE_CLIENT_HPP_INCLUDED__
+
+#include "platform.hpp"
+
+#ifdef HAVE_LIBSODIUM
+#include <sodium.h>
+
+#if crypto_box_NONCEBYTES != 24 \
+|| crypto_box_PUBLICKEYBYTES != 32 \
+|| crypto_box_SECRETKEYBYTES != 32 \
+|| crypto_box_ZEROBYTES != 32 \
+|| crypto_box_BOXZEROBYTES != 16
+#error "libsodium not built properly"
+#endif
+
+#include "mechanism.hpp"
+#include "options.hpp"
+
+namespace zmq
+{
+
+ class msg_t;
+ class session_base_t;
+
+ class curve_client_t : public mechanism_t
+ {
+ public:
+
+ curve_client_t (const options_t &options_);
+ virtual ~curve_client_t ();
+
+ // mechanism implementation
+ virtual int next_handshake_command (msg_t *msg_);
+ virtual int process_handshake_command (msg_t *msg_);
+ virtual int encode (msg_t *msg_);
+ virtual int decode (msg_t *msg_);
+ virtual bool is_handshake_complete () const;
+
+ private:
+
+ enum state_t {
+ send_hello,
+ expect_welcome,
+ send_initiate,
+ expect_ready,
+ connected
+ };
+
+ // Current FSM state
+ state_t state;
+
+ // Our public key (C)
+ uint8_t public_key [crypto_box_PUBLICKEYBYTES];
+
+ // Our secret key (c)
+ uint8_t secret_key [crypto_box_SECRETKEYBYTES];
+
+ // Our short-term public key (C')
+ uint8_t cn_public [crypto_box_PUBLICKEYBYTES];
+
+ // Our short-term secret key (c')
+ uint8_t cn_secret [crypto_box_SECRETKEYBYTES];
+
+ // Server's public key (S)
+ uint8_t server_key [crypto_box_PUBLICKEYBYTES];
+
+ // Server's short-term public key (S')
+ uint8_t cn_server [crypto_box_PUBLICKEYBYTES];
+
+ // Cookie received from server
+ uint8_t cn_cookie [16 + 80];
+
+ // Intermediary buffer used to seepd up boxing and unboxing.
+ uint8_t cn_precom [crypto_box_BEFORENMBYTES];
+
+ // Nonce
+ uint64_t cn_nonce;
+
+ int produce_hello (msg_t *msg_);
+ int process_welcome (msg_t *msg_);
+ int produce_initiate (msg_t *msg_);
+ int process_ready (msg_t *msg_);
+ };
+
+}
+
+#endif
+
+#endif
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "platform.hpp"
+
+#ifdef HAVE_LIBSODIUM
+#include <sodium.h>
+
+#ifdef ZMQ_HAVE_WINDOWS
+#include "windows.hpp"
+#endif
+
+#include "msg.hpp"
+#include "session_base.hpp"
+#include "err.hpp"
+#include "curve_server.hpp"
+#include "wire.hpp"
+
+zmq::curve_server_t::curve_server_t (session_base_t *session_,
+ const std::string &peer_address_,
+ const options_t &options_) :
+ mechanism_t (options_),
+ session (session_),
+ peer_address (peer_address_),
+ state (expect_hello),
+ expecting_zap_reply (false),
+ cn_nonce (1)
+{
+ // Fetch our secret key from socket options
+ memcpy (secret_key, options_.curve_secret_key, crypto_box_SECRETKEYBYTES);
+
+ // Generate short-term key pair
+ const int rc = crypto_box_keypair (cn_public, cn_secret);
+ zmq_assert (rc == 0);
+}
+
+zmq::curve_server_t::~curve_server_t ()
+{
+}
+
+int zmq::curve_server_t::next_handshake_command (msg_t *msg_)
+{
+ int rc = 0;
+
+ switch (state) {
+ case send_welcome:
+ rc = produce_welcome (msg_);
+ if (rc == 0)
+ state = expect_initiate;
+ break;
+ case send_ready:
+ rc = produce_ready (msg_);
+ if (rc == 0)
+ state = connected;
+ break;
+ default:
+ errno = EAGAIN;
+ rc = -1;
+ break;
+ }
+ return rc;
+}
+
+int zmq::curve_server_t::process_handshake_command (msg_t *msg_)
+{
+ int rc = 0;
+
+ switch (state) {
+ case expect_hello:
+ rc = process_hello (msg_);
+ if (rc == 0)
+ state = send_welcome;
+ break;
+ case expect_initiate:
+ rc = process_initiate (msg_);
+ if (rc == 0)
+ state = expecting_zap_reply? expect_zap_reply: send_ready;
+ break;
+ default:
+ errno = EPROTO;
+ rc = -1;
+ break;
+ }
+ if (rc == 0) {
+ rc = msg_->close ();
+ errno_assert (rc == 0);
+ rc = msg_->init ();
+ errno_assert (rc == 0);
+ }
+ return rc;
+}
+
+int zmq::curve_server_t::encode (msg_t *msg_)
+{
+ zmq_assert (state == connected);
+
+ const size_t mlen = crypto_box_ZEROBYTES + 1 + msg_->size ();
+
+ uint8_t message_nonce [crypto_box_NONCEBYTES];
+ memcpy (message_nonce, "CurveZMQMESSAGES", 16);
+ memcpy (message_nonce + 16, &cn_nonce, 8);
+
+ uint8_t flags = 0;
+ if (msg_->flags () & msg_t::more)
+ flags |= 0x01;
+
+ uint8_t *message_plaintext = static_cast <uint8_t *> (malloc (mlen));
+ alloc_assert (message_plaintext);
+
+ memset (message_plaintext, 0, crypto_box_ZEROBYTES);
+ message_plaintext [crypto_box_ZEROBYTES] = flags;
+ memcpy (message_plaintext + crypto_box_ZEROBYTES + 1,
+ msg_->data (), msg_->size ());
+
+ uint8_t *message_box = static_cast <uint8_t *> (malloc (mlen));
+ alloc_assert (message_box);
+
+ int rc = crypto_box_afternm (message_box, message_plaintext,
+ mlen, message_nonce, cn_precom);
+ zmq_assert (rc == 0);
+
+ rc = msg_->close ();
+ zmq_assert (rc == 0);
+
+ rc = msg_->init_size (16 + mlen - crypto_box_BOXZEROBYTES);
+ zmq_assert (rc == 0);
+
+ uint8_t *message = static_cast <uint8_t *> (msg_->data ());
+
+ memcpy (message, "\x07MESSAGE", 8);
+ memcpy (message + 8, &cn_nonce, 8);
+ memcpy (message + 16, message_box + crypto_box_BOXZEROBYTES,
+ mlen - crypto_box_BOXZEROBYTES);
+
+ free (message_plaintext);
+ free (message_box);
+
+ cn_nonce++;
+
+ return 0;
+}
+
+int zmq::curve_server_t::decode (msg_t *msg_)
+{
+ zmq_assert (state == connected);
+
+ if (msg_->size () < 33) {
+ errno = EPROTO;
+ return -1;
+ }
+
+ const uint8_t *message = static_cast <uint8_t *> (msg_->data ());
+ if (memcmp (message, "\x07MESSAGE", 8)) {
+ errno = EPROTO;
+ return -1;
+ }
+
+ uint8_t message_nonce [crypto_box_NONCEBYTES];
+ memcpy (message_nonce, "CurveZMQMESSAGEC", 16);
+ memcpy (message_nonce + 16, message + 8, 8);
+
+ const size_t clen = crypto_box_BOXZEROBYTES + msg_->size () - 16;
+
+ uint8_t *message_plaintext = static_cast <uint8_t *> (malloc (clen));
+ alloc_assert (message_plaintext);
+
+ uint8_t *message_box = static_cast <uint8_t *> (malloc (clen));
+ alloc_assert (message_box);
+
+ memset (message_box, 0, crypto_box_BOXZEROBYTES);
+ memcpy (message_box + crypto_box_BOXZEROBYTES,
+ message + 16, msg_->size () - 16);
+
+ int rc = crypto_box_open_afternm (message_plaintext, message_box,
+ clen, message_nonce, cn_precom);
+ if (rc == 0) {
+ rc = msg_->close ();
+ zmq_assert (rc == 0);
+
+ rc = msg_->init_size (clen - 1 - crypto_box_ZEROBYTES);
+ zmq_assert (rc == 0);
+
+ const uint8_t flags = message_plaintext [crypto_box_ZEROBYTES];
+ if (flags & 0x01)
+ msg_->set_flags (msg_t::more);
+
+ memcpy (msg_->data (),
+ message_plaintext + crypto_box_ZEROBYTES + 1,
+ msg_->size ());
+ }
+ else
+ errno = EPROTO;
+
+ free (message_plaintext);
+ free (message_box);
+
+ return rc;
+}
+
+int zmq::curve_server_t::zap_msg_available ()
+{
+ if (state != expect_zap_reply) {
+ errno = EFSM;
+ return -1;
+ }
+ const int rc = receive_and_process_zap_reply ();
+ if (rc == 0)
+ state = send_ready;
+ return rc;
+}
+
+bool zmq::curve_server_t::is_handshake_complete () const
+{
+ return state == connected;
+}
+
+int zmq::curve_server_t::process_hello (msg_t *msg_)
+{
+ if (msg_->size () != 200) {
+ errno = EPROTO;
+ return -1;
+ }
+
+ const uint8_t * const hello = static_cast <uint8_t *> (msg_->data ());
+ if (memcmp (hello, "\x05HELLO", 6)) {
+ errno = EPROTO;
+ return -1;
+ }
+
+ const uint8_t major = hello [6];
+ const uint8_t minor = hello [7];
+
+ if (major != 1 || minor != 0) {
+ errno = EPROTO;
+ return -1;
+ }
+
+ // Save client's short-term public key (C')
+ memcpy (cn_client, hello + 80, 32);
+
+ uint8_t hello_nonce [crypto_box_NONCEBYTES];
+ uint8_t hello_plaintext [crypto_box_ZEROBYTES + 64];
+ uint8_t hello_box [crypto_box_BOXZEROBYTES + 80];
+
+ memcpy (hello_nonce, "CurveZMQHELLO---", 16);
+ memcpy (hello_nonce + 16, hello + 112, 8);
+
+ memset (hello_box, 0, crypto_box_BOXZEROBYTES);
+ memcpy (hello_box + crypto_box_BOXZEROBYTES, hello + 120, 80);
+
+ // Open Box [64 * %x0](C'->S)
+ int rc = crypto_box_open (hello_plaintext, hello_box,
+ sizeof hello_box,
+ hello_nonce, cn_client, secret_key);
+ if (rc != 0) {
+ errno = EPROTO;
+ return -1;
+ }
+
+ return rc;
+}
+
+int zmq::curve_server_t::produce_welcome (msg_t *msg_)
+{
+ uint8_t cookie_nonce [crypto_secretbox_NONCEBYTES];
+ uint8_t cookie_plaintext [crypto_secretbox_ZEROBYTES + 64];
+ uint8_t cookie_ciphertext [crypto_secretbox_BOXZEROBYTES + 80];
+
+ // Create full nonce for encryption
+ // 8-byte prefix plus 16-byte random nonce
+ memcpy (cookie_nonce, "COOKIE--", 8);
+ randombytes (cookie_nonce + 8, 16);
+
+ // Generate cookie = Box [C' + s'](t)
+ memset (cookie_plaintext, 0, crypto_secretbox_ZEROBYTES);
+ memcpy (cookie_plaintext + crypto_secretbox_ZEROBYTES,
+ cn_client, 32);
+ memcpy (cookie_plaintext + crypto_secretbox_ZEROBYTES + 32,
+ cn_secret, 32);
+
+ // Generate fresh cookie key
+ randombytes (cookie_key, crypto_secretbox_KEYBYTES);
+
+ // Encrypt using symmetric cookie key
+ int rc = crypto_secretbox (cookie_ciphertext, cookie_plaintext,
+ sizeof cookie_plaintext,
+ cookie_nonce, cookie_key);
+ zmq_assert (rc == 0);
+
+ uint8_t welcome_nonce [crypto_box_NONCEBYTES];
+ uint8_t welcome_plaintext [crypto_box_ZEROBYTES + 128];
+ uint8_t welcome_ciphertext [crypto_box_BOXZEROBYTES + 144];
+
+ // Create full nonce for encryption
+ // 8-byte prefix plus 16-byte random nonce
+ memcpy (welcome_nonce, "WELCOME-", 8);
+ randombytes (welcome_nonce + 8, crypto_box_NONCEBYTES - 8);
+
+ // Create 144-byte Box [S' + cookie](S->C')
+ memset (welcome_plaintext, 0, crypto_box_ZEROBYTES);
+ memcpy (welcome_plaintext + crypto_box_ZEROBYTES, cn_public, 32);
+ memcpy (welcome_plaintext + crypto_box_ZEROBYTES + 32,
+ cookie_nonce + 8, 16);
+ memcpy (welcome_plaintext + crypto_box_ZEROBYTES + 48,
+ cookie_ciphertext + crypto_secretbox_BOXZEROBYTES, 80);
+
+ rc = crypto_box (welcome_ciphertext, welcome_plaintext,
+ sizeof welcome_plaintext,
+ welcome_nonce, cn_client, secret_key);
+ zmq_assert (rc == 0);
+
+ rc = msg_->init_size (168);
+ errno_assert (rc == 0);
+
+ uint8_t * const welcome = static_cast <uint8_t *> (msg_->data ());
+ memcpy (welcome, "\x07WELCOME", 8);
+ memcpy (welcome + 8, welcome_nonce + 8, 16);
+ memcpy (welcome + 24, welcome_ciphertext + crypto_box_BOXZEROBYTES, 144);
+
+ return 0;
+}
+
+int zmq::curve_server_t::process_initiate (msg_t *msg_)
+{
+ if (msg_->size () < 257) {
+ errno = EPROTO;
+ return -1;
+ }
+
+ const uint8_t *initiate = static_cast <uint8_t *> (msg_->data ());
+ if (memcmp (initiate, "\x08INITIATE", 9)) {
+ errno = EPROTO;
+ return -1;
+ }
+
+ uint8_t cookie_nonce [crypto_secretbox_NONCEBYTES];
+ uint8_t cookie_plaintext [crypto_secretbox_ZEROBYTES + 64];
+ uint8_t cookie_box [crypto_secretbox_BOXZEROBYTES + 80];
+
+ // Open Box [C' + s'](t)
+ memset (cookie_box, 0, crypto_secretbox_BOXZEROBYTES);
+ memcpy (cookie_box + crypto_secretbox_BOXZEROBYTES, initiate + 25, 80);
+
+ memcpy (cookie_nonce, "COOKIE--", 8);
+ memcpy (cookie_nonce + 8, initiate + 9, 16);
+
+ int rc = crypto_secretbox_open (cookie_plaintext, cookie_box,
+ sizeof cookie_box,
+ cookie_nonce, cookie_key);
+ if (rc != 0) {
+ errno = EPROTO;
+ return -1;
+ }
+
+ // Check cookie plain text is as expected [C' + s']
+ if (memcmp (cookie_plaintext + crypto_secretbox_ZEROBYTES, cn_client, 32)
+ || memcmp (cookie_plaintext + crypto_secretbox_ZEROBYTES + 32, cn_secret, 32)) {
+ errno = EPROTO;
+ return -1;
+ }
+
+ const size_t clen = (msg_->size () - 113) + crypto_box_BOXZEROBYTES;
+
+ uint8_t initiate_nonce [crypto_box_NONCEBYTES];
+ uint8_t initiate_plaintext [crypto_box_ZEROBYTES + 128 + 256];
+ uint8_t initiate_box [crypto_box_BOXZEROBYTES + 144 + 256];
+
+ // Open Box [C + vouch + metadata](C'->S')
+ memset (initiate_box, 0, crypto_box_BOXZEROBYTES);
+ memcpy (initiate_box + crypto_box_BOXZEROBYTES,
+ initiate + 113, clen - crypto_box_BOXZEROBYTES);
+
+ memcpy (initiate_nonce, "CurveZMQINITIATE", 16);
+ memcpy (initiate_nonce + 16, initiate + 105, 8);
+
+ rc = crypto_box_open (initiate_plaintext, initiate_box,
+ clen, initiate_nonce, cn_client, cn_secret);
+ if (rc != 0) {
+ errno = EPROTO;
+ return -1;
+ }
+
+ const uint8_t *client_key = initiate_plaintext + crypto_box_ZEROBYTES;
+
+ uint8_t vouch_nonce [crypto_box_NONCEBYTES];
+ uint8_t vouch_plaintext [crypto_box_ZEROBYTES + 64];
+ uint8_t vouch_box [crypto_box_BOXZEROBYTES + 80];
+
+ // Open Box Box [C',S](C->S') and check contents
+ memset (vouch_box, 0, crypto_box_BOXZEROBYTES);
+ memcpy (vouch_box + crypto_box_BOXZEROBYTES,
+ initiate_plaintext + crypto_box_ZEROBYTES + 48, 80);
+
+ memcpy (vouch_nonce, "VOUCH---", 8);
+ memcpy (vouch_nonce + 8,
+ initiate_plaintext + crypto_box_ZEROBYTES + 32, 16);
+
+ rc = crypto_box_open (vouch_plaintext, vouch_box,
+ sizeof vouch_box,
+ vouch_nonce, client_key, cn_secret);
+ if (rc != 0) {
+ errno = EPROTO;
+ return -1;
+ }
+
+ // What we decrypted must be the client's short-term public key
+ if (memcmp (vouch_plaintext + crypto_box_ZEROBYTES, cn_client, 32)) {
+ errno = EPROTO;
+ return -1;
+ }
+
+ // Precompute connection secret from client key
+ rc = crypto_box_beforenm (cn_precom, cn_client, cn_secret);
+ zmq_assert (rc == 0);
+
+ // Use ZAP protocol (RFC 27) to authenticate the user.
+ rc = session->zap_connect ();
+ if (rc == 0) {
+ send_zap_request (client_key);
+ rc = receive_and_process_zap_reply ();
+ if (rc != 0) {
+ if (errno != EAGAIN)
+ return -1;
+ expecting_zap_reply = true;
+ }
+ }
+
+ return parse_metadata (initiate_plaintext + crypto_box_ZEROBYTES + 128,
+ clen - crypto_box_ZEROBYTES - 128);
+}
+
+int zmq::curve_server_t::produce_ready (msg_t *msg_)
+{
+ uint8_t ready_nonce [crypto_box_NONCEBYTES];
+ uint8_t ready_plaintext [crypto_box_ZEROBYTES + 256];
+ uint8_t ready_box [crypto_box_BOXZEROBYTES + 16 + 256];
+
+ // Create Box [metadata](S'->C')
+ memset (ready_plaintext, 0, crypto_box_ZEROBYTES);
+ uint8_t *ptr = ready_plaintext + crypto_box_ZEROBYTES;
+
+ // Add socket type property
+ const char *socket_type = socket_type_string (options.type);
+ ptr += add_property (ptr, "Socket-Type", socket_type, strlen (socket_type));
+
+ // Add identity property
+ if (options.type == ZMQ_REQ
+ || options.type == ZMQ_DEALER
+ || options.type == ZMQ_ROUTER)
+ ptr += add_property (ptr, "Identity",
+ options.identity, options.identity_size);
+
+ const size_t mlen = ptr - ready_plaintext;
+
+ memcpy (ready_nonce, "CurveZMQREADY---", 16);
+ memcpy (ready_nonce + 16, &cn_nonce, 8);
+
+ int rc = crypto_box_afternm (ready_box, ready_plaintext,
+ mlen, ready_nonce, cn_precom);
+ zmq_assert (rc == 0);
+
+ rc = msg_->init_size (14 + mlen - crypto_box_BOXZEROBYTES);
+ errno_assert (rc == 0);
+
+ uint8_t *ready = static_cast <uint8_t *> (msg_->data ());
+
+ memcpy (ready, "\x05READY", 6);
+ // Short nonce, prefixed by "CurveZMQREADY---"
+ memcpy (ready + 6, &cn_nonce, 8);
+ // Box [metadata](S'->C')
+ memcpy (ready + 14, ready_box + crypto_box_BOXZEROBYTES,
+ mlen - crypto_box_BOXZEROBYTES);
+
+ cn_nonce++;
+
+ return 0;
+}
+
+void zmq::curve_server_t::send_zap_request (const uint8_t *key)
+{
+ int rc;
+ msg_t msg;
+
+ // Address delimiter frame
+ rc = msg.init ();
+ errno_assert (rc == 0);
+ msg.set_flags (msg_t::more);
+ rc = session->write_zap_msg (&msg);
+ errno_assert (rc == 0);
+
+ // Version frame
+ rc = msg.init_size (3);
+ errno_assert (rc == 0);
+ memcpy (msg.data (), "1.0", 3);
+ msg.set_flags (msg_t::more);
+ rc = session->write_zap_msg (&msg);
+ errno_assert (rc == 0);
+
+ // Request ID frame
+ rc = msg.init_size (1);
+ errno_assert (rc == 0);
+ memcpy (msg.data (), "1", 1);
+ msg.set_flags (msg_t::more);
+ rc = session->write_zap_msg (&msg);
+ errno_assert (rc == 0);
+
+ // Domain frame
+ rc = msg.init_size (options.zap_domain.length ());
+ errno_assert (rc == 0);
+ memcpy (msg.data (), options.zap_domain.c_str (), options.zap_domain.length ());
+ msg.set_flags (msg_t::more);
+ rc = session->write_zap_msg (&msg);
+ errno_assert (rc == 0);
+
+ // Address frame
+ rc = msg.init_size (peer_address.length ());
+ errno_assert (rc == 0);
+ memcpy (msg.data (), peer_address.c_str (), peer_address.length ());
+ msg.set_flags (msg_t::more);
+ rc = session->write_zap_msg (&msg);
+ errno_assert (rc == 0);
+
+ // Identity frame
+ rc = msg.init_size (options.identity_size);
+ errno_assert (rc == 0);
+ memcpy (msg.data (), options.identity, options.identity_size);
+ msg.set_flags (msg_t::more);
+ rc = session->write_zap_msg (&msg);
+ errno_assert (rc == 0);
+
+ // Mechanism frame
+ rc = msg.init_size (5);
+ errno_assert (rc == 0);
+ memcpy (msg.data (), "CURVE", 5);
+ msg.set_flags (msg_t::more);
+ rc = session->write_zap_msg (&msg);
+ errno_assert (rc == 0);
+
+ // Credentials frame
+ rc = msg.init_size (crypto_box_PUBLICKEYBYTES);
+ errno_assert (rc == 0);
+ memcpy (msg.data (), key, crypto_box_PUBLICKEYBYTES);
+ rc = session->write_zap_msg (&msg);
+ errno_assert (rc == 0);
+}
+
+int zmq::curve_server_t::receive_and_process_zap_reply ()
+{
+ int rc = 0;
+ msg_t msg [7]; // ZAP reply consists of 7 frames
+
+ // Initialize all reply frames
+ for (int i = 0; i < 7; i++) {
+ rc = msg [i].init ();
+ errno_assert (rc == 0);
+ }
+
+ for (int i = 0; i < 7; i++) {
+ rc = session->read_zap_msg (&msg [i]);
+ if (rc == -1)
+ break;
+ if ((msg [i].flags () & msg_t::more) == (i < 6? 0: msg_t::more)) {
+ errno = EPROTO;
+ rc = -1;
+ break;
+ }
+ }
+
+ if (rc != 0)
+ goto error;
+
+ // Address delimiter frame
+ if (msg [0].size () > 0) {
+ rc = -1;
+ errno = EPROTO;
+ goto error;
+ }
+
+ // Version frame
+ if (msg [1].size () != 3 || memcmp (msg [1].data (), "1.0", 3)) {
+ rc = -1;
+ errno = EPROTO;
+ goto error;
+ }
+
+ // Request id frame
+ if (msg [2].size () != 1 || memcmp (msg [2].data (), "1", 1)) {
+ rc = -1;
+ errno = EPROTO;
+ goto error;
+ }
+
+ // Status code frame
+ if (msg [3].size () != 3 || memcmp (msg [3].data (), "200", 3)) {
+ rc = -1;
+ errno = EACCES;
+ goto error;
+ }
+
+ // Process metadata frame
+ rc = parse_metadata (static_cast <const unsigned char*> (msg [6].data ()),
+ msg [6].size ());
+
+error:
+ for (int i = 0; i < 7; i++) {
+ const int rc2 = msg [i].close ();
+ errno_assert (rc2 == 0);
+ }
+
+ return rc;
+}
+
+#endif
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __ZMQ_CURVE_SERVER_HPP_INCLUDED__
+#define __ZMQ_CURVE_SERVER_HPP_INCLUDED__
+
+#include "platform.hpp"
+
+#ifdef HAVE_LIBSODIUM
+#include <sodium.h>
+
+#if crypto_box_NONCEBYTES != 24 \
+|| crypto_box_PUBLICKEYBYTES != 32 \
+|| crypto_box_SECRETKEYBYTES != 32 \
+|| crypto_box_ZEROBYTES != 32 \
+|| crypto_box_BOXZEROBYTES != 16 \
+|| crypto_secretbox_NONCEBYTES != 24 \
+|| crypto_secretbox_ZEROBYTES != 32 \
+|| crypto_secretbox_BOXZEROBYTES != 16
+#error "libsodium not built properly"
+#endif
+
+#include "mechanism.hpp"
+#include "options.hpp"
+
+namespace zmq
+{
+
+ class msg_t;
+ class session_base_t;
+
+ class curve_server_t : public mechanism_t
+ {
+ public:
+
+ curve_server_t (session_base_t *session_,
+ const std::string &peer_address_,
+ const options_t &options_);
+ virtual ~curve_server_t ();
+
+ // mechanism implementation
+ virtual int next_handshake_command (msg_t *msg_);
+ virtual int process_handshake_command (msg_t *msg_);
+ virtual int encode (msg_t *msg_);
+ virtual int decode (msg_t *msg_);
+ virtual int zap_msg_available ();
+ virtual bool is_handshake_complete () const;
+
+ private:
+
+ enum state_t {
+ expect_hello,
+ send_welcome,
+ expect_initiate,
+ expect_zap_reply,
+ send_ready,
+ connected
+ };
+
+ session_base_t * const session;
+
+ const std::string peer_address;
+
+ // Current FSM state
+ state_t state;
+
+ // True iff we are awaiting reply from ZAP handler.
+ bool expecting_zap_reply;
+
+ uint64_t cn_nonce;
+
+ // Our secret key (s)
+ uint8_t secret_key [crypto_box_SECRETKEYBYTES];
+
+ // Our short-term public key (S')
+ uint8_t cn_public [crypto_box_PUBLICKEYBYTES];
+
+ // Our short-term secret key (s')
+ uint8_t cn_secret [crypto_box_SECRETKEYBYTES];
+
+ // Client's short-term public key (C')
+ uint8_t cn_client [crypto_box_PUBLICKEYBYTES];
+
+ // Key used to produce cookie
+ uint8_t cookie_key [crypto_secretbox_KEYBYTES];
+
+ // Intermediary buffer used to speed up boxing and unboxing.
+ uint8_t cn_precom [crypto_box_BEFORENMBYTES];
+
+ int process_hello (msg_t *msg_);
+ int produce_welcome (msg_t *msg_);
+ int process_initiate (msg_t *msg_);
+ int produce_ready (msg_t *msg_);
+
+ void send_zap_request (const uint8_t *key);
+ int receive_and_process_zap_reply ();
+ };
+
+}
+
+#endif
+
+#endif
+
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __ZMQ_DBUFFER_HPP_INCLUDED__
+#define __ZMQ_DBUFFER_HPP_INCLUDED__
+
+#include <stdlib.h>
+#include <stddef.h>
+#include <algorithm>
+
+#include "mutex.hpp"
+#include "msg.hpp"
+
+namespace zmq
+{
+
+ // dbuffer is a single-producer single-consumer double-buffer
+ // implementation.
+ //
+ // The producer writes to a back buffer and then tries to swap
+ // pointers between the back and front buffers. If it fails,
+ // due to the consumer reading from the front buffer, it just
+ // gives up, which is ok since writes are many and redundant.
+ //
+ // The reader simply reads from the front buffer.
+ //
+ // has_msg keeps track of whether there has been a not yet read
+ // value written, it is used by ypipe_conflate to mimic ypipe
+ // functionality regarding a reader being asleep
+
+ template <typename T> class dbuffer_t;
+
+ template <> class dbuffer_t<msg_t>
+ {
+ public:
+
+ inline dbuffer_t ()
+ : back (&storage[0])
+ , front (&storage[1])
+ , has_msg (false)
+ {
+ back->init ();
+ front->init ();
+ }
+
+ inline ~dbuffer_t()
+ {
+ back->close ();
+ front->close ();
+ }
+
+ inline void write (const msg_t &value_)
+ {
+ msg_t& xvalue = const_cast<msg_t&>(value_);
+
+ zmq_assert (xvalue.check ());
+ back->move (xvalue); // cannot just overwrite, might leak
+
+ zmq_assert (back->check ());
+
+ if (sync.try_lock ())
+ {
+ std::swap (back, front);
+ has_msg = true;
+
+ sync.unlock ();
+ }
+ }
+
+ inline bool read (msg_t *value_)
+ {
+ if (!value_)
+ return false;
+
+ {
+ scoped_lock_t lock (sync);
+ if (!has_msg)
+ return false;
+
+ zmq_assert (front->check ());
+
+ *value_ = *front;
+ front->init (); // avoid double free
+
+ has_msg = false;
+ return true;
+ }
+ }
+
+
+ inline bool check_read ()
+ {
+ scoped_lock_t lock (sync);
+
+ return has_msg;
+ }
+
+ inline bool probe (bool (*fn)(msg_t &))
+ {
+ scoped_lock_t lock (sync);
+ return (*fn) (*front);
+ }
+
+
+ private:
+ msg_t storage[2];
+ msg_t *back, *front;
+
+ mutex_t sync;
+ bool has_msg;
+
+ // Disable copying of dbuffer.
+ dbuffer_t (const dbuffer_t&);
+ const dbuffer_t &operator = (const dbuffer_t&);
+ };
+}
+
+#endif
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2011 VMware, Inc.
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
zmq::dealer_t::dealer_t (class ctx_t *parent_, uint32_t tid_, int sid_) :
socket_base_t (parent_, tid_, sid_),
- prefetched (false)
+ probe_router (false)
{
options.type = ZMQ_DEALER;
-
- // TODO: Uncomment the following line when DEALER will become true DEALER
- // rather than generic dealer socket.
- // If the socket is closing we can drop all the outbound requests. There'll
- // be noone to receive the replies anyway.
- // options.delay_on_close = false;
-
- options.recv_identity = true;
-
- prefetched_msg.init ();
}
zmq::dealer_t::~dealer_t ()
{
- prefetched_msg.close ();
}
-void zmq::dealer_t::xattach_pipe (pipe_t *pipe_, bool icanhasall_)
+void zmq::dealer_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_)
{
- // icanhasall_ is unused
- (void) icanhasall_;
+ // subscribe_to_all_ is unused
+ (void) subscribe_to_all_;
zmq_assert (pipe_);
+
+ if (probe_router) {
+ msg_t probe_msg_;
+ int rc = probe_msg_.init ();
+ errno_assert (rc == 0);
+
+ rc = pipe_->write (&probe_msg_);
+ // zmq_assert (rc) is not applicable here, since it is not a bug.
+ pipe_->flush ();
+
+ rc = probe_msg_.close ();
+ errno_assert (rc == 0);
+ }
+
fq.attach (pipe_);
lb.attach (pipe_);
}
-int zmq::dealer_t::xsend (msg_t *msg_, int flags_)
+int zmq::dealer_t::xsetsockopt (int option_, const void *optval_,
+ size_t optvallen_)
{
- return lb.send (msg_, flags_);
+ bool is_int = (optvallen_ == sizeof (int));
+ int value = is_int? *((int *) optval_): 0;
+
+ switch (option_) {
+ case ZMQ_PROBE_ROUTER:
+ if (is_int && value >= 0) {
+ probe_router = (value != 0);
+ return 0;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ errno = EINVAL;
+ return -1;
}
-int zmq::dealer_t::xrecv (msg_t *msg_, int flags_)
+int zmq::dealer_t::xsend (msg_t *msg_)
{
- // flags_ is unused
- (void)flags_;
-
- // If there is a prefetched message, return it.
- if (prefetched) {
- int rc = msg_->move (prefetched_msg);
- errno_assert (rc == 0);
- prefetched = false;
- return 0;
- }
+ return sendpipe (msg_, NULL);
+}
- // DEALER socket doesn't use identities. We can safely drop it and
- while (true) {
- int rc = fq.recv (msg_);
- if (rc != 0)
- return rc;
- if (likely (!(msg_->flags () & msg_t::identity)))
- break;
- }
- return 0;
+int zmq::dealer_t::xrecv (msg_t *msg_)
+{
+ return recvpipe (msg_, NULL);
}
bool zmq::dealer_t::xhas_in ()
{
- // We may already have a message pre-fetched.
- if (prefetched)
- return true;
-
- // Try to read the next message to the pre-fetch buffer.
- int rc = dealer_t::xrecv (&prefetched_msg, ZMQ_DONTWAIT);
- if (rc != 0 && errno == EAGAIN)
- return false;
- errno_assert (rc == 0);
- prefetched = true;
- return true;
+ return fq.has_in ();
}
bool zmq::dealer_t::xhas_out ()
lb.activated (pipe_);
}
-void zmq::dealer_t::xterminated (pipe_t *pipe_)
+void zmq::dealer_t::xpipe_terminated (pipe_t *pipe_)
{
- fq.terminated (pipe_);
- lb.terminated (pipe_);
+ fq.pipe_terminated (pipe_);
+ lb.pipe_terminated (pipe_);
}
-zmq::dealer_session_t::dealer_session_t (io_thread_t *io_thread_, bool connect_,
- socket_base_t *socket_, const options_t &options_,
- const address_t *addr_) :
- session_base_t (io_thread_, connect_, socket_, options_, addr_)
+int zmq::dealer_t::sendpipe (msg_t *msg_, pipe_t **pipe_)
{
+ return lb.sendpipe (msg_, pipe_);
}
-zmq::dealer_session_t::~dealer_session_t ()
+int zmq::dealer_t::recvpipe (msg_t *msg_, pipe_t **pipe_)
{
+ return fq.recvpipe (msg_, pipe_);
}
-
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
protected:
// Overloads of functions from socket_base_t.
- void xattach_pipe (zmq::pipe_t *pipe_, bool icanhasall_);
- int xsend (zmq::msg_t *msg_, int flags_);
- int xrecv (zmq::msg_t *msg_, int flags_);
+ void xattach_pipe (zmq::pipe_t *pipe_, bool subscribe_to_all_);
+ int xsetsockopt (int option_, const void *optval_, size_t optvallen_);
+ int xsend (zmq::msg_t *msg_);
+ int xrecv (zmq::msg_t *msg_);
bool xhas_in ();
bool xhas_out ();
void xread_activated (zmq::pipe_t *pipe_);
void xwrite_activated (zmq::pipe_t *pipe_);
- void xterminated (zmq::pipe_t *pipe_);
+ void xpipe_terminated (zmq::pipe_t *pipe_);
+
+ // Send and recv - knowing which pipe was used.
+ int sendpipe (zmq::msg_t *msg_, zmq::pipe_t **pipe_);
+ int recvpipe (zmq::msg_t *msg_, zmq::pipe_t **pipe_);
private:
fq_t fq;
lb_t lb;
- // Have we prefetched a message.
- bool prefetched;
-
- // Holds the prefetched message.
- msg_t prefetched_msg;
+ // if true, send an empty message to every connected router peer
+ bool probe_router;
dealer_t (const dealer_t&);
const dealer_t &operator = (const dealer_t&);
};
- class dealer_session_t : public session_base_t
- {
- public:
-
- dealer_session_t (zmq::io_thread_t *io_thread_, bool connect_,
- zmq::socket_base_t *socket_, const options_t &options_,
- const address_t *addr_);
- ~dealer_session_t ();
-
- private:
-
- dealer_session_t (const dealer_session_t&);
- const dealer_session_t &operator = (const dealer_session_t&);
- };
-
}
#endif
+++ /dev/null
-/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
-
- This file is part of 0MQ.
-
- 0MQ is free software; you can redistribute it and/or modify it under
- the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- 0MQ is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include <stdlib.h>
-#include <string.h>
-#include <limits>
-
-#include "platform.hpp"
-#if defined ZMQ_HAVE_WINDOWS
-#include "windows.hpp"
-#endif
-
-#include "decoder.hpp"
-#include "i_msg_sink.hpp"
-#include "likely.hpp"
-#include "wire.hpp"
-#include "err.hpp"
-
-zmq::decoder_t::decoder_t (size_t bufsize_, int64_t maxmsgsize_) :
- decoder_base_t <decoder_t> (bufsize_),
- msg_sink (NULL),
- maxmsgsize (maxmsgsize_)
-{
- int rc = in_progress.init ();
- errno_assert (rc == 0);
-
- // At the beginning, read one byte and go to one_byte_size_ready state.
- next_step (tmpbuf, 1, &decoder_t::one_byte_size_ready);
-}
-
-zmq::decoder_t::~decoder_t ()
-{
- int rc = in_progress.close ();
- errno_assert (rc == 0);
-}
-
-void zmq::decoder_t::set_msg_sink (i_msg_sink *msg_sink_)
-{
- msg_sink = msg_sink_;
-}
-
-bool zmq::decoder_t::one_byte_size_ready ()
-{
- // First byte of size is read. If it is 0xff read 8-byte size.
- // Otherwise allocate the buffer for message data and read the
- // message data into it.
- if (*tmpbuf == 0xff)
- next_step (tmpbuf, 8, &decoder_t::eight_byte_size_ready);
- else {
-
- // There has to be at least one byte (the flags) in the message).
- if (!*tmpbuf) {
- decoding_error ();
- return false;
- }
-
- // in_progress is initialised at this point so in theory we should
- // close it before calling zmq_msg_init_size, however, it's a 0-byte
- // message and thus we can treat it as uninitialised...
- int rc;
- if (maxmsgsize >= 0 && (int64_t) (*tmpbuf - 1) > maxmsgsize) {
- rc = -1;
- errno = ENOMEM;
- }
- else
- rc = in_progress.init_size (*tmpbuf - 1);
- if (rc != 0 && errno == ENOMEM) {
- rc = in_progress.init ();
- errno_assert (rc == 0);
- decoding_error ();
- return false;
- }
- errno_assert (rc == 0);
-
- next_step (tmpbuf, 1, &decoder_t::flags_ready);
- }
- return true;
-}
-
-bool zmq::decoder_t::eight_byte_size_ready ()
-{
- // 8-byte payload length is read. Allocate the buffer
- // for message body and read the message data into it.
- const uint64_t payload_length = get_uint64 (tmpbuf);
-
- // There has to be at least one byte (the flags) in the message).
- if (payload_length == 0) {
- decoding_error ();
- return false;
- }
-
- // Message size must not exceed the maximum allowed size.
- if (maxmsgsize >= 0 && payload_length - 1 > (uint64_t) maxmsgsize) {
- decoding_error ();
- return false;
- }
-
- // Message size must fit within range of size_t data type.
- if (payload_length - 1 > std::numeric_limits <size_t>::max ()) {
- decoding_error ();
- return false;
- }
-
- const size_t msg_size = static_cast <size_t> (payload_length - 1);
-
- // in_progress is initialised at this point so in theory we should
- // close it before calling init_size, however, it's a 0-byte
- // message and thus we can treat it as uninitialised...
- int rc = in_progress.init_size (msg_size);
- if (rc != 0) {
- errno_assert (errno == ENOMEM);
- rc = in_progress.init ();
- errno_assert (rc == 0);
- decoding_error ();
- return false;
- }
-
- next_step (tmpbuf, 1, &decoder_t::flags_ready);
- return true;
-}
-
-bool zmq::decoder_t::flags_ready ()
-{
- // Store the flags from the wire into the message structure.
- in_progress.set_flags (tmpbuf [0] & msg_t::more);
-
- next_step (in_progress.data (), in_progress.size (),
- &decoder_t::message_ready);
-
- return true;
-}
-
-bool zmq::decoder_t::message_ready ()
-{
- // Message is completely read. Push it further and start reading
- // new message. (in_progress is a 0-byte message after this point.)
- if (unlikely (!msg_sink))
- return false;
- int rc = msg_sink->push_msg (&in_progress);
- if (unlikely (rc != 0)) {
- if (errno != EAGAIN)
- decoding_error ();
- return false;
- }
-
- next_step (tmpbuf, 1, &decoder_t::one_byte_size_ready);
- return true;
-}
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
namespace zmq
{
-
- class i_msg_sink;
-
// Helper base class for decoders that know the amount of data to read
// in advance at any moment. Knowing the amount in advance is a property
// of the protocol used. 0MQ framing protocol is based size-prefixed
// Processes the data in the buffer previously allocated using
// get_buffer function. size_ argument specifies nemuber of bytes
- // actually filled into the buffer. Function returns number of
- // bytes actually processed.
- inline size_t process_buffer (unsigned char *data_, size_t size_)
+ // actually filled into the buffer. Function returns 1 when the
+ // whole message was decoded or 0 when more data is required.
+ // On error, -1 is returned and errno set accordingly.
+ // Number of bytes processed is returned in byts_used_.
+ inline int decode (const unsigned char *data_, size_t size_,
+ size_t &bytes_used_)
{
- // Check if we had an error in previous attempt.
- if (unlikely (!(static_cast <T*> (this)->next)))
- return (size_t) -1;
+ bytes_used_ = 0;
// In case of zero-copy simply adjust the pointers, no copying
// is required. Also, run the state machine in case all the data
// were processed.
if (data_ == read_pos) {
+ zmq_assert (size_ <= to_read);
read_pos += size_;
to_read -= size_;
+ bytes_used_ = size_;
while (!to_read) {
- if (!(static_cast <T*> (this)->*next) ()) {
- if (unlikely (!(static_cast <T*> (this)->next)))
- return (size_t) -1;
- return size_;
- }
+ const int rc = (static_cast <T*> (this)->*next) ();
+ if (rc != 0)
+ return rc;
}
- return size_;
+ return 0;
}
- size_t pos = 0;
- while (true) {
-
- // Try to get more space in the message to fill in.
- // If none is available, return.
- while (!to_read) {
- if (!(static_cast <T*> (this)->*next) ()) {
- if (unlikely (!(static_cast <T*> (this)->next)))
- return (size_t) -1;
- return pos;
- }
- }
-
- // If there are no more data in the buffer, return.
- if (pos == size_)
- return pos;
-
+ while (bytes_used_ < size_) {
// Copy the data from buffer to the message.
- size_t to_copy = std::min (to_read, size_ - pos);
- memcpy (read_pos, data_ + pos, to_copy);
+ const size_t to_copy = std::min (to_read, size_ - bytes_used_);
+ memcpy (read_pos, data_ + bytes_used_, to_copy);
read_pos += to_copy;
- pos += to_copy;
to_read -= to_copy;
- }
- }
-
- // Returns true if the decoder has been fed all required data
- // but cannot proceed with the next decoding step.
- // False is returned if the decoder has encountered an error.
- bool stalled ()
- {
- // Check whether there was decoding error.
- if (unlikely (static_cast <T*> (this)->next == NULL))
- return false;
-
- while (!to_read) {
- if (!(static_cast <T*> (this)->*next) ()) {
- if (unlikely (!(static_cast <T*> (this)->next)))
- return false;
- return true;
+ bytes_used_ += to_copy;
+ // Try to get more space in the message to fill in.
+ // If none is available, return.
+ while (to_read == 0) {
+ const int rc = (static_cast <T*> (this)->*next) ();
+ if (rc != 0)
+ return rc;
}
}
- return false;
- }
-
- inline bool message_ready_size (size_t msg_sz)
- {
- zmq_assert (false);
- return false;
+ return 0;
}
protected:
// Prototype of state machine action. Action should return false if
// it is unable to push the data to the system.
- typedef bool (T::*step_t) ();
+ typedef int (T::*step_t) ();
// This function should be called from derived class to read data
// from the buffer and schedule next state machine action.
- inline void next_step (void *read_pos_, size_t to_read_,
- step_t next_)
+ inline void next_step (void *read_pos_, size_t to_read_, step_t next_)
{
read_pos = (unsigned char*) read_pos_;
to_read = to_read_;
next = next_;
}
- // This function should be called from the derived class to
- // abort decoder state machine.
- inline void decoding_error ()
- {
- next = NULL;
- }
-
private:
// Next step. If set to NULL, it means that associated data stream
decoder_base_t (const decoder_base_t&);
const decoder_base_t &operator = (const decoder_base_t&);
};
-
- // Decoder for 0MQ framing protocol. Converts data batches into messages.
-
- class decoder_t : public decoder_base_t <decoder_t>
- {
- public:
-
- decoder_t (size_t bufsize_, int64_t maxmsgsize_);
- ~decoder_t ();
-
- // Set the receiver of decoded messages.
- void set_msg_sink (i_msg_sink *msg_sink_);
-
- private:
-
- bool one_byte_size_ready ();
- bool eight_byte_size_ready ();
- bool flags_ready ();
- bool message_ready ();
-
- i_msg_sink *msg_sink;
- unsigned char tmpbuf [8];
- msg_t in_progress;
-
- int64_t maxmsgsize;
-
- decoder_t (const decoder_t&);
- void operator = (const decoder_t&);
- };
-
}
#endif
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
stopping = true;
}
+int zmq::devpoll_t::max_fds ()
+{
+ return -1;
+}
+
void zmq::devpoll_t::loop ()
{
while (!stopping) {
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
void start ();
void stop ();
+ static int max_fds ();
+
private:
// Main worker thread routine.
/*
- Copyright (c) 2011 250bpm s.r.o.
- Copyright (c) 2011 VMware, Inc.
- Copyright (c) 2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
matching = 0;
}
-void zmq::dist_t::terminated (pipe_t *pipe_)
+void zmq::dist_t::pipe_terminated (pipe_t *pipe_)
{
// Remove the pipe from the list; adjust number of matching, active and/or
// eligible pipes accordingly.
- if (pipes.index (pipe_) < matching)
+ if (pipes.index (pipe_) < matching) {
+ pipes.swap (pipes.index (pipe_), matching - 1);
matching--;
- if (pipes.index (pipe_) < active)
+ }
+ if (pipes.index (pipe_) < active) {
+ pipes.swap (pipes.index (pipe_), active - 1);
active--;
- if (pipes.index (pipe_) < eligible)
+ }
+ if (pipes.index (pipe_) < eligible) {
+ pipes.swap (pipes.index (pipe_), eligible - 1);
eligible--;
+ }
+
pipes.erase (pipe_);
}
}
}
-int zmq::dist_t::send_to_all (msg_t *msg_, int flags_)
+int zmq::dist_t::send_to_all (msg_t *msg_)
{
matching = active;
- return send_to_matching (msg_, flags_);
+ return send_to_matching (msg_);
}
-int zmq::dist_t::send_to_matching (msg_t *msg_, int flags_)
+int zmq::dist_t::send_to_matching (msg_t *msg_)
{
// Is this end of a multipart message?
bool msg_more = msg_->flags () & msg_t::more ? true : false;
// Push the message to matching pipes.
- distribute (msg_, flags_);
+ distribute (msg_);
// If mutlipart message is fully sent, activate all the eligible pipes.
if (!msg_more)
return 0;
}
-void zmq::dist_t::distribute (msg_t *msg_, int flags_)
+void zmq::dist_t::distribute (msg_t *msg_)
{
- // flags_ is unused
- (void)flags_;
-
// If there are no matching pipes available, simply drop the message.
if (matching == 0) {
int rc = msg_->close ();
/*
- Copyright (c) 2011 250bpm s.r.o.
- Copyright (c) 2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
void unmatch ();
// Removes the pipe from the distributor object.
- void terminated (zmq::pipe_t *pipe_);
+ void pipe_terminated (zmq::pipe_t *pipe_);
// Send the message to the matching outbound pipes.
- int send_to_matching (zmq::msg_t *msg_, int flags_);
+ int send_to_matching (zmq::msg_t *msg_);
// Send the message to all the outbound pipes.
- int send_to_all (zmq::msg_t *msg_, int flags_);
+ int send_to_all (zmq::msg_t *msg_);
bool has_out ();
bool write (zmq::pipe_t *pipe_, zmq::msg_t *msg_);
// Put the message to all active pipes.
- void distribute (zmq::msg_t *msg_, int flags_);
+ void distribute (zmq::msg_t *msg_);
// List of outbound pipes.
typedef array_t <zmq::pipe_t, 2> pipes_t;
+++ /dev/null
-/*
- Copyright (c) 2007-2012 iMatix Corporation
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2011 VMware, Inc.
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
-
- This file is part of 0MQ.
-
- 0MQ is free software; you can redistribute it and/or modify it under
- the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- 0MQ is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "encoder.hpp"
-#include "i_msg_source.hpp"
-#include "likely.hpp"
-#include "wire.hpp"
-
-zmq::encoder_t::encoder_t (size_t bufsize_) :
- encoder_base_t <encoder_t> (bufsize_),
- msg_source (NULL)
-{
- int rc = in_progress.init ();
- errno_assert (rc == 0);
-
- // Write 0 bytes to the batch and go to message_ready state.
- next_step (NULL, 0, &encoder_t::message_ready, true);
-}
-
-zmq::encoder_t::~encoder_t ()
-{
- int rc = in_progress.close ();
- errno_assert (rc == 0);
-}
-
-void zmq::encoder_t::set_msg_source (i_msg_source *msg_source_)
-{
- msg_source = msg_source_;
-}
-
-bool zmq::encoder_t::size_ready ()
-{
- // Write message body into the buffer.
- next_step (in_progress.data (), in_progress.size (),
- &encoder_t::message_ready, !(in_progress.flags () & msg_t::more));
- return true;
-}
-
-bool zmq::encoder_t::message_ready ()
-{
- // Destroy content of the old message.
- int rc = in_progress.close ();
- errno_assert (rc == 0);
-
- // Read new message. If there is none, return false.
- // Note that new state is set only if write is successful. That way
- // unsuccessful write will cause retry on the next state machine
- // invocation.
- if (unlikely (!msg_source)) {
- rc = in_progress.init ();
- errno_assert (rc == 0);
- return false;
- }
- rc = msg_source->pull_msg (&in_progress);
- if (unlikely (rc != 0)) {
- errno_assert (errno == EAGAIN);
- rc = in_progress.init ();
- errno_assert (rc == 0);
- return false;
- }
-
- // Get the message size.
- size_t size = in_progress.size ();
-
- // Account for the 'flags' byte.
- size++;
-
- // For messages less than 255 bytes long, write one byte of message size.
- // For longer messages write 0xff escape character followed by 8-byte
- // message size. In both cases 'flags' field follows.
- if (size < 255) {
- tmpbuf [0] = (unsigned char) size;
- tmpbuf [1] = (in_progress.flags () & msg_t::more);
- next_step (tmpbuf, 2, &encoder_t::size_ready, false);
- }
- else {
- tmpbuf [0] = 0xff;
- put_uint64 (tmpbuf + 1, size);
- tmpbuf [9] = (in_progress.flags () & msg_t::more);
- next_step (tmpbuf, 10, &encoder_t::size_ready, false);
- }
- return true;
-}
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
namespace zmq
{
- class i_msg_source;
-
// Helper base class for encoders. It implements the state machine that
// fills the outgoing buffer. Derived classes should implement individual
// state machine actions.
public:
inline encoder_base_t (size_t bufsize_) :
- bufsize (bufsize_)
+ bufsize (bufsize_),
+ in_progress (NULL)
{
buf = (unsigned char*) malloc (bufsize_);
alloc_assert (buf);
// The function returns a batch of binary data. The data
// are filled to a supplied buffer. If no buffer is supplied (data_
// points to NULL) decoder object will provide buffer of its own.
- // If offset is not NULL, it is filled by offset of the first message
- // in the batch.If there's no beginning of a message in the batch,
- // offset is set to -1.
- inline void get_data (unsigned char **data_, size_t *size_,
- int *offset_ = NULL)
+ inline size_t encode (unsigned char **data_, size_t size_)
{
unsigned char *buffer = !*data_ ? buf : *data_;
- size_t buffersize = !*data_ ? bufsize : *size_;
+ size_t buffersize = !*data_ ? bufsize : size_;
- if (offset_)
- *offset_ = -1;
+ if (in_progress == NULL)
+ return 0;
size_t pos = 0;
while (pos < buffersize) {
// If there are still no data, return what we already have
// in the buffer.
if (!to_write) {
- // If we are to encode the beginning of a new message,
- // adjust the message offset.
- if (beginning)
- if (offset_ && *offset_ == -1)
- *offset_ = static_cast <int> (pos);
-
- if (!(static_cast <T*> (this)->*next) ())
+ if (new_msg_flag) {
+ int rc = in_progress->close ();
+ errno_assert (rc == 0);
+ rc = in_progress->init ();
+ errno_assert (rc == 0);
+ in_progress = NULL;
break;
+ }
+ (static_cast <T*> (this)->*next) ();
}
// If there are no data in the buffer yet and we are able to
// amounts of time.
if (!pos && !*data_ && to_write >= buffersize) {
*data_ = write_pos;
- *size_ = to_write;
+ pos = to_write;
write_pos = NULL;
to_write = 0;
- return;
+ return pos;
}
// Copy data to the buffer. If the buffer is full, return.
}
*data_ = buffer;
- *size_ = pos;
+ return pos;
+ }
+
+ void load_msg (msg_t *msg_)
+ {
+ zmq_assert (in_progress == NULL);
+ in_progress = msg_;
+ (static_cast <T*> (this)->*next) ();
}
protected:
// Prototype of state machine action.
- typedef bool (T::*step_t) ();
+ typedef void (T::*step_t) ();
// This function should be called from derived class to write the data
- // to the buffer and schedule next state machine action. Set beginning
- // to true when you are writing first byte of a message.
+ // to the buffer and schedule next state machine action.
inline void next_step (void *write_pos_, size_t to_write_,
- step_t next_, bool beginning_)
+ step_t next_, bool new_msg_flag_)
{
write_pos = (unsigned char*) write_pos_;
to_write = to_write_;
next = next_;
- beginning = beginning_;
+ new_msg_flag = new_msg_flag_;
}
private:
// is dead.
step_t next;
- // If true, first byte of the message is being written.
- bool beginning;
+ bool new_msg_flag;
// The buffer for encoded data.
size_t bufsize;
encoder_base_t (const encoder_base_t&);
void operator = (const encoder_base_t&);
- };
- // Encoder for 0MQ framing protocol. Converts messages into data batches.
-
- class encoder_t : public encoder_base_t <encoder_t>
- {
- public:
-
- encoder_t (size_t bufsize_);
- ~encoder_t ();
-
- void set_msg_source (i_msg_source *msg_source_);
-
- private:
-
- bool size_ready ();
- bool message_ready ();
+ protected:
- i_msg_source *msg_source;
- msg_t in_progress;
- unsigned char tmpbuf [10];
+ msg_t *in_progress;
- encoder_t (const encoder_t&);
- const encoder_t &operator = (const encoder_t&);
};
}
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
stopping = true;
}
+int zmq::epoll_t::max_fds ()
+{
+ return -1;
+}
+
void zmq::epoll_t::loop ()
{
epoll_event ev_buf [max_io_events];
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
void start ();
void stop ();
+ static int max_fds ();
+
private:
// Main worker thread routine.
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
void zmq::win_error (char *buffer_, size_t buffer_size_)
{
DWORD errcode = GetLastError ();
-#if defined WINCE
+#if defined _WIN32_WCE
DWORD rc = FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS, NULL, errcode, MAKELANGID(LANG_NEUTRAL,
SUBLANG_DEFAULT), (LPWSTR)buffer_, buffer_size_ / sizeof(wchar_t), NULL );
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
#include "../include/zmq.h"
#include <assert.h>
-#if defined WINCE
+#if defined _WIN32_WCE
#include "..\builds\msvc\errno.hpp"
#else
#include <errno.h>
#include <netdb.h>
#endif
+// EPROTO is not used by OpenBSD and maybe other platforms.
+#ifndef EPROTO
+#define EPROTO 0
+#endif
+
namespace zmq
{
const char *errno_to_string (int errno_);
/*
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2011 VMware, Inc.
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
active++;
}
-void zmq::fq_t::terminated (pipe_t *pipe_)
+void zmq::fq_t::pipe_terminated (pipe_t *pipe_)
{
const pipes_t::size_type index = pipes.index (pipe_);
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
void attach (pipe_t *pipe_);
void activated (pipe_t *pipe_);
- void terminated (pipe_t *pipe_);
+ void pipe_terminated (pipe_t *pipe_);
int recv (msg_t *msg_);
int recvpipe (msg_t *msg_, pipe_t **pipe_);
/*
- Copyright (c) 2007-2012 iMatix Corporation
- Copyright (c) 2007-2012 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
namespace zmq
{
- class i_msg_sink;
+ class msg_t;
// Interface to be implemented by message decoder.
- struct i_decoder
+ class i_decoder
{
+ public:
virtual ~i_decoder () {}
- virtual void set_msg_sink (i_msg_sink *msg_sink_) = 0;
-
virtual void get_buffer (unsigned char **data_, size_t *size_) = 0;
- virtual size_t process_buffer (unsigned char *data_, size_t size_) = 0;
-
- virtual bool stalled () = 0;
+ // Decodes data pointed to by data_.
+ // When a message is decoded, 1 is returned.
+ // When the decoder needs more data, 0 is returnd.
+ // On error, -1 is returned and errno is set accordingly.
+ virtual int decode (const unsigned char *data_, size_t size_,
+ size_t &processed) = 0;
+ virtual msg_t *msg () = 0;
};
}
/*
- Copyright (c) 2007-2012 iMatix Corporation
- Copyright (c) 2007-2012 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
{
// Forward declaration
- class i_msg_source;
+ class msg_t;
// Interface to be implemented by message encoder.
{
virtual ~i_encoder () {}
- // Set message producer.
- virtual void set_msg_source (i_msg_source *msg_source_) = 0;
-
// The function returns a batch of binary data. The data
// are filled to a supplied buffer. If no buffer is supplied (data_
// is NULL) encoder will provide buffer of its own.
- // If offset is not NULL, it is filled by offset of the first message
- // in the batch.If there's no beginning of a message in the batch,
- // offset is set to -1.
- virtual void get_data (unsigned char **data_, size_t *size_,
- int *offset_ = NULL) = 0;
+ // Function returns 0 when a new message is required.
+ virtual size_t encode (unsigned char **data_, size_t size) = 0;
+
+ // Load a new message into encoder.
+ virtual void load_msg (msg_t *msg_) = 0;
};
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
// This method is called by the session to signalise that more
// messages can be written to the pipe.
- virtual void activate_in () = 0;
+ virtual void restart_input () = 0;
// This method is called by the session to signalise that there
// are messages to send available.
- virtual void activate_out () = 0;
+ virtual void restart_output () = 0;
+
+ virtual void zap_msg_available () = 0;
};
}
+++ /dev/null
-/*
- Copyright (c) 2007-2012 iMatix Corporation
- Copyright (c) 2007-2012 Other contributors as noted in the AUTHORS file
-
- This file is part of 0MQ.
-
- 0MQ is free software; you can redistribute it and/or modify it under
- the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- 0MQ is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef __ZMQ_I_MSG_SINK_HPP_INCLUDED__
-#define __ZMQ_I_MSG_SINK_HPP_INCLUDED__
-
-namespace zmq
-{
-
- // Forward declaration
- class msg_t;
-
- // Interface to be implemented by message sink.
-
- struct i_msg_sink
- {
- virtual ~i_msg_sink () {}
-
- // Delivers a message. Returns 0 if successful; -1 otherwise.
- // The function takes ownership of the passed message.
- virtual int push_msg (msg_t *msg_) = 0;
- };
-
-}
-
-#endif
+++ /dev/null
-/*
- Copyright (c) 2007-2012 iMatix Corporation
- Copyright (c) 2007-2012 Other contributors as noted in the AUTHORS file
-
- This file is part of 0MQ.
-
- 0MQ is free software; you can redistribute it and/or modify it under
- the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- 0MQ is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef __ZMQ_I_MSG_SOURCE_HPP_INCLUDED__
-#define __ZMQ_I_MSG_SOURCE_HPP_INCLUDED__
-
-namespace zmq
-{
-
- // Forward declaration
- class msg_t;
-
- // Interface to be implemented by message source.
-
- struct i_msg_source
- {
- virtual ~i_msg_source () {}
-
- // Fetch a message. Returns 0 if successful; -1 otherwise.
- // The caller is responsible for freeing the message when no
- // longer used.
- virtual int pull_msg (msg_t *msg_) = 0;
- };
-
-}
-
-#endif
/*
- Copyright (c) 2010-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
/*
- Copyright (c) 2010-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
#include <fcntl.h>
#include <sys/types.h>
#include <sys/socket.h>
+#include <netdb.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#endif
void zmq::unblock_socket (fd_t s_)
{
-#ifdef ZMQ_HAVE_WINDOWS
+#if defined ZMQ_HAVE_WINDOWS
u_long nonblock = 1;
int rc = ioctlsocket (s_, FIONBIO, &nonblock);
wsa_assert (rc != SOCKET_ERROR);
-#elif ZMQ_HAVE_OPENVMS
+#elif defined ZMQ_HAVE_OPENVMS
int nonblock = 1;
int rc = ioctl (s_, FIONBIO, &nonblock);
errno_assert (rc != -1);
void zmq::enable_ipv4_mapping (fd_t s_)
{
+ (void) s_;
+
#ifdef IPV6_V6ONLY
#ifdef ZMQ_HAVE_WINDOWS
DWORD flag = 0;
#endif
#endif
}
+
+bool zmq::get_peer_ip_address (fd_t sockfd_, std::string &ip_addr_)
+{
+ int rc;
+ struct sockaddr_storage ss;
+
+#if defined ZMQ_HAVE_HPUX || defined ZMQ_HAVE_WINDOWS
+ int addrlen = static_cast <int> (sizeof ss);
+#else
+ socklen_t addrlen = sizeof ss;
+#endif
+ rc = getpeername (sockfd_, (struct sockaddr*) &ss, &addrlen);
+#ifdef ZMQ_HAVE_WINDOWS
+ if (rc == SOCKET_ERROR) {
+ wsa_assert (WSAGetLastError () != WSANOTINITIALISED &&
+ WSAGetLastError () != WSAEFAULT &&
+ WSAGetLastError () != WSAEINPROGRESS &&
+ WSAGetLastError () != WSAENOTSOCK);
+ return false;
+ }
+#else
+ if (rc == -1) {
+ errno_assert (errno != EBADF &&
+ errno != EFAULT &&
+ errno != EINVAL &&
+ errno != ENOTSOCK);
+ return false;
+ }
+#endif
+
+ char host [NI_MAXHOST];
+ rc = getnameinfo ((struct sockaddr*) &ss, addrlen, host, sizeof host,
+ NULL, 0, NI_NUMERICHOST);
+ if (rc != 0)
+ return false;
+
+ ip_addr_ = host;
+ return true;
+}
/*
- Copyright (c) 2010-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
#ifndef __ZMQ_IP_HPP_INCLUDED__
#define __ZMQ_IP_HPP_INCLUDED__
+#include <string>
#include "fd.hpp"
namespace zmq
// Enable IPv4-mapping of addresses in case it is disabled by default.
void enable_ipv4_mapping (fd_t s_);
+ // Returns string representation of peer's address.
+ // Socket sockfd_ must be connected. Returns true iff successful.
+ bool get_peer_ip_address (fd_t sockfd_, std::string &ip_addr_);
+
}
-#endif
+#endif
/*
- Copyright (c) 2011 250bpm s.r.o.
- Copyright (c) 2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
errno = ENAMETOOLONG;
return -1;
}
+#if defined ZMQ_HAVE_LINUX
+ if (path_[0] == '@' && !path_[1]) {
+ errno = EINVAL;
+ return -1;
+ }
+#endif
address.sun_family = AF_UNIX;
strcpy (address.sun_path, path_);
+#if defined ZMQ_HAVE_LINUX
+ /* Abstract sockets on Linux start with '\0' */
+ if (path_[0] == '@')
+ *address.sun_path = '\0';
+#endif
return 0;
}
}
std::stringstream s;
+#if !defined ZMQ_HAVE_LINUX
s << "ipc://" << address.sun_path;
+#else
+ s << "ipc://";
+ if (!address.sun_path[0] && address.sun_path[1])
+ s << "@" << address.sun_path + 1;
+ else
+ s << address.sun_path;
+#endif
addr_ = s.str ();
return 0;
}
socklen_t zmq::ipc_address_t::addrlen () const
{
+#if defined ZMQ_HAVE_LINUX
+ if (!address.sun_path[0] && address.sun_path[1])
+ return (socklen_t) strlen(address.sun_path + 1) + sizeof (sa_family_t) + 1;
+#endif
return (socklen_t) sizeof (address);
}
/*
- Copyright (c) 2011 250bpm s.r.o.
- Copyright (c) 2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
/*
- Copyright (c) 2011 250bpm s.r.o.
- Copyright (c) 2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
return;
}
// Create the engine object for this connection.
- stream_engine_t *engine = new (std::nothrow) stream_engine_t (fd, options, endpoint);
+ stream_engine_t *engine = new (std::nothrow)
+ stream_engine_t (fd, options, endpoint);
alloc_assert (engine);
// Attach the engine to the corresponding session object.
/*
- Copyright (c) 2011 250bpm s.r.o.
- Copyright (c) 2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
/*
- Copyright (c) 2011 250bpm s.r.o.
- Copyright (c) 2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
}
// Create the engine object for this connection.
- stream_engine_t *engine = new (std::nothrow) stream_engine_t (fd, options, endpoint);
+ stream_engine_t *engine = new (std::nothrow)
+ stream_engine_t (fd, options, endpoint);
alloc_assert (engine);
// Choose I/O thread to run connecter in. Given that we are already
int zmq::ipc_listener_t::set_address (const char *addr_)
{
- // Allow wildcard file
- if (*addr_ == '*') {
- addr_ = tempnam(NULL, NULL);
+ // Create addr on stack for auto-cleanup
+ std::string addr (addr_);
+
+ // Allow wildcard file
+ if (addr[0] == '*') {
+ char *tmpstr = tempnam (NULL, NULL);
+ addr.assign (tmpstr);
+ free (tmpstr);
}
// Get rid of the file associated with the UNIX domain socket that
// may have been left behind by the previous run of the application.
- ::unlink (addr_);
+ ::unlink (addr.c_str());
filename.clear ();
// Initialise the address structure.
ipc_address_t address;
- int rc = address.resolve (addr_);
+ int rc = address.resolve (addr.c_str());
if (rc != 0)
return -1;
if (rc != 0)
goto error;
- filename.assign(addr_);
+ filename.assign (addr.c_str());
has_file = true;
- // Listen for incomming connections.
+ // Listen for incoming connections.
rc = listen (s, options.backlog);
if (rc != 0)
goto error;
/*
- Copyright (c) 2011 250bpm s.r.o.
- Copyright (c) 2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
// Create event queue
kqueue_fd = kqueue ();
errno_assert (kqueue_fd != -1);
+#ifdef HAVE_FORK
+ pid = getpid();
+#endif
}
zmq::kqueue_t::~kqueue_t ()
stopping = true;
}
+int zmq::kqueue_t::max_fds ()
+{
+ return -1;
+}
+
void zmq::kqueue_t::loop ()
{
while (!stopping) {
timespec ts = {timeout / 1000, (timeout % 1000) * 1000000};
int n = kevent (kqueue_fd, NULL, 0, &ev_buf [0], max_io_events,
timeout ? &ts: NULL);
+#ifdef HAVE_FORK
+ if (unlikely(pid != getpid())) {
+ //printf("zmq::kqueue_t::loop aborting on forked child %d\n", (int)getpid());
+ // simply exit the loop in a forked process.
+ return;
+ }
+#endif
if (n == -1) {
errno_assert (errno == EINTR);
continue;
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
#if defined ZMQ_USE_KQUEUE
#include <vector>
+#include <unistd.h>
#include "fd.hpp"
#include "thread.hpp"
void start ();
void stop ();
+ static int max_fds ();
+
private:
// Main worker thread routine.
kqueue_t (const kqueue_t&);
const kqueue_t &operator = (const kqueue_t&);
+
+#ifdef HAVE_FORK
+ // the process that created this context. Used to detect forking.
+ pid_t pid;
+#endif
};
typedef kqueue_t poller_t;
/*
- Copyright (c) 2010-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2011 VMware, Inc.
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
activated (pipe_);
}
-void zmq::lb_t::terminated (pipe_t *pipe_)
+void zmq::lb_t::pipe_terminated (pipe_t *pipe_)
{
pipes_t::size_type index = pipes.index (pipe_);
active++;
}
-int zmq::lb_t::send (msg_t *msg_, int flags_)
+int zmq::lb_t::send (msg_t *msg_)
{
- // flags_ is unused
- (void)flags_;
+ return sendpipe (msg_, NULL);
+}
+int zmq::lb_t::sendpipe (msg_t *msg_, pipe_t **pipe_)
+{
// Drop the message if required. If we are at the end of the message
// switch back to non-dropping mode.
if (dropping) {
while (active > 0) {
if (pipes [current]->write (msg_))
+ {
+ if (pipe_)
+ *pipe_ = pipes [current];
break;
+ }
zmq_assert (!more);
active--;
return -1;
}
- // If it's final part of the message we can fluch it downstream and
- // continue round-robinning (load balance).
+ // If it's final part of the message we can flush it downstream and
+ // continue round-robining (load balance).
more = msg_->flags () & msg_t::more? true: false;
if (!more) {
pipes [current]->flush ();
return false;
}
-
/*
- Copyright (c) 2010-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
void attach (pipe_t *pipe_);
void activated (pipe_t *pipe_);
- void terminated (pipe_t *pipe_);
+ void pipe_terminated (pipe_t *pipe_);
+
+ int send (msg_t *msg_);
+
+ // Sends a message and stores the pipe that was used in pipe_.
+ // It is possible for this function to return success but keep pipe_
+ // unset if the rest of a multipart message to a terminated pipe is
+ // being dropped. For the first frame, this will never happen.
+ int sendpipe (msg_t *msg_, pipe_t **pipe_);
- int send (msg_t *msg_, int flags_);
bool has_out ();
private:
--- /dev/null
+{
+ global: zmq_*;
+ local: *;
+};
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2009-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
zmq::mailbox_t::~mailbox_t ()
{
// TODO: Retrieve and deallocate commands inside the cpipe.
+
+ // Work around problem that other threads might still be in our
+ // send() method, by waiting on the mutex before disappearing.
+ sync.lock ();
+ sync.unlock ();
}
zmq::fd_t zmq::mailbox_t::get_fd ()
zmq_assert (ok);
return 0;
}
-
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
void send (const command_t &cmd_);
int recv (command_t *cmd_, int timeout_);
+#ifdef HAVE_FORK
+ // close the file descriptors in the signaller. This is used in a forked
+ // child process to close the file descriptors so that they do not interfere
+ // with the context in the parent process.
+ void forked() { signaler.forked(); }
+#endif
+
private:
// The pipe to store actual commands.
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <string.h>
+
+#include "mechanism.hpp"
+#include "options.hpp"
+#include "msg.hpp"
+#include "err.hpp"
+#include "wire.hpp"
+
+zmq::mechanism_t::mechanism_t (const options_t &options_) :
+ options (options_)
+{
+}
+
+zmq::mechanism_t::~mechanism_t ()
+{
+}
+
+void zmq::mechanism_t::set_peer_identity (const void *id_ptr, size_t id_size)
+{
+ identity = blob_t (static_cast <const unsigned char*> (id_ptr), id_size);
+}
+
+void zmq::mechanism_t::peer_identity (msg_t *msg_)
+{
+ const int rc = msg_->init_size (identity.size ());
+ errno_assert (rc == 0);
+ memcpy (msg_->data (), identity.data (), identity.size ());
+ msg_->set_flags (msg_t::identity);
+}
+
+const char *zmq::mechanism_t::socket_type_string (int socket_type) const
+{
+ static const char *names [] = {"PAIR", "PUB", "SUB", "REQ", "REP",
+ "DEALER", "ROUTER", "PULL", "PUSH",
+ "XPUB", "XSUB", "STREAM"};
+ zmq_assert (socket_type >= 0 && socket_type <= 10);
+ return names [socket_type];
+}
+
+size_t zmq::mechanism_t::add_property (unsigned char *ptr, const char *name,
+ const void *value, size_t value_len) const
+{
+ const size_t name_len = strlen (name);
+ zmq_assert (name_len <= 255);
+ *ptr++ = static_cast <unsigned char> (name_len);
+ memcpy (ptr, name, name_len);
+ ptr += name_len;
+ zmq_assert (value_len <= 0x7FFFFFFF);
+ put_uint32 (ptr, static_cast <uint32_t> (value_len));
+ ptr += 4;
+ memcpy (ptr, value, value_len);
+
+ return 1 + name_len + 4 + value_len;
+}
+
+int zmq::mechanism_t::parse_metadata (const unsigned char *ptr_,
+ size_t length_)
+{
+ size_t bytes_left = length_;
+
+ while (bytes_left > 1) {
+ const size_t name_length = static_cast <size_t> (*ptr_);
+ ptr_ += 1;
+ bytes_left -= 1;
+ if (bytes_left < name_length)
+ break;
+
+ const std::string name = std::string ((char *) ptr_, name_length);
+ ptr_ += name_length;
+ bytes_left -= name_length;
+ if (bytes_left < 4)
+ break;
+
+ const size_t value_length = static_cast <size_t> (get_uint32 (ptr_));
+ ptr_ += 4;
+ bytes_left -= 4;
+ if (bytes_left < value_length)
+ break;
+
+ const uint8_t *value = ptr_;
+ ptr_ += value_length;
+ bytes_left -= value_length;
+
+ if (name == "Identity" && options.recv_identity)
+ set_peer_identity (value, value_length);
+ else
+ if (name == "Socket-Type") {
+ const std::string socket_type ((char *) value, value_length);
+ if (!check_socket_type (socket_type)) {
+ errno = EINVAL;
+ return -1;
+ }
+ }
+ else {
+ const int rc = property (name, value, value_length);
+ if (rc == -1)
+ return -1;
+ }
+ }
+ if (bytes_left > 0) {
+ errno = EPROTO;
+ return -1;
+ }
+ return 0;
+}
+
+int zmq::mechanism_t::property (const std::string name_,
+ const void *value_, size_t length_)
+{
+ // Default implementation does not check
+ // property values and returns 0 to signal success.
+ return 0;
+}
+
+bool zmq::mechanism_t::check_socket_type (const std::string type_) const
+{
+ switch (options.type) {
+ case ZMQ_REQ:
+ return type_ == "REP" || type_ == "ROUTER";
+ case ZMQ_REP:
+ return type_ == "REQ" || type_ == "DEALER";
+ case ZMQ_DEALER:
+ return type_ == "REP" || type_ == "DEALER" || type_ == "ROUTER";
+ case ZMQ_ROUTER:
+ return type_ == "REQ" || type_ == "DEALER" || type_ == "ROUTER";
+ case ZMQ_PUSH:
+ return type_ == "PULL";
+ case ZMQ_PULL:
+ return type_ == "PUSH";
+ case ZMQ_PUB:
+ return type_ == "SUB" || type_ == "XSUB";
+ case ZMQ_SUB:
+ return type_ == "PUB" || type_ == "XPUB";
+ case ZMQ_XPUB:
+ return type_ == "SUB" || type_ == "XSUB";
+ case ZMQ_XSUB:
+ return type_ == "PUB" || type_ == "XPUB";
+ case ZMQ_PAIR:
+ return type_ == "PAIR";
+ default:
+ break;
+ }
+ return false;
+}
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __ZMQ_MECHANISM_HPP_INCLUDED__
+#define __ZMQ_MECHANISM_HPP_INCLUDED__
+
+#include "stdint.hpp"
+#include "options.hpp"
+#include "blob.hpp"
+
+namespace zmq
+{
+
+ // Abstract class representing security mechanism.
+ // Different mechanism extedns this class.
+
+ class msg_t;
+
+ class mechanism_t
+ {
+ public:
+
+ mechanism_t (const options_t &options_);
+
+ virtual ~mechanism_t ();
+
+ // Prepare next handshake command that is to be sent to the peer.
+ virtual int next_handshake_command (msg_t *msg_) = 0;
+
+ // Process the handshake command received from the peer.
+ virtual int process_handshake_command (msg_t *msg_) = 0;
+
+ virtual int encode (msg_t *msg_) { return 0; }
+
+ virtual int decode (msg_t *msg_) { return 0; }
+
+ // Notifies mechanism about availability of ZAP message.
+ virtual int zap_msg_available () { return 0; }
+
+ // True iff the handshake stage is complete?
+ virtual bool is_handshake_complete () const = 0;
+
+ void set_peer_identity (const void *id_ptr, size_t id_size);
+
+ void peer_identity (msg_t *msg_);
+
+ protected:
+
+ // Only used to identify the socket for the Socket-Type
+ // property in the wire protocol.
+ const char *socket_type_string (int socket_type) const;
+
+ size_t add_property (unsigned char *ptr, const char *name,
+ const void *value, size_t value_len) const;
+
+ // Parses a metadata.
+ // Metadata consists of a list of properties consisting of
+ // name and value as size-specified strings.
+ // Returns 0 on success and -1 on error, in which case errno is set.
+ int parse_metadata (const unsigned char *ptr_, size_t length);
+
+ // This is called by parse_property method whenever it
+ // parses a new property. The function should return 0
+ // on success and -1 on error, in which case it should
+ // set errno. Signaling error prevents parser from
+ // parsing remaining data.
+ // Derived classes are supposed to override this
+ // method to handle custom processing.
+ virtual int property (const std::string name_,
+ const void *value_, size_t length_);
+
+ options_t options;
+
+ private:
+
+ blob_t identity;
+
+ // Returns true iff socket associated with the mechanism
+ // is compatible with a given socket type 'type_'.
+ bool check_socket_type (const std::string type_) const;
+ };
+
+}
+
+#endif
/*
- Copyright (c) 2007-2012 iMatix Corporation
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
#include "err.hpp"
// Check whether the sizes of public representation of the message (zmq_msg_t)
-// and private represenation of the message (zmq::msg_t) match.
+// and private representation of the message (zmq::msg_t) match.
typedef char zmq_msg_size_check
[2 * ((sizeof (zmq::msg_t) == sizeof (zmq_msg_t)) != 0) - 1];
u.lmsg.flags = 0;
u.lmsg.content =
(content_t*) malloc (sizeof (content_t) + size_);
- if (!u.lmsg.content) {
+ if (unlikely (!u.lmsg.content)) {
errno = ENOMEM;
return -1;
}
int zmq::msg_t::init_data (void *data_, size_t size_, msg_free_fn *ffn_,
void *hint_)
{
- u.lmsg.type = type_lmsg;
- u.lmsg.flags = 0;
- u.lmsg.content = (content_t*) malloc (sizeof (content_t));
- if (!u.lmsg.content) {
- errno = ENOMEM;
- return -1;
+ // If data is NULL and size is not 0, a segfault
+ // would occur once the data is accessed
+ assert (data_ != NULL || size_ == 0);
+
+ // Initialize constant message if there's no need to deallocate
+ if(ffn_ == NULL) {
+ u.cmsg.type = type_cmsg;
+ u.cmsg.flags = 0;
+ u.cmsg.data = data_;
+ u.cmsg.size = size_;
}
+ else {
+ u.lmsg.type = type_lmsg;
+ u.lmsg.flags = 0;
+ u.lmsg.content = (content_t*) malloc (sizeof (content_t));
+ if (!u.lmsg.content) {
+ errno = ENOMEM;
+ return -1;
+ }
- u.lmsg.content->data = data_;
- u.lmsg.content->size = size_;
- u.lmsg.content->ffn = ffn_;
- u.lmsg.content->hint = hint_;
- new (&u.lmsg.content->refcnt) zmq::atomic_counter_t ();
+ u.lmsg.content->data = data_;
+ u.lmsg.content->size = size_;
+ u.lmsg.content->ffn = ffn_;
+ u.lmsg.content->hint = hint_;
+ new (&u.lmsg.content->refcnt) zmq::atomic_counter_t ();
+ }
return 0;
}
return u.vsm.data;
case type_lmsg:
return u.lmsg.content->data;
+ case type_cmsg:
+ return u.cmsg.data;
default:
zmq_assert (false);
return NULL;
return u.vsm.size;
case type_lmsg:
return u.lmsg.content->size;
+ case type_cmsg:
+ return u.cmsg.size;
default:
zmq_assert (false);
return 0;
return u.base.type == type_vsm;
}
+bool zmq::msg_t::is_cmsg ()
+{
+ return u.base.type == type_cmsg;
+}
+
void zmq::msg_t::add_refs (int refs_)
{
zmq_assert (refs_ >= 0);
if (!refs_)
return;
- // VSMs and delimiters can be copied straight away. The only message type
- // that needs special care are long messages.
+ // VSMs, CMSGS and delimiters can be copied straight away. The only
+ // message type that needs special care are long messages.
if (u.base.type == type_lmsg) {
if (u.lmsg.flags & msg_t::shared)
u.lmsg.content->refcnt.add (refs_);
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2011 VMware, Inc.
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
{
public:
- // Mesage flags.
+ // Message flags.
enum
{
- more = 1,
+ more = 1, // Followed by more parts
+ command = 2, // Command frame (see ZMTP spec)
identity = 64,
shared = 128
};
bool is_identity () const;
bool is_delimiter ();
bool is_vsm ();
+ bool is_cmsg ();
// After calling this function you can copy the message in POD-style
// refs_ times. No need to call copy.
enum type_t
{
type_min = 101,
+ // VSM messages store the content in the message itself
type_vsm = 101,
+ // LMSG messages store the content in malloc-ed memory
type_lmsg = 102,
+ // Delimiter messages are used in envelopes
type_delimiter = 103,
- type_max = 103
+ // CMSG messages point to constant data
+ type_cmsg = 104,
+ type_max = 104
};
// Note that fields shared between different message types are not
unsigned char type;
unsigned char flags;
} lmsg;
+ struct {
+ void* data;
+ size_t size;
+ unsigned char unused
+ [max_vsm_size + 1 - sizeof (void*) - sizeof (size_t)];
+ unsigned char type;
+ unsigned char flags;
+ } cmsg;
struct {
unsigned char unused [max_vsm_size + 1];
unsigned char type;
/*
- Copyright (c) 2011 250bpm s.r.o.
- Copyright (c) 2011-2012 Spotify AB
- Copyright (c) 2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
delete next.node;
next.node = 0;
}
- else if (count > 1) {
+ else
+ if (count > 1) {
for (unsigned short i = 0; i != count; ++i)
- if (next.table [i])
- delete next.table [i];
+ delete next.table [i];
free (next.table);
}
}
count = 1;
next.node = NULL;
}
- else if (count == 1) {
+ else
+ if (count == 1) {
unsigned char oldc = min;
mtrie_t *oldp = next.node;
count = (min < c ? c - min : min - c) + 1;
min = std::min (min, c);
next.table [oldc - min] = oldp;
}
- else if (min < c) {
-
+ else
+ if (min < c) {
// The new character is above the current character range.
unsigned short old_count = count;
count = c - min + 1;
next.table [i] = NULL;
}
else {
-
// The new character is below the current character range.
unsigned short old_count = count;
count = (min + old_count) - c;
count = 0;
}
// Compact the node table if possible
- else if (live_nodes == 1) {
+ else
+ if (live_nodes == 1) {
// If there's only one live node in the table we can
// switch to using the more compact single-node
// representation
count = 1;
min = new_min;
}
- else if (new_min > min || new_max < min + count - 1) {
+ else
+ if (new_min > min || new_max < min + count - 1) {
zmq_assert (new_max - new_min + 1 > 1);
mtrie_t **old_table = next.table;
free (next.table);
next.node = oldp;
}
- else if (c == min) {
+ else
+ if (c == min) {
// We can compact the table "from the left"
unsigned short i;
for (i = 1; i < count; ++i)
memmove (next.table, old_table + i, sizeof (mtrie_t*) * count);
free (old_table);
}
- else if (c == min + count - 1) {
+ else
+ if (c == min + count - 1) {
// We can compact the table "from the right"
unsigned short i;
for (i = 1; i < count; ++i)
/*
- Copyright (c) 2011 250bpm s.r.o.
- Copyright (c) 2011-2012 Spotify AB
- Copyright (c) 2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
/*
- Copyright (c) 2010-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
EnterCriticalSection (&cs);
}
+ inline bool try_lock ()
+ {
+ return (TryEnterCriticalSection (&cs)) ? true : false;
+ }
+
inline void unlock ()
{
LeaveCriticalSection (&cs);
posix_assert (rc);
}
+ inline bool try_lock ()
+ {
+ int rc = pthread_mutex_trylock (&mutex);
+ if (rc == EBUSY)
+ return false;
+
+ posix_assert (rc);
+ return true;
+ }
+
inline void unlock ()
{
int rc = pthread_mutex_unlock (&mutex);
#endif
+
+namespace zmq
+{
+ struct scoped_lock_t
+ {
+ scoped_lock_t (mutex_t& mutex_)
+ : mutex (mutex_)
+ {
+ mutex.lock ();
+ }
+
+ ~scoped_lock_t ()
+ {
+ mutex.unlock ();
+ }
+
+ private:
+
+ mutex_t& mutex;
+
+ // Disable copy construction and assignment.
+ scoped_lock_t (const scoped_lock_t&);
+ const scoped_lock_t &operator = (const scoped_lock_t&);
+ };
+}
+
#endif
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "platform.hpp"
+#ifdef ZMQ_HAVE_WINDOWS
+#include "windows.hpp"
+#endif
+
+#include <stddef.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "err.hpp"
+#include "msg.hpp"
+#include "session_base.hpp"
+#include "wire.hpp"
+#include "null_mechanism.hpp"
+
+zmq::null_mechanism_t::null_mechanism_t (session_base_t *session_,
+ const std::string &peer_address_,
+ const options_t &options_) :
+ mechanism_t (options_),
+ session (session_),
+ peer_address (peer_address_),
+ ready_command_sent (false),
+ ready_command_received (false),
+ zap_connected (false),
+ zap_request_sent (false),
+ zap_reply_received (false)
+{
+ // NULL mechanism only uses ZAP if there's a domain defined
+ // This prevents ZAP requests on naive sockets
+ if (options.zap_domain.size () > 0
+ && session->zap_connect () == 0)
+ zap_connected = true;
+}
+
+zmq::null_mechanism_t::~null_mechanism_t ()
+{
+}
+
+int zmq::null_mechanism_t::next_handshake_command (msg_t *msg_)
+{
+ if (ready_command_sent) {
+ errno = EAGAIN;
+ return -1;
+ }
+ if (zap_connected && !zap_reply_received) {
+ if (zap_request_sent) {
+ errno = EAGAIN;
+ return -1;
+ }
+ send_zap_request ();
+ zap_request_sent = true;
+ const int rc = receive_and_process_zap_reply ();
+ if (rc != 0)
+ return -1;
+ zap_reply_received = true;
+ }
+
+ unsigned char * const command_buffer = (unsigned char *) malloc (512);
+ alloc_assert (command_buffer);
+
+ unsigned char *ptr = command_buffer;
+
+ // Add mechanism string
+ memcpy (ptr, "\5READY", 6);
+ ptr += 6;
+
+ // Add socket type property
+ const char *socket_type = socket_type_string (options.type);
+ ptr += add_property (ptr, "Socket-Type", socket_type, strlen (socket_type));
+
+ // Add identity property
+ if (options.type == ZMQ_REQ
+ || options.type == ZMQ_DEALER
+ || options.type == ZMQ_ROUTER) {
+ ptr += add_property (ptr, "Identity",
+ options.identity, options.identity_size);
+ }
+
+ const size_t command_size = ptr - command_buffer;
+ const int rc = msg_->init_size (command_size);
+ errno_assert (rc == 0);
+ memcpy (msg_->data (), command_buffer, command_size);
+ free (command_buffer);
+
+ ready_command_sent = true;
+
+ return 0;
+}
+
+int zmq::null_mechanism_t::process_handshake_command (msg_t *msg_)
+{
+ if (ready_command_received) {
+ errno = EPROTO;
+ return -1;
+ }
+
+ const unsigned char *ptr =
+ static_cast <unsigned char *> (msg_->data ());
+ size_t bytes_left = msg_->size ();
+
+ if (bytes_left < 6 || memcmp (ptr, "\5READY", 6)) {
+ errno = EPROTO;
+ return -1;
+ }
+
+ ptr += 6;
+ bytes_left -= 6;
+
+ int rc = parse_metadata (ptr, bytes_left);
+ if (rc == 0) {
+ int rc = msg_->close ();
+ errno_assert (rc == 0);
+ rc = msg_->init ();
+ errno_assert (rc == 0);
+ }
+
+ ready_command_received = true;
+
+ return rc;
+}
+
+int zmq::null_mechanism_t::zap_msg_available ()
+{
+ if (zap_reply_received) {
+ errno = EFSM;
+ return -1;
+ }
+ const int rc = receive_and_process_zap_reply ();
+ if (rc == 0)
+ zap_reply_received = true;
+ return rc;
+}
+
+bool zmq::null_mechanism_t::is_handshake_complete () const
+{
+ return ready_command_received && ready_command_sent;
+}
+
+void zmq::null_mechanism_t::send_zap_request ()
+{
+ int rc;
+ msg_t msg;
+
+ // Address delimiter frame
+ rc = msg.init ();
+ errno_assert (rc == 0);
+ msg.set_flags (msg_t::more);
+ rc = session->write_zap_msg (&msg);
+ errno_assert (rc == 0);
+
+ // Version frame
+ rc = msg.init_size (3);
+ errno_assert (rc == 0);
+ memcpy (msg.data (), "1.0", 3);
+ msg.set_flags (msg_t::more);
+ rc = session->write_zap_msg (&msg);
+ errno_assert (rc == 0);
+
+ // Request id frame
+ rc = msg.init_size (1);
+ errno_assert (rc == 0);
+ memcpy (msg.data (), "1", 1);
+ msg.set_flags (msg_t::more);
+ rc = session->write_zap_msg (&msg);
+ errno_assert (rc == 0);
+
+ // Domain frame
+ rc = msg.init_size (options.zap_domain.length ());
+ errno_assert (rc == 0);
+ memcpy (msg.data (), options.zap_domain.c_str (), options.zap_domain.length ());
+ msg.set_flags (msg_t::more);
+ rc = session->write_zap_msg (&msg);
+ errno_assert (rc == 0);
+
+ // Address frame
+ rc = msg.init_size (peer_address.length ());
+ errno_assert (rc == 0);
+ memcpy (msg.data (), peer_address.c_str (), peer_address.length ());
+ msg.set_flags (msg_t::more);
+ rc = session->write_zap_msg (&msg);
+ errno_assert (rc == 0);
+
+ // Identity frame
+ rc = msg.init_size (options.identity_size);
+ errno_assert (rc == 0);
+ memcpy (msg.data (), options.identity, options.identity_size);
+ msg.set_flags (msg_t::more);
+ rc = session->write_zap_msg (&msg);
+ errno_assert (rc == 0);
+
+ // Mechanism frame
+ rc = msg.init_size (4);
+ errno_assert (rc == 0);
+ memcpy (msg.data (), "NULL", 4);
+ rc = session->write_zap_msg (&msg);
+ errno_assert (rc == 0);
+}
+
+int zmq::null_mechanism_t::receive_and_process_zap_reply ()
+{
+ int rc = 0;
+ msg_t msg [7]; // ZAP reply consists of 7 frames
+
+ // Initialize all reply frames
+ for (int i = 0; i < 7; i++) {
+ rc = msg [i].init ();
+ errno_assert (rc == 0);
+ }
+
+ for (int i = 0; i < 7; i++) {
+ rc = session->read_zap_msg (&msg [i]);
+ if (rc == -1)
+ break;
+ if ((msg [i].flags () & msg_t::more) == (i < 6? 0: msg_t::more)) {
+ errno = EPROTO;
+ rc = -1;
+ break;
+ }
+ }
+
+ if (rc != 0)
+ goto error;
+
+ // Address delimiter frame
+ if (msg [0].size () > 0) {
+ rc = -1;
+ errno = EPROTO;
+ goto error;
+ }
+
+ // Version frame
+ if (msg [1].size () != 3 || memcmp (msg [1].data (), "1.0", 3)) {
+ rc = -1;
+ errno = EPROTO;
+ goto error;
+ }
+
+ // Request id frame
+ if (msg [2].size () != 1 || memcmp (msg [2].data (), "1", 1)) {
+ rc = -1;
+ errno = EPROTO;
+ goto error;
+ }
+
+ // Status code frame
+ if (msg [3].size () != 3 || memcmp (msg [3].data (), "200", 3)) {
+ rc = -1;
+ errno = EACCES;
+ goto error;
+ }
+
+ // Process metadata frame
+ rc = parse_metadata (static_cast <const unsigned char*> (msg [6].data ()),
+ msg [6].size ());
+
+error:
+ for (int i = 0; i < 7; i++) {
+ const int rc2 = msg [i].close ();
+ errno_assert (rc2 == 0);
+ }
+
+ return rc;
+}
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __ZMQ_NULL_MECHANISM_HPP_INCLUDED__
+#define __ZMQ_NULL_MECHANISM_HPP_INCLUDED__
+
+#include "mechanism.hpp"
+#include "options.hpp"
+
+namespace zmq
+{
+
+ class msg_t;
+ class session_base_t;
+
+ class null_mechanism_t : public mechanism_t
+ {
+ public:
+
+ null_mechanism_t (session_base_t *session_,
+ const std::string &peer_address,
+ const options_t &options_);
+ virtual ~null_mechanism_t ();
+
+ // mechanism implementation
+ virtual int next_handshake_command (msg_t *msg_);
+ virtual int process_handshake_command (msg_t *msg_);
+ virtual int zap_msg_available ();
+ virtual bool is_handshake_complete () const;
+
+ private:
+
+ session_base_t * const session;
+
+ const std::string peer_address;
+
+ bool ready_command_sent;
+ bool ready_command_received;
+ bool zap_connected;
+ bool zap_request_sent;
+ bool zap_reply_received;
+
+ void send_zap_request ();
+ int receive_and_process_zap_reply ();
+ };
+
+}
+
+#endif
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
return tid;
}
+void zmq::object_t::set_tid(uint32_t id)
+{
+ tid = id;
+}
+
zmq::ctx_t *zmq::object_t::get_ctx ()
{
return ctx;
process_reaped ();
break;
+ case command_t::inproc_connected:
+ process_seqnum ();
+ break;
+
+ case command_t::done:
default:
zmq_assert (false);
}
return ctx->find_endpoint (addr_);
}
+void zmq::object_t::pend_connection (const char *addr_, pending_connection_t &pending_connection_)
+{
+ ctx->pend_connection (addr_, pending_connection_);
+}
+
+void zmq::object_t::connect_pending (const char *addr_, zmq::socket_base_t *bind_socket_)
+{
+ return ctx->connect_pending(addr_, bind_socket_);
+}
+
void zmq::object_t::destroy_socket (socket_base_t *socket_)
{
ctx->destroy_socket (socket_);
send_command (cmd);
}
+void zmq::object_t::send_inproc_connected (zmq::socket_base_t *socket_)
+{
+ command_t cmd;
+ cmd.destination = socket_;
+ cmd.type = command_t::inproc_connected;
+ send_command (cmd);
+}
+
void zmq::object_t::send_done ()
{
command_t cmd;
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
struct i_engine;
struct endpoint_t;
+ struct pending_connection_t;
struct command_t;
class ctx_t;
class pipe_t;
virtual ~object_t ();
uint32_t get_tid ();
+ void set_tid(uint32_t id);
ctx_t *get_ctx ();
void process_command (zmq::command_t &cmd_);
+ void send_inproc_connected (zmq::socket_base_t *socket_);
+ void send_bind (zmq::own_t *destination_, zmq::pipe_t *pipe_, bool inc_seqnum_ = true);
protected:
int register_endpoint (const char *addr_, zmq::endpoint_t &endpoint_);
void unregister_endpoints (zmq::socket_base_t *socket_);
zmq::endpoint_t find_endpoint (const char *addr_);
+ void pend_connection (const char *addr_, pending_connection_t &pending_connection_);
+ void connect_pending (const char *addr_, zmq::socket_base_t *bind_socket_);
+
void destroy_socket (zmq::socket_base_t *socket_);
// Logs an message.
zmq::own_t *object_);
void send_attach (zmq::session_base_t *destination_,
zmq::i_engine *engine_, bool inc_seqnum_ = true);
- void send_bind (zmq::own_t *destination_, zmq::pipe_t *pipe_,
- bool inc_seqnum_ = true);
void send_activate_read (zmq::pipe_t *destination_);
void send_activate_write (zmq::pipe_t *destination_,
uint64_t msgs_read_);
/*
- Copyright (c) 2007-2012 iMatix Corporation
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2011 VMware, Inc.
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
#include "options.hpp"
#include "err.hpp"
+#include "../include/zmq_utils.h"
zmq::options_t::options_t () :
sndhwm (1000),
maxmsgsize (-1),
rcvtimeo (-1),
sndtimeo (-1),
- ipv4only (1),
- delay_attach_on_connect (0),
- delay_on_close (true),
- delay_on_disconnect (true),
+ ipv6 (0),
+ immediate (0),
filter (false),
recv_identity (false),
+ raw_sock (false),
tcp_keepalive (-1),
tcp_keepalive_cnt (-1),
tcp_keepalive_idle (-1),
tcp_keepalive_intvl (-1),
- socket_id (0)
+ mechanism (ZMQ_NULL),
+ as_server (0),
+ socket_id (0),
+ conflate (false)
{
}
int zmq::options_t::setsockopt (int option_, const void *optval_,
size_t optvallen_)
{
+ bool is_int = (optvallen_ == sizeof (int));
+ int value = is_int? *((int *) optval_): 0;
+
switch (option_) {
+ case ZMQ_SNDHWM:
+ if (is_int && value >= 0) {
+ sndhwm = value;
+ return 0;
+ }
+ break;
- case ZMQ_SNDHWM:
- if (optvallen_ != sizeof (int) || *((int*) optval_) < 0) {
- errno = EINVAL;
- return -1;
- }
- sndhwm = *((int*) optval_);
- return 0;
-
- case ZMQ_RCVHWM:
- if (optvallen_ != sizeof (int) || *((int*) optval_) < 0) {
- errno = EINVAL;
- return -1;
- }
- rcvhwm = *((int*) optval_);
- return 0;
-
- case ZMQ_AFFINITY:
- if (optvallen_ != sizeof (uint64_t)) {
- errno = EINVAL;
- return -1;
- }
- affinity = *((uint64_t*) optval_);
- return 0;
-
- case ZMQ_IDENTITY:
-
- // Empty identity is invalid as well as identity longer than
- // 255 bytes. Identity starting with binary zero is invalid
- // as these are used for auto-generated identities.
- if (optvallen_ < 1 || optvallen_ > 255 ||
- *((const unsigned char*) optval_) == 0) {
- errno = EINVAL;
- return -1;
- }
- identity_size = optvallen_;
- memcpy (identity, optval_, identity_size);
- return 0;
-
- case ZMQ_RATE:
- if (optvallen_ != sizeof (int) || *((int*) optval_) <= 0) {
- errno = EINVAL;
- return -1;
- }
- rate = *((int*) optval_);
- return 0;
-
- case ZMQ_RECOVERY_IVL:
- if (optvallen_ != sizeof (int) || *((int*) optval_) < 0) {
- errno = EINVAL;
- return -1;
- }
- recovery_ivl = *((int*) optval_);
- return 0;
-
- case ZMQ_SNDBUF:
- if (optvallen_ != sizeof (int) || *((int*) optval_) < 0) {
- errno = EINVAL;
- return -1;
- }
- sndbuf = *((int*) optval_);
- return 0;
-
- case ZMQ_RCVBUF:
- if (optvallen_ != sizeof (int) || *((int*) optval_) < 0) {
- errno = EINVAL;
- return -1;
- }
- rcvbuf = *((int*) optval_);
- return 0;
-
- case ZMQ_LINGER:
- if (optvallen_ != sizeof (int)) {
- errno = EINVAL;
- return -1;
- }
- linger = *((int*) optval_);
- return 0;
-
- case ZMQ_RECONNECT_IVL:
- if (optvallen_ != sizeof (int)) {
- errno = EINVAL;
- return -1;
- }
- if (*((int*) optval_) < -1) {
- errno = EINVAL;
- return -1;
- }
- reconnect_ivl = *((int*) optval_);
- return 0;
-
- case ZMQ_RECONNECT_IVL_MAX:
- if (optvallen_ != sizeof (int)) {
- errno = EINVAL;
- return -1;
- }
- if (*((int*) optval_) < 0) {
- errno = EINVAL;
- return -1;
- }
- reconnect_ivl_max = *((int*) optval_);
- return 0;
-
- case ZMQ_BACKLOG:
- if (optvallen_ != sizeof (int)) {
- errno = EINVAL;
- return -1;
- }
- backlog = *((int*) optval_);
- return 0;
-
- case ZMQ_MAXMSGSIZE:
- if (optvallen_ != sizeof (int64_t)) {
- errno = EINVAL;
- return -1;
- }
- maxmsgsize = *((int64_t*) optval_);
- return 0;
-
- case ZMQ_MULTICAST_HOPS:
- if (optvallen_ != sizeof (int) || *((int*) optval_) <= 0) {
- errno = EINVAL;
- return -1;
- }
- multicast_hops = *((int*) optval_);
- return 0;
-
- case ZMQ_RCVTIMEO:
- if (optvallen_ != sizeof (int)) {
- errno = EINVAL;
- return -1;
- }
- rcvtimeo = *((int*) optval_);
- return 0;
-
- case ZMQ_SNDTIMEO:
- if (optvallen_ != sizeof (int)) {
- errno = EINVAL;
- return -1;
- }
- sndtimeo = *((int*) optval_);
- return 0;
-
- case ZMQ_IPV4ONLY:
- {
- if (optvallen_ != sizeof (int)) {
- errno = EINVAL;
- return -1;
- }
- int val = *((int*) optval_);
- if (val != 0 && val != 1) {
- errno = EINVAL;
- return -1;
- }
- ipv4only = val;
- return 0;
- }
-
-
-
- case ZMQ_TCP_KEEPALIVE:
- {
- if (optvallen_ != sizeof (int)) {
- errno = EINVAL;
- return -1;
- }
- int val = *((int*) optval_);
- if (val != -1 && val != 0 && val != 1) {
- errno = EINVAL;
- return -1;
- }
-#if defined ZMQ_HAVE_SO_KEEPALIVE
- tcp_keepalive = val;
-#endif
- return 0;
- }
-
- case ZMQ_DELAY_ATTACH_ON_CONNECT:
- {
- if (optvallen_ != sizeof (int)) {
- errno = EINVAL;
- return -1;
- }
- int val = *((int*) optval_);
- if (val != 0 && val != 1) {
- errno = EINVAL;
- return -1;
- }
- delay_attach_on_connect = val;
- return 0;
- }
-
- case ZMQ_TCP_KEEPALIVE_CNT:
- {
- if (optvallen_ != sizeof (int)) {
- errno = EINVAL;
- return -1;
- }
- int val = *((int*) optval_);
- if (val <= 0 && val != -1) {
- errno = EINVAL;
- return -1;
- }
-#if defined ZMQ_HAVE_SO_KEEPALIVE && defined ZMQ_HAVE_TCP_KEEPCNT
- tcp_keepalive_cnt = val;
-#endif
- return 0;
- }
-
- case ZMQ_TCP_KEEPALIVE_IDLE:
- {
- if (optvallen_ != sizeof (int)) {
- errno = EINVAL;
- return -1;
- }
- int val = *((int*) optval_);
- if (val <= 0 && val != -1) {
- errno = EINVAL;
- return -1;
- }
-
-#if defined ZMQ_HAVE_SO_KEEPALIVE && (defined ZMQ_HAVE_TCP_KEEPIDLE || defined ZMQ_HAVE_TCP_KEEPALIVE)
- tcp_keepalive_idle = val;
-#endif
- return 0;
- }
-
- case ZMQ_TCP_KEEPALIVE_INTVL:
- {
- if (optvallen_ != sizeof (int)) {
- errno = EINVAL;
- return -1;
- }
- int val = *((int*) optval_);
- if (val <= 0 && val != -1) {
- errno = EINVAL;
- return -1;
- }
-#if defined ZMQ_HAVE_SO_KEEPALIVE && defined ZMQ_HAVE_TCP_KEEPINTVL
- tcp_keepalive_intvl = val;
-#endif
- return 0;
- }
-
- case ZMQ_TCP_ACCEPT_FILTER:
- {
+ case ZMQ_RCVHWM:
+ if (is_int && value >= 0) {
+ rcvhwm = value;
+ return 0;
+ }
+ break;
+
+ case ZMQ_AFFINITY:
+ if (optvallen_ == sizeof (uint64_t)) {
+ affinity = *((uint64_t*) optval_);
+ return 0;
+ }
+ break;
+
+ case ZMQ_IDENTITY:
+ // Empty identity is invalid as well as identity longer than
+ // 255 bytes. Identity starting with binary zero is invalid
+ // as these are used for auto-generated identities.
+ if (optvallen_ > 0 && optvallen_ < 256
+ && *((const unsigned char *) optval_) != 0) {
+ identity_size = optvallen_;
+ memcpy (identity, optval_, identity_size);
+ return 0;
+ }
+ break;
+
+ case ZMQ_RATE:
+ if (is_int && value > 0) {
+ rate = value;
+ return 0;
+ }
+ break;
+
+ case ZMQ_RECOVERY_IVL:
+ if (is_int && value >= 0) {
+ recovery_ivl = value;
+ return 0;
+ }
+ break;
+
+ case ZMQ_SNDBUF:
+ if (is_int && value >= 0) {
+ sndbuf = value;
+ return 0;
+ }
+ break;
+
+ case ZMQ_RCVBUF:
+ if (is_int && value >= 0) {
+ rcvbuf = value;
+ return 0;
+ }
+ break;
+
+ case ZMQ_LINGER:
+ if (is_int && value >= -1) {
+ linger = value;
+ return 0;
+ }
+ break;
+
+ case ZMQ_RECONNECT_IVL:
+ if (is_int && value >= -1) {
+ reconnect_ivl = value;
+ return 0;
+ }
+ break;
+
+ case ZMQ_RECONNECT_IVL_MAX:
+ if (is_int && value >= 0) {
+ reconnect_ivl_max = value;
+ return 0;
+ }
+ break;
+
+ case ZMQ_BACKLOG:
+ if (is_int && value >= 0) {
+ backlog = value;
+ return 0;
+ }
+ break;
+
+ case ZMQ_MAXMSGSIZE:
+ if (optvallen_ == sizeof (int64_t)) {
+ maxmsgsize = *((int64_t *) optval_);
+ return 0;
+ }
+ break;
+
+ case ZMQ_MULTICAST_HOPS:
+ if (is_int && value > 0) {
+ multicast_hops = value;
+ return 0;
+ }
+ break;
+
+ case ZMQ_RCVTIMEO:
+ if (is_int && value >= -1) {
+ rcvtimeo = value;
+ return 0;
+ }
+ break;
+
+ case ZMQ_SNDTIMEO:
+ if (is_int && value >= -1) {
+ sndtimeo = value;
+ return 0;
+ }
+ break;
+
+ /* Deprecated in favor of ZMQ_IPV6 */
+ case ZMQ_IPV4ONLY:
+ if (is_int && (value == 0 || value == 1)) {
+ ipv6 = (value == 0);
+ return 0;
+ }
+ break;
+
+ /* To replace the somewhat surprising IPV4ONLY */
+ case ZMQ_IPV6:
+ if (is_int && (value == 0 || value == 1)) {
+ ipv6 = (value != 0);
+ return 0;
+ }
+ break;
+
+ case ZMQ_TCP_KEEPALIVE:
+ if (is_int && (value >= -1 || value <= 1)) {
+ tcp_keepalive = value;
+ return 0;
+ }
+ break;
+
+ case ZMQ_TCP_KEEPALIVE_CNT:
+ if (is_int && (value == -1 || value >= 0)) {
+ tcp_keepalive_cnt = value;
+ return 0;
+ }
+ break;
+
+ case ZMQ_TCP_KEEPALIVE_IDLE:
+ if (is_int && (value == -1 || value >= 0)) {
+ tcp_keepalive_idle = value;
+ return 0;
+ }
+ break;
+
+ case ZMQ_TCP_KEEPALIVE_INTVL:
+ if (is_int && (value == -1 || value >= 0)) {
+ tcp_keepalive_intvl = value;
+ return 0;
+ }
+ break;
+
+ case ZMQ_IMMEDIATE:
+ if (is_int && (value == 0 || value == 1)) {
+ immediate = value;
+ return 0;
+ }
+ break;
+
+ case ZMQ_TCP_ACCEPT_FILTER:
if (optvallen_ == 0 && optval_ == NULL) {
tcp_accept_filters.clear ();
return 0;
}
else
- if (optvallen_ < 1 || optvallen_ > 255 || optval_ == NULL || *((const char*) optval_) == 0) {
- errno = EINVAL;
- return -1;
- }
- else {
- std::string filter_str ((const char*) optval_, optvallen_);
-
- tcp_address_mask_t filter;
- int rc = filter.resolve (filter_str.c_str (), ipv4only ? true : false);
- if (rc != 0) {
- errno = EINVAL;
- return -1;
+ if (optvallen_ > 0 && optvallen_ < 256 && optval_ != NULL && *((const char*) optval_) != 0) {
+ std::string filter_str ((const char *) optval_, optvallen_);
+ tcp_address_mask_t mask;
+ int rc = mask.resolve (filter_str.c_str (), ipv6);
+ if (rc == 0) {
+ tcp_accept_filters.push_back (mask);
+ return 0;
}
- tcp_accept_filters.push_back(filter);
+ }
+ break;
+
+ case ZMQ_PLAIN_SERVER:
+ if (is_int && (value == 0 || value == 1)) {
+ as_server = value;
+ mechanism = value? ZMQ_PLAIN: ZMQ_NULL;
+ return 0;
+ }
+ break;
+
+ case ZMQ_PLAIN_USERNAME:
+ if (optvallen_ == 0 && optval_ == NULL) {
+ mechanism = ZMQ_NULL;
+ return 0;
+ }
+ else
+ if (optvallen_ > 0 && optvallen_ < 256 && optval_ != NULL) {
+ plain_username.assign ((const char *) optval_, optvallen_);
+ as_server = 0;
+ mechanism = ZMQ_PLAIN;
+ return 0;
+ }
+ break;
+
+ case ZMQ_PLAIN_PASSWORD:
+ if (optvallen_ == 0 && optval_ == NULL) {
+ mechanism = ZMQ_NULL;
+ return 0;
+ }
+ else
+ if (optvallen_ > 0 && optvallen_ < 256 && optval_ != NULL) {
+ plain_password.assign ((const char *) optval_, optvallen_);
+ as_server = 0;
+ mechanism = ZMQ_PLAIN;
+ return 0;
+ }
+ break;
+
+ case ZMQ_ZAP_DOMAIN:
+ if (optvallen_ < 256) {
+ zap_domain.assign ((const char *) optval_, optvallen_);
+ return 0;
+ }
+ break;
+
+ // If libsodium isn't installed, these options provoke EINVAL
+# ifdef HAVE_LIBSODIUM
+ case ZMQ_CURVE_SERVER:
+ if (is_int && (value == 0 || value == 1)) {
+ as_server = value;
+ mechanism = value? ZMQ_CURVE: ZMQ_NULL;
+ return 0;
+ }
+ break;
+
+ case ZMQ_CURVE_PUBLICKEY:
+ if (optvallen_ == CURVE_KEYSIZE) {
+ memcpy (curve_public_key, optval_, CURVE_KEYSIZE);
+ mechanism = ZMQ_CURVE;
+ return 0;
+ }
+ else
+ if (optvallen_ == CURVE_KEYSIZE_Z85) {
+ zmq_z85_decode (curve_public_key, (char *) optval_);
+ mechanism = ZMQ_CURVE;
+ return 0;
+ }
+ break;
+
+ case ZMQ_CURVE_SECRETKEY:
+ if (optvallen_ == CURVE_KEYSIZE) {
+ memcpy (curve_secret_key, optval_, CURVE_KEYSIZE);
+ mechanism = ZMQ_CURVE;
+ return 0;
+ }
+ else
+ if (optvallen_ == CURVE_KEYSIZE_Z85) {
+ zmq_z85_decode (curve_secret_key, (char *) optval_);
+ mechanism = ZMQ_CURVE;
+ return 0;
+ }
+ break;
+ case ZMQ_CURVE_SERVERKEY:
+ if (optvallen_ == CURVE_KEYSIZE) {
+ memcpy (curve_server_key, optval_, CURVE_KEYSIZE);
+ as_server = 0;
+ mechanism = ZMQ_CURVE;
return 0;
}
- }
+ else
+ if (optvallen_ == CURVE_KEYSIZE_Z85) {
+ zmq_z85_decode (curve_server_key, (char *) optval_);
+ as_server = 0;
+ mechanism = ZMQ_CURVE;
+ return 0;
+ }
+ break;
+# endif
+
+ case ZMQ_CONFLATE:
+ if (is_int && (value == 0 || value == 1)) {
+ conflate = (value != 0);
+ return 0;
+ }
+ break;
+
+ default:
+ break;
}
errno = EINVAL;
return -1;
int zmq::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_)
{
+ bool is_int = (*optvallen_ == sizeof (int));
+ int *value = (int *) optval_;
+
switch (option_) {
+ case ZMQ_SNDHWM:
+ if (is_int) {
+ *value = sndhwm;
+ return 0;
+ }
+ break;
- case ZMQ_SNDHWM:
- if (*optvallen_ < sizeof (int)) {
- errno = EINVAL;
- return -1;
- }
- *((int*) optval_) = sndhwm;
- *optvallen_ = sizeof (int);
- return 0;
-
- case ZMQ_RCVHWM:
- if (*optvallen_ < sizeof (int)) {
- errno = EINVAL;
- return -1;
- }
- *((int*) optval_) = rcvhwm;
- *optvallen_ = sizeof (int);
- return 0;
-
- case ZMQ_AFFINITY:
- if (*optvallen_ < sizeof (uint64_t)) {
- errno = EINVAL;
- return -1;
- }
- *((uint64_t*) optval_) = affinity;
- *optvallen_ = sizeof (uint64_t);
- return 0;
-
- case ZMQ_IDENTITY:
- if (*optvallen_ < identity_size) {
- errno = EINVAL;
- return -1;
- }
- memcpy (optval_, identity, identity_size);
- *optvallen_ = identity_size;
- return 0;
-
- case ZMQ_RATE:
- if (*optvallen_ < sizeof (int)) {
- errno = EINVAL;
- return -1;
- }
- *((int*) optval_) = rate;
- *optvallen_ = sizeof (int);
- return 0;
-
- case ZMQ_RECOVERY_IVL:
- if (*optvallen_ < sizeof (int)) {
- errno = EINVAL;
- return -1;
- }
- *((int*) optval_) = recovery_ivl;
- *optvallen_ = sizeof (int);
- return 0;
-
- case ZMQ_SNDBUF:
- if (*optvallen_ < sizeof (int)) {
- errno = EINVAL;
- return -1;
- }
- *((int*) optval_) = sndbuf;
- *optvallen_ = sizeof (int);
- return 0;
-
- case ZMQ_RCVBUF:
- if (*optvallen_ < sizeof (int)) {
- errno = EINVAL;
- return -1;
- }
- *((int*) optval_) = rcvbuf;
- *optvallen_ = sizeof (int);
- return 0;
-
- case ZMQ_TYPE:
- if (*optvallen_ < sizeof (int)) {
- errno = EINVAL;
- return -1;
- }
- *((int*) optval_) = type;
- *optvallen_ = sizeof (int);
- return 0;
-
- case ZMQ_LINGER:
- if (*optvallen_ < sizeof (int)) {
- errno = EINVAL;
- return -1;
- }
- *((int*) optval_) = linger;
- *optvallen_ = sizeof (int);
- return 0;
-
- case ZMQ_RECONNECT_IVL:
- if (*optvallen_ < sizeof (int)) {
- errno = EINVAL;
- return -1;
- }
- *((int*) optval_) = reconnect_ivl;
- *optvallen_ = sizeof (int);
- return 0;
-
- case ZMQ_RECONNECT_IVL_MAX:
- if (*optvallen_ < sizeof (int)) {
- errno = EINVAL;
- return -1;
- }
- *((int*) optval_) = reconnect_ivl_max;
- *optvallen_ = sizeof (int);
- return 0;
-
- case ZMQ_BACKLOG:
- if (*optvallen_ < sizeof (int)) {
- errno = EINVAL;
- return -1;
- }
- *((int*) optval_) = backlog;
- *optvallen_ = sizeof (int);
- return 0;
-
- case ZMQ_MAXMSGSIZE:
- if (*optvallen_ < sizeof (int64_t)) {
- errno = EINVAL;
- return -1;
- }
- *((int64_t*) optval_) = maxmsgsize;
- *optvallen_ = sizeof (int64_t);
- return 0;
-
- case ZMQ_MULTICAST_HOPS:
- if (*optvallen_ < sizeof (int)) {
- errno = EINVAL;
- return -1;
- }
- *((int*) optval_) = multicast_hops;
- *optvallen_ = sizeof (int);
- return 0;
-
- case ZMQ_RCVTIMEO:
- if (*optvallen_ < sizeof (int)) {
- errno = EINVAL;
- return -1;
- }
- *((int*) optval_) = rcvtimeo;
- *optvallen_ = sizeof (int);
- return 0;
-
- case ZMQ_SNDTIMEO:
- if (*optvallen_ < sizeof (int)) {
- errno = EINVAL;
- return -1;
- }
- *((int*) optval_) = sndtimeo;
- *optvallen_ = sizeof (int);
- return 0;
-
- case ZMQ_IPV4ONLY:
- if (*optvallen_ < sizeof (int)) {
- errno = EINVAL;
- return -1;
- }
- *((int*) optval_) = ipv4only;
- *optvallen_ = sizeof (int);
- return 0;
-
- case ZMQ_DELAY_ATTACH_ON_CONNECT:
- if (*optvallen_ < sizeof (int)) {
- errno = EINVAL;
- return -1;
- }
- *((int*) optval_) = delay_attach_on_connect;
- *optvallen_ = sizeof (int);
- return 0;
-
- case ZMQ_TCP_KEEPALIVE:
- if (*optvallen_ < sizeof (int)) {
- errno = EINVAL;
- return -1;
- }
- *((int*) optval_) = tcp_keepalive;
- *optvallen_ = sizeof (int);
- return 0;
-
- case ZMQ_TCP_KEEPALIVE_CNT:
- if (*optvallen_ < sizeof (int)) {
- errno = EINVAL;
- return -1;
- }
- *((int*) optval_) = tcp_keepalive_cnt;
- *optvallen_ = sizeof (int);
- return 0;
-
- case ZMQ_TCP_KEEPALIVE_IDLE:
- if (*optvallen_ < sizeof (int)) {
- errno = EINVAL;
- return -1;
- }
- *((int*) optval_) = tcp_keepalive_idle;
- *optvallen_ = sizeof (int);
- return 0;
-
- case ZMQ_TCP_KEEPALIVE_INTVL:
- if (*optvallen_ < sizeof (int)) {
- errno = EINVAL;
- return -1;
- }
- *((int*) optval_) = tcp_keepalive_intvl;
- *optvallen_ = sizeof (int);
- return 0;
-
- case ZMQ_LAST_ENDPOINT:
- // don't allow string which cannot contain the entire message
- if (*optvallen_ < last_endpoint.size() + 1) {
- errno = EINVAL;
- return -1;
- }
- memcpy (optval_, last_endpoint.c_str(), last_endpoint.size()+1);
- *optvallen_ = last_endpoint.size()+1;
- return 0;
- }
+ case ZMQ_RCVHWM:
+ if (is_int) {
+ *value = rcvhwm;
+ return 0;
+ }
+ break;
+
+ case ZMQ_AFFINITY:
+ if (*optvallen_ == sizeof (uint64_t)) {
+ *((uint64_t *) optval_) = affinity;
+ return 0;
+ }
+ break;
+
+ case ZMQ_IDENTITY:
+ if (*optvallen_ >= identity_size) {
+ memcpy (optval_, identity, identity_size);
+ *optvallen_ = identity_size;
+ return 0;
+ }
+ break;
+
+ case ZMQ_RATE:
+ if (is_int) {
+ *value = rate;
+ return 0;
+ }
+ break;
+
+ case ZMQ_RECOVERY_IVL:
+ if (is_int) {
+ *value = recovery_ivl;
+ return 0;
+ }
+ break;
+
+ case ZMQ_SNDBUF:
+ if (is_int) {
+ *value = sndbuf;
+ return 0;
+ }
+ break;
+
+ case ZMQ_RCVBUF:
+ if (is_int) {
+ *value = rcvbuf;
+ return 0;
+ }
+ break;
+
+ case ZMQ_TYPE:
+ if (is_int) {
+ *value = type;
+ return 0;
+ }
+ break;
+
+ case ZMQ_LINGER:
+ if (is_int) {
+ *value = linger;
+ return 0;
+ }
+ break;
+
+ case ZMQ_RECONNECT_IVL:
+ if (is_int) {
+ *value = reconnect_ivl;
+ return 0;
+ }
+ break;
+
+ case ZMQ_RECONNECT_IVL_MAX:
+ if (is_int) {
+ *value = reconnect_ivl_max;
+ return 0;
+ }
+ break;
+
+ case ZMQ_BACKLOG:
+ if (is_int) {
+ *value = backlog;
+ return 0;
+ }
+ break;
+
+ case ZMQ_MAXMSGSIZE:
+ if (*optvallen_ == sizeof (int64_t)) {
+ *((int64_t *) optval_) = maxmsgsize;
+ *optvallen_ = sizeof (int64_t);
+ return 0;
+ }
+ break;
+
+ case ZMQ_MULTICAST_HOPS:
+ if (is_int) {
+ *value = multicast_hops;
+ return 0;
+ }
+ break;
+
+ case ZMQ_RCVTIMEO:
+ if (is_int) {
+ *value = rcvtimeo;
+ return 0;
+ }
+ break;
+
+ case ZMQ_SNDTIMEO:
+ if (is_int) {
+ *value = sndtimeo;
+ return 0;
+ }
+ break;
+
+ case ZMQ_IPV4ONLY:
+ if (is_int) {
+ *value = 1 - ipv6;
+ return 0;
+ }
+ break;
+
+ case ZMQ_IPV6:
+ if (is_int) {
+ *value = ipv6;
+ return 0;
+ }
+ break;
+
+ case ZMQ_IMMEDIATE:
+ if (is_int) {
+ *value = immediate;
+ return 0;
+ }
+ break;
+
+ case ZMQ_TCP_KEEPALIVE:
+ if (is_int) {
+ *value = tcp_keepalive;
+ return 0;
+ }
+ break;
+
+ case ZMQ_TCP_KEEPALIVE_CNT:
+ if (is_int) {
+ *value = tcp_keepalive_cnt;
+ return 0;
+ }
+ break;
+
+ case ZMQ_TCP_KEEPALIVE_IDLE:
+ if (is_int) {
+ *value = tcp_keepalive_idle;
+ return 0;
+ }
+ break;
+
+ case ZMQ_TCP_KEEPALIVE_INTVL:
+ if (is_int) {
+ *value = tcp_keepalive_intvl;
+ return 0;
+ }
+ break;
+
+ case ZMQ_MECHANISM:
+ if (is_int) {
+ *value = mechanism;
+ return 0;
+ }
+ break;
+
+ case ZMQ_PLAIN_SERVER:
+ if (is_int) {
+ *value = as_server && mechanism == ZMQ_PLAIN;
+ return 0;
+ }
+ break;
+
+ case ZMQ_PLAIN_USERNAME:
+ if (*optvallen_ >= plain_username.size () + 1) {
+ memcpy (optval_, plain_username.c_str (), plain_username.size () + 1);
+ *optvallen_ = plain_username.size () + 1;
+ return 0;
+ }
+ break;
+
+ case ZMQ_PLAIN_PASSWORD:
+ if (*optvallen_ >= plain_password.size () + 1) {
+ memcpy (optval_, plain_password.c_str (), plain_password.size () + 1);
+ *optvallen_ = plain_password.size () + 1;
+ return 0;
+ }
+ break;
+ case ZMQ_ZAP_DOMAIN:
+ if (*optvallen_ >= zap_domain.size () + 1) {
+ memcpy (optval_, zap_domain.c_str (), zap_domain.size () + 1);
+ *optvallen_ = zap_domain.size () + 1;
+ return 0;
+ }
+ break;
+
+ // If libsodium isn't installed, these options provoke EINVAL
+# ifdef HAVE_LIBSODIUM
+ case ZMQ_CURVE_SERVER:
+ if (is_int) {
+ *value = as_server && mechanism == ZMQ_CURVE;
+ return 0;
+ }
+ break;
+
+ case ZMQ_CURVE_PUBLICKEY:
+ if (*optvallen_ == CURVE_KEYSIZE) {
+ memcpy (optval_, curve_public_key, CURVE_KEYSIZE);
+ return 0;
+ }
+ else
+ if (*optvallen_ == CURVE_KEYSIZE_Z85 + 1) {
+ zmq_z85_encode ((char *) optval_, curve_public_key, CURVE_KEYSIZE);
+ return 0;
+ }
+ break;
+
+ case ZMQ_CURVE_SECRETKEY:
+ if (*optvallen_ == CURVE_KEYSIZE) {
+ memcpy (optval_, curve_secret_key, CURVE_KEYSIZE);
+ return 0;
+ }
+ else
+ if (*optvallen_ == CURVE_KEYSIZE_Z85 + 1) {
+ zmq_z85_encode ((char *) optval_, curve_secret_key, CURVE_KEYSIZE);
+ return 0;
+ }
+ break;
+
+ case ZMQ_CURVE_SERVERKEY:
+ if (*optvallen_ == CURVE_KEYSIZE) {
+ memcpy (optval_, curve_server_key, CURVE_KEYSIZE);
+ return 0;
+ }
+ else
+ if (*optvallen_ == CURVE_KEYSIZE_Z85 + 1) {
+ zmq_z85_encode ((char *) optval_, curve_server_key, CURVE_KEYSIZE);
+ return 0;
+ }
+ break;
+# endif
+
+ case ZMQ_CONFLATE:
+ if (is_int) {
+ *value = conflate;
+ return 0;
+ }
+ break;
+
+ }
errno = EINVAL;
return -1;
}
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2011 VMware, Inc.
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
#include "tcp_address.hpp"
#include "../include/zmq.h"
+// Normal base 256 key is 32 bytes
+#define CURVE_KEYSIZE 32
+// Key encoded using Z85 is 40 bytes
+#define CURVE_KEYSIZE_Z85 40
+
namespace zmq
{
-
struct options_t
{
options_t ();
unsigned char identity_size;
unsigned char identity [256];
- // Last socket endpoint resolved URI
- std::string last_endpoint;
-
- // Maximum tranfer rate [kb/s]. Default 100kb/s.
+ // Maximum transfer rate [kb/s]. Default 100kb/s.
int rate;
// Reliability time interval [ms]. Default 10 seconds.
int rcvtimeo;
int sndtimeo;
- // If 1, indicates the use of IPv4 sockets only, it will not be
- // possible to communicate with IPv6-only hosts. If 0, the socket can
- // connect to and accept connections from both IPv4 and IPv6 hosts.
- int ipv4only;
-
+ // If true, IPv6 is enabled (as well as IPv4)
+ bool ipv6;
+
// If 1, connecting pipes are not attached immediately, meaning a send()
// on a socket with only connecting pipes would block
- int delay_attach_on_connect;
-
- // If true, session reads all the pending messages from the pipe and
- // sends them to the network when socket is closed.
- bool delay_on_close;
-
- // If true, socket reads all the messages from the pipe and delivers
- // them to the user when the peer terminates.
- bool delay_on_disconnect;
+ int immediate;
// If 1, (X)SUB socket should filter the messages. If 0, it should not.
bool filter;
// If true, the identity message is forwarded to the socket.
bool recv_identity;
+ // if true, router socket accepts non-zmq tcp connections
+ bool raw_sock;
+
// TCP keep-alive settings.
// Defaults to -1 = do not change socket options
int tcp_keepalive;
typedef std::vector <tcp_address_mask_t> tcp_accept_filters_t;
tcp_accept_filters_t tcp_accept_filters;
+ // Security mechanism for all connections on this socket
+ int mechanism;
+
+ // If peer is acting as server for PLAIN or CURVE mechanisms
+ int as_server;
+
+ // ZAP authentication domain
+ std::string zap_domain;
+
+ // Security credentials for PLAIN mechanism
+ std::string plain_username;
+ std::string plain_password;
+
+ // Security credentials for CURVE mechanism
+ uint8_t curve_public_key [CURVE_KEYSIZE];
+ uint8_t curve_secret_key [CURVE_KEYSIZE];
+ uint8_t curve_server_key [CURVE_KEYSIZE];
+
// ID of the socket.
int socket_id;
- };
+ // If true, socket conflates outgoing/incoming messages.
+ // Applicable to dealer, push/pull, pub/sub socket types.
+ // Cannot receive multi-part messages.
+ // Ignores hwm
+ bool conflate;
+ };
}
#endif
/*
- Copyright (c) 2010-2011 250bpm s.r.o.
- Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
/*
- Copyright (c) 2010-2011 250bpm s.r.o.
- Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
zmq_assert (!pipe);
}
-void zmq::pair_t::xattach_pipe (pipe_t *pipe_, bool icanhasall_)
+void zmq::pair_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_)
{
- // icanhasall_ is unused
- (void)icanhasall_;
+ // subscribe_to_all_ is unused
+ (void)subscribe_to_all_;
zmq_assert (pipe_ != NULL);
pipe_->terminate (false);
}
-void zmq::pair_t::xterminated (pipe_t *pipe_)
+void zmq::pair_t::xpipe_terminated (pipe_t *pipe_)
{
if (pipe_ == pipe)
pipe = NULL;
// There's nothing to do here.
}
-int zmq::pair_t::xsend (msg_t *msg_, int flags_)
+int zmq::pair_t::xsend (msg_t *msg_)
{
if (!pipe || !pipe->write (msg_)) {
errno = EAGAIN;
return -1;
}
- if (!(flags_ & ZMQ_SNDMORE))
+ if (!(msg_->flags () & msg_t::more))
pipe->flush ();
// Detach the original message from the data buffer.
return 0;
}
-int zmq::pair_t::xrecv (msg_t *msg_, int flags_)
+int zmq::pair_t::xrecv (msg_t *msg_)
{
- // flags_ is unused
- (void)flags_;
-
// Deallocate old content of the message.
int rc = msg_->close ();
errno_assert (rc == 0);
return pipe->check_write ();
}
-
-zmq::pair_session_t::pair_session_t (io_thread_t *io_thread_, bool connect_,
- socket_base_t *socket_, const options_t &options_,
- const address_t *addr_) :
- session_base_t (io_thread_, connect_, socket_, options_, addr_)
-{
-}
-
-zmq::pair_session_t::~pair_session_t ()
-{
-}
-
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
~pair_t ();
// Overloads of functions from socket_base_t.
- void xattach_pipe (zmq::pipe_t *pipe_, bool icanhasall_);
- int xsend (zmq::msg_t *msg_, int flags_);
- int xrecv (zmq::msg_t *msg_, int flags_);
+ void xattach_pipe (zmq::pipe_t *pipe_, bool subscribe_to_all_);
+ int xsend (zmq::msg_t *msg_);
+ int xrecv (zmq::msg_t *msg_);
bool xhas_in ();
bool xhas_out ();
void xread_activated (zmq::pipe_t *pipe_);
void xwrite_activated (zmq::pipe_t *pipe_);
- void xterminated (zmq::pipe_t *pipe_);
+ void xpipe_terminated (zmq::pipe_t *pipe_);
private:
const pair_t &operator = (const pair_t&);
};
- class pair_session_t : public session_base_t
- {
- public:
-
- pair_session_t (zmq::io_thread_t *io_thread_, bool connect_,
- socket_base_t *socket_, const options_t &options_,
- const address_t *addr_);
- ~pair_session_t ();
-
- private:
-
- pair_session_t (const pair_session_t&);
- const pair_session_t &operator = (const pair_session_t&);
- };
-
}
#endif
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2010-2011 Miru Limited
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
#include "pgm_receiver.hpp"
#include "session_base.hpp"
+#include "v1_decoder.hpp"
#include "stdint.hpp"
#include "wire.hpp"
#include "err.hpp"
pgm_socket (true, options_),
options (options_),
session (NULL),
- mru_decoder (NULL),
- pending_bytes (0)
+ active_tsi (NULL),
+ insize (0)
{
}
delete it->second.decoder;
}
peers.clear ();
-
- mru_decoder = NULL;
- pending_bytes = 0;
+ active_tsi = NULL;
if (has_rx_timer) {
cancel_timer (rx_timer_id);
delete this;
}
-void zmq::pgm_receiver_t::activate_out ()
+void zmq::pgm_receiver_t::restart_output ()
{
drop_subscriptions ();
}
-void zmq::pgm_receiver_t::activate_in ()
+void zmq::pgm_receiver_t::restart_input ()
{
- // It is possible that the most recently used decoder
- // processed the whole buffer but failed to write
- // the last message into the pipe.
- if (pending_bytes == 0) {
- if (mru_decoder != NULL) {
- mru_decoder->process_buffer (NULL, 0);
- session->flush ();
+ zmq_assert (session != NULL);
+ zmq_assert (active_tsi != NULL);
+
+ const peers_t::iterator it = peers.find (*active_tsi);
+ zmq_assert (it != peers.end ());
+ zmq_assert (it->second.joined);
+
+ // Push the pending message into the session.
+ int rc = session->push_msg (it->second.decoder->msg ());
+ errno_assert (rc == 0);
+
+ if (insize > 0) {
+ rc = process_input (it->second.decoder);
+ if (rc == -1) {
+ // HWM reached; we will try later.
+ if (errno == EAGAIN) {
+ session->flush ();
+ return;
+ }
+ // Data error. Delete message decoder, mark the
+ // peer as not joined and drop remaining data.
+ it->second.joined = false;
+ delete it->second.decoder;
+ it->second.decoder = NULL;
+ insize = 0;
}
-
- // Resume polling.
- set_pollin (pipe_handle);
- set_pollin (socket_handle);
-
- return;
}
- zmq_assert (mru_decoder != NULL);
- zmq_assert (pending_ptr != NULL);
-
- // Ask the decoder to process remaining data.
- size_t n = mru_decoder->process_buffer (pending_ptr, pending_bytes);
- pending_bytes -= n;
- session->flush ();
-
- if (pending_bytes > 0)
- return;
-
// Resume polling.
set_pollin (pipe_handle);
set_pollin (socket_handle);
+ active_tsi = NULL;
in_event ();
}
void zmq::pgm_receiver_t::in_event ()
{
// Read data from the underlying pgm_socket.
- unsigned char *data = NULL;
const pgm_tsi_t *tsi = NULL;
- if (pending_bytes > 0)
- return;
-
if (has_rx_timer) {
cancel_timer (rx_timer_id);
has_rx_timer = false;
// Note the workaround made not to break strict-aliasing rules.
void *tmp = NULL;
ssize_t received = pgm_socket.receive (&tmp, &tsi);
- data = (unsigned char*) tmp;
+ inpos = (unsigned char*) tmp;
// No data to process. This may happen if the packet received is
// neither ODATA nor ODATA.
if (received == -1) {
if (it != peers.end ()) {
it->second.joined = false;
- if (it->second.decoder == mru_decoder)
- mru_decoder = NULL;
if (it->second.decoder != NULL) {
delete it->second.decoder;
it->second.decoder = NULL;
it = peers.insert (peers_t::value_type (*tsi, peer_info)).first;
}
+ insize = static_cast <size_t> (received);
+
// Read the offset of the fist message in the current packet.
- zmq_assert ((size_t) received >= sizeof (uint16_t));
- uint16_t offset = get_uint16 (data);
- data += sizeof (uint16_t);
- received -= sizeof (uint16_t);
+ zmq_assert (insize >= sizeof (uint16_t));
+ uint16_t offset = get_uint16 (inpos);
+ inpos += sizeof (uint16_t);
+ insize -= sizeof (uint16_t);
// Join the stream if needed.
if (!it->second.joined) {
if (offset == 0xffff)
continue;
- zmq_assert (offset <= received);
+ zmq_assert (offset <= insize);
zmq_assert (it->second.decoder == NULL);
// We have to move data to the begining of the first message.
- data += offset;
- received -= offset;
+ inpos += offset;
+ insize -= offset;
// Mark the stream as joined.
it->second.joined = true;
// Create and connect decoder for the peer.
- it->second.decoder = new (std::nothrow) decoder_t (0,
- options.maxmsgsize);
+ it->second.decoder = new (std::nothrow)
+ v1_decoder_t (0, options.maxmsgsize);
alloc_assert (it->second.decoder);
- it->second.decoder->set_msg_sink (session);
}
- mru_decoder = it->second.decoder;
-
- // Push all the data to the decoder.
- ssize_t processed = it->second.decoder->process_buffer (data, received);
- if (processed < received) {
- // Save some state so we can resume the decoding process later.
- pending_bytes = received - processed;
- pending_ptr = data + processed;
- // Stop polling.
- reset_pollin (pipe_handle);
- reset_pollin (socket_handle);
-
- // Reset outstanding timer.
- if (has_rx_timer) {
- cancel_timer (rx_timer_id);
- has_rx_timer = false;
+ int rc = process_input (it->second.decoder);
+ if (rc == -1) {
+ if (errno == EAGAIN) {
+ active_tsi = tsi;
+
+ // Stop polling.
+ reset_pollin (pipe_handle);
+ reset_pollin (socket_handle);
+
+ break;
}
- break;
+ it->second.joined = false;
+ delete it->second.decoder;
+ it->second.decoder = NULL;
+ insize = 0;
}
}
session->flush ();
}
+int zmq::pgm_receiver_t::process_input (v1_decoder_t *decoder)
+{
+ zmq_assert (session != NULL);
+
+ while (insize > 0) {
+ size_t n = 0;
+ int rc = decoder->decode (inpos, insize, n);
+ if (rc == -1)
+ return -1;
+ inpos += n;
+ insize -= n;
+ if (rc == 0)
+ break;
+ rc = session->push_msg (decoder->msg ());
+ if (rc == -1) {
+ errno_assert (errno == EAGAIN);
+ return -1;
+ }
+ }
+ return 0;
+}
+
+
void zmq::pgm_receiver_t::timer_event (int token)
{
zmq_assert (token == rx_timer_id);
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2010-2011 Miru Limited
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
#include "io_object.hpp"
#include "i_engine.hpp"
#include "options.hpp"
-#include "decoder.hpp"
+#include "v1_decoder.hpp"
#include "pgm_socket.hpp"
namespace zmq
void plug (zmq::io_thread_t *io_thread_,
zmq::session_base_t *session_);
void terminate ();
- void activate_in ();
- void activate_out ();
+ void restart_input ();
+ void restart_output ();
+ void zap_msg_available () {}
// i_poll_events interface implementation.
void in_event ();
// Unplug the engine from the session.
void unplug ();
+ // Decode received data (inpos, insize) and forward decoded
+ // messages to the session.
+ int process_input (v1_decoder_t *decoder);
+
// PGM is not able to move subscriptions upstream. Thus, drop all
// the pending subscriptions.
void drop_subscriptions ();
struct peer_info_t
{
bool joined;
- decoder_t *decoder;
+ v1_decoder_t *decoder;
};
struct tsi_comp
// Associated session.
zmq::session_base_t *session;
- // Most recently used decoder.
- decoder_t *mru_decoder;
+ const pgm_tsi_t *active_tsi;
// Number of bytes not consumed by the decoder due to pipe overflow.
- size_t pending_bytes;
+ size_t insize;
// Pointer to data still waiting to be processed by the decoder.
- unsigned char *pending_ptr;
+ const unsigned char *inpos;
// Poll handle associated with PGM socket.
handle_t socket_handle;
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2010-2011 Miru Limited
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
io_object_t (parent_),
has_tx_timer (false),
has_rx_timer (false),
+ session (NULL),
encoder (0),
+ more_flag (false),
pgm_socket (false, options_),
options (options_),
out_buffer (NULL),
out_buffer_size (0),
write_size (0)
{
+ int rc = msg.init ();
+ errno_assert (rc == 0);
}
int zmq::pgm_sender_t::init (bool udp_encapsulation_, const char *network_)
fd_t rdata_notify_fd = retired_fd;
fd_t pending_notify_fd = retired_fd;
- encoder.set_msg_source (session_);
+ session = session_;
// Fill fds from PGM transport and add them to the poller.
pgm_socket.get_sender_fds (&downlink_socket_fd, &uplink_socket_fd,
rm_fd (uplink_handle);
rm_fd (rdata_notify_handle);
rm_fd (pending_notify_handle);
- encoder.set_msg_source (NULL);
+ session = NULL;
}
void zmq::pgm_sender_t::terminate ()
delete this;
}
-void zmq::pgm_sender_t::activate_out ()
+void zmq::pgm_sender_t::restart_output ()
{
set_pollout (handle);
out_event ();
}
-void zmq::pgm_sender_t::activate_in ()
+void zmq::pgm_sender_t::restart_input ()
{
zmq_assert (false);
}
zmq::pgm_sender_t::~pgm_sender_t ()
{
+ int rc = msg.close ();
+ errno_assert (rc == 0);
+
if (out_buffer) {
free (out_buffer);
out_buffer = NULL;
// the get data function we prevent it from returning its own buffer.
unsigned char *bf = out_buffer + sizeof (uint16_t);
size_t bfsz = out_buffer_size - sizeof (uint16_t);
- int offset = -1;
- encoder.get_data (&bf, &bfsz, &offset);
+ uint16_t offset = 0xffff;
+
+ size_t bytes = encoder.encode (&bf, bfsz);
+ while (bytes < bfsz) {
+ if (!more_flag && offset == 0xffff)
+ offset = static_cast <uint16_t> (bytes);
+ int rc = session->pull_msg (&msg);
+ if (rc == -1)
+ break;
+ more_flag = msg.flags () & msg_t::more;
+ encoder.load_msg (&msg);
+ bf = out_buffer + sizeof (uint16_t) + bytes;
+ bytes += encoder.encode (&bf, bfsz - bytes);
+ }
// If there are no data to write stop polling for output.
- if (!bfsz) {
+ if (bytes == 0) {
reset_pollout (handle);
return;
}
+ write_size = sizeof (uint16_t) + bytes;
+
// Put offset information in the buffer.
- write_size = bfsz + sizeof (uint16_t);
- put_uint16 (out_buffer, offset == -1 ? 0xffff : (uint16_t) offset);
+ put_uint16 (out_buffer, offset);
}
if (has_tx_timer) {
size_t nbytes = pgm_socket.send (out_buffer, write_size);
// We can write either all data or 0 which means rate limit reached.
- if (nbytes == write_size) {
+ if (nbytes == write_size)
write_size = 0;
- } else {
+ else {
zmq_assert (nbytes == 0);
if (errno == ENOMEM) {
const long timeout = pgm_socket.get_tx_timeout ();
add_timer (timeout, tx_timer_id);
has_tx_timer = true;
- } else
+ }
+ else
errno_assert (errno == EBUSY);
}
}
if (token == rx_timer_id) {
has_rx_timer = false;
in_event ();
- } else if (token == tx_timer_id) {
+ }
+ else
+ if (token == tx_timer_id) {
has_tx_timer = false;
out_event ();
- } else
+ }
+ else
zmq_assert (false);
}
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2010-2011 Miru Limited
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
#include "i_engine.hpp"
#include "options.hpp"
#include "pgm_socket.hpp"
-#include "encoder.hpp"
+#include "v1_encoder.hpp"
+#include "msg.hpp"
namespace zmq
{
void plug (zmq::io_thread_t *io_thread_,
zmq::session_base_t *session_);
void terminate ();
- void activate_in ();
- void activate_out ();
+ void restart_input ();
+ void restart_output ();
+ void zap_msg_available () {}
// i_poll_events interface implementation.
void in_event ();
bool has_tx_timer;
bool has_rx_timer;
+ session_base_t *session;
+
// Message encoder.
- encoder_t encoder;
+ v1_encoder_t encoder;
+
+ msg_t msg;
+
+ // Keeps track of message boundaries.
+ bool more_flag;
// PGM socket.
pgm_socket_t pgm_socket;
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2010-2011 Miru Limited
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
!pgm_setsockopt (sock, IPPROTO_PGM, PGM_NAK_NCF_RETRIES,
&nak_ncf_retries, sizeof (nak_ncf_retries)))
goto err_abort;
- } else {
+ }
+ else {
const int send_only = 1,
max_rte = (int) ((options.rate * 1000) / 8),
txw_max_tpdu = (int) pgm_max_tpdu,
goto err_abort;
// Expedited Forwarding PHB for network elements, no ECN.
+ // Ignore return value due to varied runtime support.
const int dscp = 0x2e << 2;
- if (AF_INET6 != sa_family && !pgm_setsockopt (sock,
- IPPROTO_PGM, PGM_TOS, &dscp, sizeof (dscp)))
- goto err_abort;
+ if (AF_INET6 != sa_family)
+ pgm_setsockopt (sock, IPPROTO_PGM, PGM_TOS,
+ &dscp, sizeof (dscp));
const int nonblocking = 1;
if (!pgm_setsockopt (sock, IPPROTO_PGM, PGM_NOBLOCK,
if (nbytes > 0) {
zmq_assert (status == PGM_IO_STATUS_NORMAL);
zmq_assert (nbytes == data_len_);
- } else {
+ }
+ else {
zmq_assert (status == PGM_IO_STATUS_RATE_LIMITED ||
status == PGM_IO_STATUS_WOULD_BLOCK);
if (status == PGM_IO_STATUS_TIMER_PENDING)
errno = EBUSY;
- else if (status == PGM_IO_STATUS_RATE_LIMITED)
+ else
+ if (status == PGM_IO_STATUS_RATE_LIMITED)
errno = ENOMEM;
else
errno = EAGAIN;
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2010-2011 Miru Limited
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2011 VMware, Inc.
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
#include "pipe.hpp"
#include "err.hpp"
+#include "ypipe.hpp"
+#include "ypipe_conflate.hpp"
+
int zmq::pipepair (class object_t *parents_ [2], class pipe_t* pipes_ [2],
- int hwms_ [2], bool delays_ [2])
+ int hwms_ [2], bool conflate_ [2])
{
// Creates two pipe objects. These objects are connected by two ypipes,
// each to pass messages in one direction.
- pipe_t::upipe_t *upipe1 = new (std::nothrow) pipe_t::upipe_t ();
+ typedef ypipe_t <msg_t, message_pipe_granularity> upipe_normal_t;
+ typedef ypipe_conflate_t <msg_t, message_pipe_granularity> upipe_conflate_t;
+
+ pipe_t::upipe_t *upipe1;
+ if(conflate_ [0])
+ upipe1 = new (std::nothrow) upipe_conflate_t ();
+ else
+ upipe1 = new (std::nothrow) upipe_normal_t ();
alloc_assert (upipe1);
- pipe_t::upipe_t *upipe2 = new (std::nothrow) pipe_t::upipe_t ();
+
+ pipe_t::upipe_t *upipe2;
+ if(conflate_ [1])
+ upipe2 = new (std::nothrow) upipe_conflate_t ();
+ else
+ upipe2 = new (std::nothrow) upipe_normal_t ();
alloc_assert (upipe2);
pipes_ [0] = new (std::nothrow) pipe_t (parents_ [0], upipe1, upipe2,
- hwms_ [1], hwms_ [0], delays_ [0]);
+ hwms_ [1], hwms_ [0], conflate_ [0]);
alloc_assert (pipes_ [0]);
pipes_ [1] = new (std::nothrow) pipe_t (parents_ [1], upipe2, upipe1,
- hwms_ [0], hwms_ [1], delays_ [1]);
+ hwms_ [0], hwms_ [1], conflate_ [1]);
alloc_assert (pipes_ [1]);
pipes_ [0]->set_peer (pipes_ [1]);
}
zmq::pipe_t::pipe_t (object_t *parent_, upipe_t *inpipe_, upipe_t *outpipe_,
- int inhwm_, int outhwm_, bool delay_) :
+ int inhwm_, int outhwm_, bool conflate_) :
object_t (parent_),
inpipe (inpipe_),
outpipe (outpipe_),
peer (NULL),
sink (NULL),
state (active),
- delay (delay_)
+ delay (true),
+ conflate (conflate_)
{
}
bool zmq::pipe_t::check_read ()
{
- if (unlikely (!in_active || (state != active && state != pending)))
+ if (unlikely (!in_active))
+ return false;
+ if (unlikely (state != active && state != waiting_for_delimiter))
return false;
// Check if there's an item in the pipe.
msg_t msg;
bool ok = inpipe->read (&msg);
zmq_assert (ok);
- delimit ();
+ process_delimiter ();
return false;
}
bool zmq::pipe_t::read (msg_t *msg_)
{
- if (unlikely (!in_active || (state != active && state != pending)))
+ if (unlikely (!in_active))
+ return false;
+ if (unlikely (state != active && state != waiting_for_delimiter))
return false;
if (!inpipe->read (msg_)) {
// If delimiter was read, start termination process of the pipe.
if (msg_->is_delimiter ()) {
- delimit ();
+ process_delimiter ();
return false;
}
// Remove incomplete message from the outbound pipe.
msg_t msg;
if (outpipe) {
- while (outpipe->unwrite (&msg)) {
- zmq_assert (msg.flags () & msg_t::more);
- int rc = msg.close ();
- errno_assert (rc == 0);
- }
+ while (outpipe->unwrite (&msg)) {
+ zmq_assert (msg.flags () & msg_t::more);
+ int rc = msg.close ();
+ errno_assert (rc == 0);
+ }
}
}
void zmq::pipe_t::flush ()
{
// The peer does not exist anymore at this point.
- if (state == terminating)
+ if (state == term_ack_sent)
return;
if (outpipe && !outpipe->flush ())
void zmq::pipe_t::process_activate_read ()
{
- if (!in_active && (state == active || state == pending)) {
+ if (!in_active && (state == active || state == waiting_for_delimiter)) {
in_active = true;
sink->read_activated (this);
}
{
// This is the simple case of peer-induced termination. If there are no
// more pending messages to read, or if the pipe was configured to drop
- // pending messages, we can move directly to the terminating state.
- // Otherwise we'll hang up in pending state till all the pending messages
- // are sent.
+ // pending messages, we can move directly to the term_ack_sent state.
+ // Otherwise we'll hang up in waiting_for_delimiter state till all
+ // pending messages are read.
if (state == active) {
if (!delay) {
- state = terminating;
+ state = term_ack_sent;
outpipe = NULL;
send_pipe_term_ack (peer);
}
else
- state = pending;
+ state = waiting_for_delimiter;
return;
}
// Delimiter happened to arrive before the term command. Now we have the
- // term command as well, so we can move straight to terminating state.
- if (state == delimited) {
- state = terminating;
+ // term command as well, so we can move straight to term_ack_sent state.
+ if (state == delimiter_received) {
+ state = term_ack_sent;
outpipe = NULL;
send_pipe_term_ack (peer);
return;
// This is the case where both ends of the pipe are closed in parallel.
// We simply reply to the request by ack and continue waiting for our
// own ack.
- if (state == terminated) {
- state = double_terminated;
+ if (state == term_req_sent1) {
+ state = term_req_sent2;
outpipe = NULL;
send_pipe_term_ack (peer);
return;
{
// Notify the user that all the references to the pipe should be dropped.
zmq_assert (sink);
- sink->terminated (this);
+ sink->pipe_terminated (this);
- // In terminating and double_terminated states there's nothing to do.
- // Simply deallocate the pipe. In terminated state we have to ack the
- // peer before deallocating this side of the pipe. All the other states
- // are invalid.
- if (state == terminated) {
+ // In term_ack_sent and term_req_sent2 states there's nothing to do.
+ // Simply deallocate the pipe. In term_req_sent1 state we have to ack
+ // the peer before deallocating this side of the pipe.
+ // All the other states are invalid.
+ if (state == term_req_sent1) {
outpipe = NULL;
send_pipe_term_ack (peer);
}
else
- zmq_assert (state == terminating || state == double_terminated);
+ zmq_assert (state == term_ack_sent || state == term_req_sent2);
// We'll deallocate the inbound pipe, the peer will deallocate the outbound
// pipe (which is an inbound pipe from its point of view).
// First, delete all the unread messages in the pipe. We have to do it by
// hand because msg_t doesn't have automatic destructor. Then deallocate
// the ypipe itself.
- msg_t msg;
- while (inpipe->read (&msg)) {
- int rc = msg.close ();
- errno_assert (rc == 0);
+
+ if (!conflate) {
+ msg_t msg;
+ while (inpipe->read (&msg)) {
+ int rc = msg.close ();
+ errno_assert (rc == 0);
+ }
}
+
delete inpipe;
// Deallocate the pipe object
delete this;
}
+void zmq::pipe_t::set_nodelay ()
+{
+ this->delay = false;
+}
+
void zmq::pipe_t::terminate (bool delay_)
{
// Overload the value specified at pipe creation.
delay = delay_;
// If terminate was already called, we can ignore the duplicit invocation.
- if (state == terminated || state == double_terminated)
+ if (state == term_req_sent1 || state == term_req_sent2)
return;
// If the pipe is in the final phase of async termination, it's going to
// closed anyway. No need to do anything special here.
- else if (state == terminating)
+ else
+ if (state == term_ack_sent)
return;
// The simple sync termination case. Ask the peer to terminate and wait
// for the ack.
- else if (state == active) {
+ else
+ if (state == active) {
send_pipe_term (peer);
- state = terminated;
+ state = term_req_sent1;
}
// There are still pending messages available, but the user calls
// 'terminate'. We can act as if all the pending messages were read.
- else if (state == pending && !delay) {
+ else
+ if (state == waiting_for_delimiter && !delay) {
outpipe = NULL;
send_pipe_term_ack (peer);
- state = terminating;
+ state = term_ack_sent;
}
// If there are pending messages still availabe, do nothing.
- else if (state == pending) {
+ else
+ if (state == waiting_for_delimiter) {
}
// We've already got delimiter, but not term command yet. We can ignore
// the delimiter and ack synchronously terminate as if we were in
// active state.
- else if (state == delimited) {
+ else
+ if (state == delimiter_received) {
send_pipe_term (peer);
- state = terminated;
+ state = term_req_sent1;
}
// There are no other states.
if (outpipe) {
- // Drop any unfinished outbound messages.
- rollback ();
+ // Drop any unfinished outbound messages.
+ rollback ();
- // Write the delimiter into the pipe. Note that watermarks are not
- // checked; thus the delimiter can be written even when the pipe is full.
- msg_t msg;
- msg.init_delimiter ();
- outpipe->write (msg, false);
- flush ();
+ // Write the delimiter into the pipe. Note that watermarks are not
+ // checked; thus the delimiter can be written even when the pipe is full.
+ msg_t msg;
+ msg.init_delimiter ();
+ outpipe->write (msg, false);
+ flush ();
}
}
return result;
}
-void zmq::pipe_t::delimit ()
+void zmq::pipe_t::process_delimiter ()
{
- if (state == active) {
- state = delimited;
- return;
- }
+ zmq_assert (state == active
+ || state == waiting_for_delimiter);
- if (state == pending) {
+ if (state == active)
+ state = delimiter_received;
+ else {
outpipe = NULL;
send_pipe_term_ack (peer);
- state = terminating;
- return;
+ state = term_ack_sent;
}
-
- // Delimiter in any other state is invalid.
- zmq_assert (false);
}
void zmq::pipe_t::hiccup ()
inpipe = NULL;
// Create new inpipe.
- inpipe = new (std::nothrow) pipe_t::upipe_t ();
+ if (conflate)
+ inpipe = new (std::nothrow)
+ ypipe_conflate_t <msg_t, message_pipe_granularity> ();
+ else
+ inpipe = new (std::nothrow)
+ ypipe_t <msg_t, message_pipe_granularity> ();
+
alloc_assert (inpipe);
in_active = true;
send_hiccup (peer, (void*) inpipe);
}
+void zmq::pipe_t::set_hwms (int inhwm_, int outhwm_)
+{
+ lwm = compute_lwm (inhwm_);
+ hwm = outhwm_;
+}
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2011 VMware, Inc.
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
#define __ZMQ_PIPE_HPP_INCLUDED__
#include "msg.hpp"
-#include "ypipe.hpp"
+#include "ypipe_base.hpp"
#include "config.hpp"
#include "object.hpp"
#include "stdint.hpp"
// Delay specifies how the pipe behaves when the peer terminates. If true
// pipe receives all the pending messages before terminating, otherwise it
// terminates straight away.
+ // If conflate is true, only the most recently arrived message could be
+ // read (older messages are discarded)
int pipepair (zmq::object_t *parents_ [2], zmq::pipe_t* pipes_ [2],
- int hwms_ [2], bool delays_ [2]);
+ int hwms_ [2], bool conflate_ [2]);
struct i_pipe_events
{
virtual void read_activated (zmq::pipe_t *pipe_) = 0;
virtual void write_activated (zmq::pipe_t *pipe_) = 0;
virtual void hiccuped (zmq::pipe_t *pipe_) = 0;
- virtual void terminated (zmq::pipe_t *pipe_) = 0;
+ virtual void pipe_terminated (zmq::pipe_t *pipe_) = 0;
};
// Note that pipe can be stored in three different arrays.
public array_item_t <3>
{
// This allows pipepair to create pipe objects.
- friend int pipepair (zmq::object_t *parents_ [2],
- zmq::pipe_t* pipes_ [2], int hwms_ [2], bool delays_ [2]);
-
+ friend int pipepair (zmq::object_t *parents_ [2], zmq::pipe_t* pipes_ [2],
+ int hwms_ [2], bool conflate_ [2]);
+
public:
// Specifies the object to send events to.
// all the messages on the fly. Causes 'hiccuped' event to be generated
// in the peer.
void hiccup ();
+
+ // Ensure the pipe wont block on receiving pipe_term.
+ void set_nodelay ();
// Ask pipe to terminate. The termination will happen asynchronously
// and user will be notified about actual deallocation by 'terminated'
// before actual shutdown.
void terminate (bool delay_);
+ // set the high water marks.
+ void set_hwms (int inhwm_, int outhwm_);
+
private:
// Type of the underlying lock-free pipe.
- typedef ypipe_t <msg_t, message_pipe_granularity> upipe_t;
+ typedef ypipe_base_t <msg_t, message_pipe_granularity> upipe_t;
// Command handlers.
void process_activate_read ();
void process_pipe_term_ack ();
// Handler for delimiter read from the pipe.
- void delimit ();
+ void process_delimiter ();
// Constructor is private. Pipe can only be created using
// pipepair function.
pipe_t (object_t *parent_, upipe_t *inpipe_, upipe_t *outpipe_,
- int inhwm_, int outhwm_, bool delay_);
+ int inhwm_, int outhwm_, bool conflate_);
// Pipepair uses this function to let us know about
// the peer pipe object.
// Sink to send events to.
i_pipe_events *sink;
- // State of the pipe endpoint. Active is common state before any
- // termination begins. Delimited means that delimiter was read from
- // pipe before term command was received. Pending means that term
- // command was already received from the peer but there are still
- // pending messages to read. Terminating means that all pending
- // messages were already read and all we are waiting for is ack from
- // the peer. Terminated means that 'terminate' was explicitly called
- // by the user. Double_terminated means that user called 'terminate'
- // and then we've got term command from the peer as well.
+ // States of the pipe endpoint:
+ // active: common state before any termination begins,
+ // delimiter_received: delimiter was read from pipe before
+ // term command was received,
+ // waiting_fo_delimiter: term command was already received
+ // from the peer but there are still pending messages to read,
+ // term_ack_sent: all pending messages were already read and
+ // all we are waiting for is ack from the peer,
+ // term_req_sent1: 'terminate' was explicitly called by the user,
+ // term_req_sent2: user called 'terminate' and then we've got
+ // term command from the peer as well.
enum {
active,
- delimited,
- pending,
- terminating,
- terminated,
- double_terminated
+ delimiter_received,
+ waiting_for_delimiter,
+ term_ack_sent,
+ term_req_sent1,
+ term_req_sent2
} state;
// If true, we receive all the pending inbound messages before
// Computes appropriate low watermark from the given high watermark.
static int compute_lwm (int hwm_);
+ bool conflate;
+
// Disable copying.
pipe_t (const pipe_t&);
const pipe_t &operator = (const pipe_t&);
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "platform.hpp"
+#ifdef ZMQ_HAVE_WINDOWS
+#include "windows.hpp"
+#endif
+
+#include <string.h>
+#include <string>
+
+#include "msg.hpp"
+#include "session_base.hpp"
+#include "err.hpp"
+#include "plain_mechanism.hpp"
+#include "wire.hpp"
+
+zmq::plain_mechanism_t::plain_mechanism_t (session_base_t *session_,
+ const std::string &peer_address_,
+ const options_t &options_) :
+ mechanism_t (options_),
+ session (session_),
+ peer_address (peer_address_),
+ expecting_zap_reply (false),
+ state (options.as_server? waiting_for_hello: sending_hello)
+{
+}
+
+zmq::plain_mechanism_t::~plain_mechanism_t ()
+{
+}
+
+int zmq::plain_mechanism_t::next_handshake_command (msg_t *msg_)
+{
+ int rc = 0;
+
+ switch (state) {
+ case sending_hello:
+ rc = produce_hello (msg_);
+ if (rc == 0)
+ state = waiting_for_welcome;
+ break;
+ case sending_welcome:
+ rc = produce_welcome (msg_);
+ if (rc == 0)
+ state = waiting_for_initiate;
+ break;
+ case sending_initiate:
+ rc = produce_initiate (msg_);
+ if (rc == 0)
+ state = waiting_for_ready;
+ break;
+ case sending_ready:
+ rc = produce_ready (msg_);
+ if (rc == 0)
+ state = ready;
+ break;
+ default:
+ errno = EAGAIN;
+ rc = -1;
+ }
+ return rc;
+}
+
+int zmq::plain_mechanism_t::process_handshake_command (msg_t *msg_)
+{
+ int rc = 0;
+
+ switch (state) {
+ case waiting_for_hello:
+ rc = process_hello (msg_);
+ if (rc == 0)
+ state = expecting_zap_reply? waiting_for_zap_reply: sending_welcome;
+ break;
+ case waiting_for_welcome:
+ rc = process_welcome (msg_);
+ if (rc == 0)
+ state = sending_initiate;
+ break;
+ case waiting_for_initiate:
+ rc = process_initiate (msg_);
+ if (rc == 0)
+ state = sending_ready;
+ break;
+ case waiting_for_ready:
+ rc = process_ready (msg_);
+ if (rc == 0)
+ state = ready;
+ break;
+ default:
+ errno = EPROTO;
+ rc = -1;
+ break;
+ }
+ if (rc == 0) {
+ rc = msg_->close ();
+ errno_assert (rc == 0);
+ rc = msg_->init ();
+ errno_assert (rc == 0);
+ }
+ return rc;
+}
+
+bool zmq::plain_mechanism_t::is_handshake_complete () const
+{
+ return state == ready;
+}
+
+int zmq::plain_mechanism_t::zap_msg_available ()
+{
+ if (state != waiting_for_zap_reply) {
+ errno = EFSM;
+ return -1;
+ }
+ const int rc = receive_and_process_zap_reply ();
+ if (rc == 0)
+ state = sending_welcome;
+ return rc;
+}
+
+int zmq::plain_mechanism_t::produce_hello (msg_t *msg_) const
+{
+ const std::string username = options.plain_username;
+ zmq_assert (username.length () < 256);
+
+ const std::string password = options.plain_password;
+ zmq_assert (password.length () < 256);
+
+ const size_t command_size = 6 + 1 + username.length ()
+ + 1 + password.length ();
+
+ const int rc = msg_->init_size (command_size);
+ errno_assert (rc == 0);
+
+ unsigned char *ptr = static_cast <unsigned char *> (msg_->data ());
+ memcpy (ptr, "\x05HELLO", 6);
+ ptr += 6;
+
+ *ptr++ = static_cast <unsigned char> (username.length ());
+ memcpy (ptr, username.c_str (), username.length ());
+ ptr += username.length ();
+
+ *ptr++ = static_cast <unsigned char> (password.length ());
+ memcpy (ptr, password.c_str (), password.length ());
+ ptr += password.length ();
+
+ return 0;
+}
+
+
+int zmq::plain_mechanism_t::process_hello (msg_t *msg_)
+{
+ const unsigned char *ptr = static_cast <unsigned char *> (msg_->data ());
+ size_t bytes_left = msg_->size ();
+
+ if (bytes_left < 6 || memcmp (ptr, "\x05HELLO", 6)) {
+ errno = EPROTO;
+ return -1;
+ }
+ ptr += 6;
+ bytes_left -= 6;
+
+ if (bytes_left < 1) {
+ errno = EPROTO;
+ return -1;
+ }
+ const size_t username_length = static_cast <size_t> (*ptr++);
+ bytes_left -= 1;
+
+ if (bytes_left < username_length) {
+ errno = EPROTO;
+ return -1;
+ }
+ const std::string username = std::string ((char *) ptr, username_length);
+ ptr += username_length;
+ bytes_left -= username_length;
+
+ if (bytes_left < 1) {
+ errno = EPROTO;
+ return -1;
+ }
+ const size_t password_length = static_cast <size_t> (*ptr++);
+ bytes_left -= 1;
+
+ if (bytes_left < password_length) {
+ errno = EPROTO;
+ return -1;
+ }
+ const std::string password = std::string ((char *) ptr, password_length);
+ ptr += password_length;
+ bytes_left -= password_length;
+
+ if (bytes_left > 0) {
+ errno = EPROTO;
+ return -1;
+ }
+
+ // Use ZAP protocol (RFC 27) to authenticate the user.
+ int rc = session->zap_connect ();
+ if (rc == 0) {
+ send_zap_request (username, password);
+ rc = receive_and_process_zap_reply ();
+ if (rc != 0) {
+ if (errno != EAGAIN)
+ return -1;
+ expecting_zap_reply = true;
+ }
+ }
+
+ return 0;
+}
+
+int zmq::plain_mechanism_t::produce_welcome (msg_t *msg_) const
+{
+ const int rc = msg_->init_size (8);
+ errno_assert (rc == 0);
+ memcpy (msg_->data (), "\x07WELCOME", 8);
+ return 0;
+}
+
+int zmq::plain_mechanism_t::process_welcome (msg_t *msg_)
+{
+ const unsigned char *ptr = static_cast <unsigned char *> (msg_->data ());
+ size_t bytes_left = msg_->size ();
+
+ if (bytes_left != 8 || memcmp (ptr, "\x07WELCOME", 8)) {
+ errno = EPROTO;
+ return -1;
+ }
+ return 0;
+}
+
+int zmq::plain_mechanism_t::produce_initiate (msg_t *msg_) const
+{
+ unsigned char * const command_buffer = (unsigned char *) malloc (512);
+ alloc_assert (command_buffer);
+
+ unsigned char *ptr = command_buffer;
+
+ // Add mechanism string
+ memcpy (ptr, "\x08INITIATE", 9);
+ ptr += 9;
+
+ // Add socket type property
+ const char *socket_type = socket_type_string (options.type);
+ ptr += add_property (ptr, "Socket-Type", socket_type, strlen (socket_type));
+
+ // Add identity property
+ if (options.type == ZMQ_REQ
+ || options.type == ZMQ_DEALER
+ || options.type == ZMQ_ROUTER) {
+ ptr += add_property (ptr, "Identity",
+ options.identity, options.identity_size);
+ }
+
+ const size_t command_size = ptr - command_buffer;
+ const int rc = msg_->init_size (command_size);
+ errno_assert (rc == 0);
+ memcpy (msg_->data (), command_buffer, command_size);
+ free (command_buffer);
+
+ return 0;
+}
+
+int zmq::plain_mechanism_t::process_initiate (msg_t *msg_)
+{
+ const unsigned char *ptr = static_cast <unsigned char *> (msg_->data ());
+ size_t bytes_left = msg_->size ();
+
+ if (bytes_left < 9 || memcmp (ptr, "\x08INITIATE", 9)) {
+ errno = EPROTO;
+ return -1;
+ }
+ ptr += 9;
+ bytes_left -= 9;
+ return parse_metadata (ptr, bytes_left);
+}
+
+int zmq::plain_mechanism_t::produce_ready (msg_t *msg_) const
+{
+ unsigned char * const command_buffer = (unsigned char *) malloc (512);
+ alloc_assert (command_buffer);
+
+ unsigned char *ptr = command_buffer;
+
+ // Add command name
+ memcpy (ptr, "\x05READY", 6);
+ ptr += 6;
+
+ // Add socket type property
+ const char *socket_type = socket_type_string (options.type);
+ ptr += add_property (ptr, "Socket-Type", socket_type, strlen (socket_type));
+
+ // Add identity property
+ if (options.type == ZMQ_REQ
+ || options.type == ZMQ_DEALER
+ || options.type == ZMQ_ROUTER) {
+ ptr += add_property (ptr, "Identity",
+ options.identity, options.identity_size);
+ }
+
+ const size_t command_size = ptr - command_buffer;
+ const int rc = msg_->init_size (command_size);
+ errno_assert (rc == 0);
+ memcpy (msg_->data (), command_buffer, command_size);
+ free (command_buffer);
+
+ return 0;
+}
+
+int zmq::plain_mechanism_t::process_ready (msg_t *msg_)
+{
+ const unsigned char *ptr = static_cast <unsigned char *> (msg_->data ());
+ size_t bytes_left = msg_->size ();
+
+ if (bytes_left < 6 || memcmp (ptr, "\x05READY", 6)) {
+ errno = EPROTO;
+ return -1;
+ }
+ ptr += 6;
+ bytes_left -= 6;
+ return parse_metadata (ptr, bytes_left);
+}
+
+void zmq::plain_mechanism_t::send_zap_request (const std::string &username,
+ const std::string &password)
+{
+ int rc;
+ msg_t msg;
+
+ // Address delimiter frame
+ rc = msg.init ();
+ errno_assert (rc == 0);
+ msg.set_flags (msg_t::more);
+ rc = session->write_zap_msg (&msg);
+ errno_assert (rc == 0);
+
+ // Version frame
+ rc = msg.init_size (3);
+ errno_assert (rc == 0);
+ memcpy (msg.data (), "1.0", 3);
+ msg.set_flags (msg_t::more);
+ rc = session->write_zap_msg (&msg);
+ errno_assert (rc == 0);
+
+ // Request id frame
+ rc = msg.init_size (1);
+ errno_assert (rc == 0);
+ memcpy (msg.data (), "1", 1);
+ msg.set_flags (msg_t::more);
+ rc = session->write_zap_msg (&msg);
+ errno_assert (rc == 0);
+
+ // Domain frame
+ rc = msg.init_size (options.zap_domain.length ());
+ errno_assert (rc == 0);
+ memcpy (msg.data (), options.zap_domain.c_str (), options.zap_domain.length ());
+ msg.set_flags (msg_t::more);
+ rc = session->write_zap_msg (&msg);
+ errno_assert (rc == 0);
+
+ // Address frame
+ rc = msg.init_size (peer_address.length ());
+ errno_assert (rc == 0);
+ memcpy (msg.data (), peer_address.c_str (), peer_address.length ());
+ msg.set_flags (msg_t::more);
+ rc = session->write_zap_msg (&msg);
+ errno_assert (rc == 0);
+
+ // Identity frame
+ rc = msg.init_size (options.identity_size);
+ errno_assert (rc == 0);
+ memcpy (msg.data (), options.identity, options.identity_size);
+ msg.set_flags (msg_t::more);
+ rc = session->write_zap_msg (&msg);
+ errno_assert (rc == 0);
+
+ // Mechanism frame
+ rc = msg.init_size (5);
+ errno_assert (rc == 0);
+ memcpy (msg.data (), "PLAIN", 5);
+ msg.set_flags (msg_t::more);
+ rc = session->write_zap_msg (&msg);
+ errno_assert (rc == 0);
+
+ // Username frame
+ rc = msg.init_size (username.length ());
+ errno_assert (rc == 0);
+ memcpy (msg.data (), username.c_str (), username.length ());
+ msg.set_flags (msg_t::more);
+ rc = session->write_zap_msg (&msg);
+ errno_assert (rc == 0);
+
+ // Password frame
+ rc = msg.init_size (password.length ());
+ errno_assert (rc == 0);
+ memcpy (msg.data (), password.c_str (), password.length ());
+ rc = session->write_zap_msg (&msg);
+ errno_assert (rc == 0);
+}
+
+int zmq::plain_mechanism_t::receive_and_process_zap_reply ()
+{
+ int rc = 0;
+ msg_t msg [7]; // ZAP reply consists of 7 frames
+
+ // Initialize all reply frames
+ for (int i = 0; i < 7; i++) {
+ rc = msg [i].init ();
+ errno_assert (rc == 0);
+ }
+
+ for (int i = 0; i < 7; i++) {
+ rc = session->read_zap_msg (&msg [i]);
+ if (rc == -1)
+ break;
+ if ((msg [i].flags () & msg_t::more) == (i < 6? 0: msg_t::more)) {
+ errno = EPROTO;
+ rc = -1;
+ break;
+ }
+ }
+
+ if (rc != 0)
+ goto error;
+
+ // Address delimiter frame
+ if (msg [0].size () > 0) {
+ rc = -1;
+ errno = EPROTO;
+ goto error;
+ }
+
+ // Version frame
+ if (msg [1].size () != 3 || memcmp (msg [1].data (), "1.0", 3)) {
+ rc = -1;
+ errno = EPROTO;
+ goto error;
+ }
+
+ // Request id frame
+ if (msg [2].size () != 1 || memcmp (msg [2].data (), "1", 1)) {
+ rc = -1;
+ errno = EPROTO;
+ goto error;
+ }
+
+ // Status code frame
+ if (msg [3].size () != 3 || memcmp (msg [3].data (), "200", 3)) {
+ rc = -1;
+ errno = EACCES;
+ goto error;
+ }
+
+ // Process metadata frame
+ rc = parse_metadata (static_cast <const unsigned char*> (msg [6].data ()),
+ msg [6].size ());
+
+error:
+ for (int i = 0; i < 7; i++) {
+ const int rc2 = msg [i].close ();
+ errno_assert (rc2 == 0);
+ }
+
+ return rc;
+}
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __ZMQ_PLAIN_MECHANISM_HPP_INCLUDED__
+#define __ZMQ_PLAIN_MECHANISM_HPP_INCLUDED__
+
+#include "mechanism.hpp"
+#include "options.hpp"
+
+namespace zmq
+{
+
+ class msg_t;
+ class session_base_t;
+
+ class plain_mechanism_t : public mechanism_t
+ {
+ public:
+
+ plain_mechanism_t (session_base_t *session_,
+ const std::string &peer_address_,
+ const options_t &options_);
+ virtual ~plain_mechanism_t ();
+
+ // mechanism implementation
+ virtual int next_handshake_command (msg_t *msg_);
+ virtual int process_handshake_command (msg_t *msg_);
+ virtual int zap_msg_available ();
+ virtual bool is_handshake_complete () const;
+
+ private:
+
+ enum state_t {
+ sending_hello,
+ waiting_for_hello,
+ sending_welcome,
+ waiting_for_welcome,
+ sending_initiate,
+ waiting_for_initiate,
+ sending_ready,
+ waiting_for_ready,
+ waiting_for_zap_reply,
+ ready
+ };
+
+ session_base_t * const session;
+
+ const std::string peer_address;
+
+ // True iff we are awaiting reply from ZAP reply.
+ bool expecting_zap_reply;
+
+ state_t state;
+
+ int produce_hello (msg_t *msg_) const;
+ int produce_welcome (msg_t *msg_) const;
+ int produce_initiate (msg_t *msg_) const;
+ int produce_ready (msg_t *msg_) const;
+
+ int process_hello (msg_t *msg_);
+ int process_welcome (msg_t *msg);
+ int process_ready (msg_t *msg_);
+ int process_initiate (msg_t *msg_);
+
+ void send_zap_request (const std::string &username,
+ const std::string &password);
+ int receive_and_process_zap_reply ();
+ };
+
+}
+
+#endif
-/* src/platform.hpp.in. Generated from configure.in by autoheader. */
+/* src/platform.hpp.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you have the <alloca.h> header file. */
#undef HAVE_ALLOCA_H
/* Define to 1 if you have the <errno.h> header file. */
#undef HAVE_ERRNO_H
+/* Define to 1 if you have the `fork' function. */
+#undef HAVE_FORK
+
/* Define to 1 if you have the `freeifaddrs' function. */
#undef HAVE_FREEIFADDRS
/* Define to 1 if you have the `socket' library (-lsocket). */
#undef HAVE_LIBSOCKET
+/* Define to 1 if you have the `sodium' library (-lsodium). */
+#undef HAVE_LIBSODIUM
+
/* Define to 1 if you have the `ws2_32' library (-lws2_32). */
#undef HAVE_LIBWS2_32
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
stopping = true;
}
+int zmq::poll_t::max_fds ()
+{
+ return -1;
+}
+
void zmq::poll_t::loop ()
{
while (!stopping) {
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
void start ();
void stop ();
+ static int max_fds ();
+
private:
// Main worker thread routine.
/*
- Copyright (c) 2010-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
/*
- Copyright (c) 2010-2011 250bpm s.r.o.
- Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
{
if (amount_ > 0)
load.add (amount_);
- else if (amount_ < 0)
+ else
+ if (amount_ < 0)
load.sub (-amount_);
}
/*
- Copyright (c) 2010-2011 250bpm s.r.o.
- Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
/*
- Copyright (c) 2011 250bpm s.r.o.
- Copyright (c) 2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
/*
- Copyright (c) 2011 250bpm s.r.o.
- Copyright (c) 2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
/*
- Copyright (c) 2007-2012 iMatix Corporation
- Copyright (c) 2007-2012 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
/*
- Copyright (c) 2007-2012 iMatix Corporation
- Copyright (c) 2007-2012 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
/*
- Copyright (c) 2007-2012 iMatix Corporation
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
{
}
-int zmq::pub_t::xrecv (class msg_t *, int)
+int zmq::pub_t::xrecv (class msg_t *)
{
// Messages cannot be received from PUB socket.
errno = ENOTSUP;
{
return false;
}
-
-zmq::pub_session_t::pub_session_t (io_thread_t *io_thread_, bool connect_,
- socket_base_t *socket_, const options_t &options_,
- const address_t *addr_) :
- xpub_session_t (io_thread_, connect_, socket_, options_, addr_)
-{
-}
-
-zmq::pub_session_t::~pub_session_t ()
-{
-}
-
/*
- Copyright (c) 2007-2012 iMatix Corporation
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
~pub_t ();
// Implementations of virtual functions from socket_base_t.
- int xrecv (zmq::msg_t *msg_, int flags_);
+ int xrecv (zmq::msg_t *msg_);
bool xhas_in ();
private:
const pub_t &operator = (const pub_t&);
};
- class pub_session_t : public xpub_session_t
- {
- public:
-
- pub_session_t (zmq::io_thread_t *io_thread_, bool connect_,
- zmq::socket_base_t *socket_, const options_t &options_,
- const address_t *addr_);
- ~pub_session_t ();
-
- private:
-
- pub_session_t (const pub_session_t&);
- const pub_session_t &operator = (const pub_session_t&);
- };
-
}
#endif
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2010 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
{
}
-void zmq::pull_t::xattach_pipe (pipe_t *pipe_, bool icanhasall_)
+void zmq::pull_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_)
{
- // icanhasall_ is unused
- (void)icanhasall_;
+ // subscribe_to_all_ is unused
+ (void)subscribe_to_all_;
zmq_assert (pipe_);
fq.attach (pipe_);
fq.activated (pipe_);
}
-void zmq::pull_t::xterminated (pipe_t *pipe_)
+void zmq::pull_t::xpipe_terminated (pipe_t *pipe_)
{
- fq.terminated (pipe_);
+ fq.pipe_terminated (pipe_);
}
-int zmq::pull_t::xrecv (msg_t *msg_, int flags_)
+int zmq::pull_t::xrecv (msg_t *msg_)
{
- // flags_ is unused
- (void)flags_;
-
return fq.recv (msg_);
}
{
return fq.has_in ();
}
-
-zmq::pull_session_t::pull_session_t (io_thread_t *io_thread_, bool connect_,
- socket_base_t *socket_, const options_t &options_,
- const address_t *addr_) :
- session_base_t (io_thread_, connect_, socket_, options_, addr_)
-{
-}
-
-zmq::pull_session_t::~pull_session_t ()
-{
-}
-
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2010 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
protected:
// Overloads of functions from socket_base_t.
- void xattach_pipe (zmq::pipe_t *pipe_, bool icanhasall_);
- int xrecv (zmq::msg_t *msg_, int flags_);
+ void xattach_pipe (zmq::pipe_t *pipe_, bool subscribe_to_all_);
+ int xrecv (zmq::msg_t *msg_);
bool xhas_in ();
void xread_activated (zmq::pipe_t *pipe_);
- void xterminated (zmq::pipe_t *pipe_);
+ void xpipe_terminated (zmq::pipe_t *pipe_);
private:
};
- class pull_session_t : public session_base_t
- {
- public:
-
- pull_session_t (zmq::io_thread_t *io_thread_, bool connect_,
- socket_base_t *socket_, const options_t &options_,
- const address_t *addr_);
- ~pull_session_t ();
-
- private:
-
- pull_session_t (const pull_session_t&);
- const pull_session_t &operator = (const pull_session_t&);
- };
-
}
#endif
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2010 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
{
}
-void zmq::push_t::xattach_pipe (pipe_t *pipe_, bool icanhasall_)
+void zmq::push_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_)
{
- // icanhasall_ is unused
- (void)icanhasall_;
+ // subscribe_to_all_ is unused
+ (void)subscribe_to_all_;
zmq_assert (pipe_);
lb.attach (pipe_);
lb.activated (pipe_);
}
-void zmq::push_t::xterminated (pipe_t *pipe_)
+void zmq::push_t::xpipe_terminated (pipe_t *pipe_)
{
- lb.terminated (pipe_);
+ lb.pipe_terminated (pipe_);
}
-int zmq::push_t::xsend (msg_t *msg_, int flags_)
+int zmq::push_t::xsend (msg_t *msg_)
{
- return lb.send (msg_, flags_);
+ return lb.send (msg_);
}
bool zmq::push_t::xhas_out ()
{
return lb.has_out ();
}
-
-zmq::push_session_t::push_session_t (io_thread_t *io_thread_, bool connect_,
- socket_base_t *socket_, const options_t &options_,
- const address_t *addr_) :
- session_base_t (io_thread_, connect_, socket_, options_, addr_)
-{
-}
-
-zmq::push_session_t::~push_session_t ()
-{
-}
-
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2010 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
protected:
// Overloads of functions from socket_base_t.
- void xattach_pipe (zmq::pipe_t *pipe_, bool icanhasall_);
- int xsend (zmq::msg_t *msg_, int flags_);
+ void xattach_pipe (zmq::pipe_t *pipe_, bool subscribe_to_all_);
+ int xsend (zmq::msg_t *msg_);
bool xhas_out ();
void xwrite_activated (zmq::pipe_t *pipe_);
- void xterminated (zmq::pipe_t *pipe_);
+ void xpipe_terminated (zmq::pipe_t *pipe_);
private:
const push_t &operator = (const push_t&);
};
- class push_session_t : public session_base_t
- {
- public:
-
- push_session_t (zmq::io_thread_t *io_thread_, bool connect_,
- socket_base_t *socket_, const options_t &options_,
- const address_t *addr_);
- ~push_session_t ();
-
- private:
-
- push_session_t (const push_session_t&);
- const push_session_t &operator = (const push_session_t&);
- };
-
}
#endif
/*
- Copyright (c) 2011 250bpm s.r.o.
- Copyright (c) 2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
/*
- Copyright (c) 2011 250bpm s.r.o.
- Copyright (c) 2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "platform.hpp"
+#ifdef ZMQ_HAVE_WINDOWS
+#include "windows.hpp"
+#endif
+
+#include "raw_decoder.hpp"
+#include "err.hpp"
+
+zmq::raw_decoder_t::raw_decoder_t (size_t bufsize_) :
+ bufsize (bufsize_)
+{
+ int rc = in_progress.init ();
+ errno_assert (rc == 0);
+
+ buffer = (unsigned char *) malloc (bufsize);
+ alloc_assert (buffer);
+}
+
+zmq::raw_decoder_t::~raw_decoder_t ()
+{
+ int rc = in_progress.close ();
+ errno_assert (rc == 0);
+
+ free (buffer);
+}
+
+void zmq::raw_decoder_t::get_buffer (unsigned char **data_, size_t *size_)
+{
+ *data_ = buffer;
+ *size_ = bufsize;
+}
+
+int zmq::raw_decoder_t::decode (const uint8_t *data_, size_t size_,
+ size_t &bytes_used_)
+{
+ int rc = in_progress.init_size (size_);
+ errno_assert (rc != -1);
+ memcpy (in_progress.data (), data_, size_);
+ bytes_used_ = size_;
+ return 1;
+}
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __ZMQ_RAW_DECODER_HPP_INCLUDED__
+#define __ZMQ_RAW_DECODER_HPP_INCLUDED__
+
+#include "err.hpp"
+#include "msg.hpp"
+#include "i_decoder.hpp"
+#include "stdint.hpp"
+
+namespace zmq
+{
+
+ // Decoder for 0MQ v1 framing protocol. Converts data stream into messages.
+
+ class raw_decoder_t : public i_decoder
+ {
+ public:
+
+ raw_decoder_t (size_t bufsize_);
+ virtual ~raw_decoder_t ();
+
+ // i_decoder interface.
+
+ virtual void get_buffer (unsigned char **data_, size_t *size_);
+
+ virtual int decode (const unsigned char *data_, size_t size_,
+ size_t &processed);
+
+ virtual msg_t *msg () { return &in_progress; }
+
+
+ private:
+
+
+ msg_t in_progress;
+
+ const int64_t bufsize;
+
+ unsigned char *buffer;
+
+ raw_decoder_t (const raw_decoder_t&);
+ void operator = (const raw_decoder_t&);
+ };
+
+}
+
+#endif
+
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "encoder.hpp"
+#include "raw_encoder.hpp"
+#include "likely.hpp"
+#include "wire.hpp"
+
+zmq::raw_encoder_t::raw_encoder_t (size_t bufsize_) :
+ encoder_base_t <raw_encoder_t> (bufsize_)
+{
+ // Write 0 bytes to the batch and go to message_ready state.
+ next_step (NULL, 0, &raw_encoder_t::raw_message_ready, true);
+}
+
+zmq::raw_encoder_t::~raw_encoder_t ()
+{
+}
+
+void zmq::raw_encoder_t::raw_message_ready ()
+{
+ next_step (in_progress->data (), in_progress->size (),
+ &raw_encoder_t::raw_message_ready, true);
+}
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __ZMQ_RAW_ENCODER_HPP_INCLUDED__
+#define __ZMQ_RAW_ENCODER_HPP_INCLUDED__
+
+#if defined(_MSC_VER)
+#ifndef NOMINMAX
+#define NOMINMAX
+#endif
+#endif
+
+#include <stddef.h>
+#include <string.h>
+#include <stdlib.h>
+#include <algorithm>
+
+#include "err.hpp"
+#include "msg.hpp"
+#include "i_encoder.hpp"
+
+namespace zmq
+{
+
+ // Encoder for 0MQ framing protocol. Converts messages into data batches.
+
+ class raw_encoder_t : public encoder_base_t <raw_encoder_t>
+ {
+ public:
+
+ raw_encoder_t (size_t bufsize_);
+ ~raw_encoder_t ();
+
+ private:
+
+ void raw_message_ready ();
+
+ raw_encoder_t (const raw_encoder_t&);
+ const raw_encoder_t &operator = (const raw_encoder_t&);
+ };
+}
+
+#endif
+
/*
- Copyright (c) 2011 250bpm s.r.o.
- Copyright (c) 2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
mailbox_handle = poller->add_fd (mailbox.get_fd (), this);
poller->set_pollin (mailbox_handle);
+
+#ifdef HAVE_FORK
+ pid = getpid();
+#endif
}
zmq::reaper_t::~reaper_t ()
void zmq::reaper_t::in_event ()
{
while (true) {
+#ifdef HAVE_FORK
+ if (unlikely(pid != getpid()))
+ {
+ //printf("zmq::reaper_t::in_event return in child process %d\n", (int)getpid());
+ return;
+ }
+#endif
// Get the next command. If there is none, exit.
command_t cmd;
/*
- Copyright (c) 2011 250bpm s.r.o.
- Copyright (c) 2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
reaper_t (const reaper_t&);
const reaper_t &operator = (const reaper_t&);
+
+#ifdef HAVE_FORK
+ // the process that created this context. Used to detect forking.
+ pid_t pid;
+#endif
};
}
/*
- Copyright (c) 2007-2012 iMatix Corporation
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
{
}
-int zmq::rep_t::xsend (msg_t *msg_, int flags_)
+int zmq::rep_t::xsend (msg_t *msg_)
{
// If we are in the middle of receiving a request, we cannot send reply.
if (!sending_reply) {
bool more = msg_->flags () & msg_t::more ? true : false;
// Push message to the reply pipe.
- int rc = router_t::xsend (msg_, flags_);
+ int rc = router_t::xsend (msg_);
if (rc != 0)
return rc;
return 0;
}
-int zmq::rep_t::xrecv (msg_t *msg_, int flags_)
+int zmq::rep_t::xrecv (msg_t *msg_)
{
// If we are in middle of sending a reply, we cannot receive next request.
if (sending_reply) {
// to the reply pipe.
if (request_begins) {
while (true) {
- int rc = router_t::xrecv (msg_, flags_);
+ int rc = router_t::xrecv (msg_);
if (rc != 0)
return rc;
bool bottom = (msg_->size () == 0);
// Push it to the reply pipe.
- rc = router_t::xsend (msg_, flags_);
+ rc = router_t::xsend (msg_);
errno_assert (rc == 0);
if (bottom)
}
// Get next message part to return to the user.
- int rc = router_t::xrecv (msg_, flags_);
+ int rc = router_t::xrecv (msg_);
if (rc != 0)
return rc;
return router_t::xhas_out ();
}
-
-zmq::rep_session_t::rep_session_t (io_thread_t *io_thread_, bool connect_,
- socket_base_t *socket_, const options_t &options_,
- const address_t *addr_) :
- router_session_t (io_thread_, connect_, socket_, options_, addr_)
-{
-}
-
-zmq::rep_session_t::~rep_session_t ()
-{
-}
-
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2011 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
~rep_t ();
// Overloads of functions from socket_base_t.
- int xsend (zmq::msg_t *msg_, int flags_);
- int xrecv (zmq::msg_t *msg_, int flags_);
+ int xsend (zmq::msg_t *msg_);
+ int xrecv (zmq::msg_t *msg_);
bool xhas_in ();
bool xhas_out ();
};
- class rep_session_t : public router_session_t
- {
- public:
-
- rep_session_t (zmq::io_thread_t *io_thread_, bool connect_,
- zmq::socket_base_t *socket_, const options_t &options_,
- const address_t *addr_);
- ~rep_session_t ();
-
- private:
-
- rep_session_t (const rep_session_t&);
- const rep_session_t &operator = (const rep_session_t&);
- };
-
}
#endif
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2011 VMware, Inc.
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
zmq::req_t::req_t (class ctx_t *parent_, uint32_t tid_, int sid_) :
dealer_t (parent_, tid_, sid_),
receiving_reply (false),
- message_begins (true)
+ message_begins (true),
+ reply_pipe (NULL),
+ request_id_frames_enabled (false),
+ request_id (generate_random()),
+ strict (true)
{
options.type = ZMQ_REQ;
}
{
}
-int zmq::req_t::xsend (msg_t *msg_, int flags_)
+int zmq::req_t::xsend (msg_t *msg_)
{
// If we've sent a request and we still haven't got the reply,
- // we can't send another request.
+ // we can't send another request unless the strict option is disabled.
if (receiving_reply) {
- errno = EFSM;
- return -1;
+ if (strict) {
+ errno = EFSM;
+ return -1;
+ }
+
+ if (reply_pipe)
+ reply_pipe->terminate (false);
+ receiving_reply = false;
+ message_begins = true;
}
// First part of the request is the request identity.
if (message_begins) {
+ reply_pipe = NULL;
+
+ if (request_id_frames_enabled) {
+ request_id++;
+
+ msg_t id;
+ int rc = id.init_data (&request_id, sizeof (request_id), NULL, NULL);
+ errno_assert (rc == 0);
+ id.set_flags (msg_t::more);
+
+ rc = dealer_t::sendpipe (&id, &reply_pipe);
+ if (rc != 0)
+ return -1;
+ }
+
msg_t bottom;
int rc = bottom.init ();
errno_assert (rc == 0);
bottom.set_flags (msg_t::more);
- rc = dealer_t::xsend (&bottom, 0);
+
+ rc = dealer_t::sendpipe (&bottom, &reply_pipe);
if (rc != 0)
return -1;
+ assert (reply_pipe);
+
message_begins = false;
+
+ // Eat all currently avaliable messages before the request is fully
+ // sent. This is done to avoid:
+ // REQ sends request to A, A replies, B replies too.
+ // A's reply was first and matches, that is used.
+ // An hour later REQ sends a request to B. B's old reply is used.
+ msg_t drop;
+ while (true) {
+ rc = drop.init ();
+ errno_assert (rc == 0);
+ rc = dealer_t::xrecv (&drop);
+ if (rc != 0)
+ break;
+ drop.close ();
+ }
}
bool more = msg_->flags () & msg_t::more ? true : false;
- int rc = dealer_t::xsend (msg_, flags_);
+ int rc = dealer_t::xsend (msg_);
if (rc != 0)
return rc;
return 0;
}
-int zmq::req_t::xrecv (msg_t *msg_, int flags_)
+int zmq::req_t::xrecv (msg_t *msg_)
{
// If request wasn't send, we can't wait for reply.
if (!receiving_reply) {
return -1;
}
- // First part of the reply should be the original request ID.
- if (message_begins) {
- int rc = dealer_t::xrecv (msg_, flags_);
+ // Skip messages until one with the right first frames is found.
+ while (message_begins) {
+ // If enabled, the first frame must have the correct request_id.
+ if (request_id_frames_enabled) {
+ int rc = recv_reply_pipe (msg_);
+ if (rc != 0)
+ return rc;
+
+ if (unlikely (!(msg_->flags () & msg_t::more) ||
+ msg_->size () != sizeof (request_id) ||
+ *static_cast<uint32_t *> (msg_->data ()) != request_id)) {
+ // Skip the remaining frames and try the next message
+ while (msg_->flags () & msg_t::more) {
+ rc = recv_reply_pipe (msg_);
+ errno_assert (rc == 0);
+ }
+ continue;
+ }
+ }
+
+ // The next frame must be 0.
+ // TODO: Failing this check should also close the connection with the peer!
+ int rc = recv_reply_pipe (msg_);
if (rc != 0)
return rc;
- // TODO: This should also close the connection with the peer!
if (unlikely (!(msg_->flags () & msg_t::more) || msg_->size () != 0)) {
- while (true) {
- int rc = dealer_t::xrecv (msg_, flags_);
+ // Skip the remaining frames and try the next message
+ while (msg_->flags () & msg_t::more) {
+ rc = recv_reply_pipe (msg_);
errno_assert (rc == 0);
- if (!(msg_->flags () & msg_t::more))
- break;
}
- msg_->close ();
- msg_->init ();
- errno = EAGAIN;
- return -1;
+ continue;
}
message_begins = false;
}
- int rc = dealer_t::xrecv (msg_, flags_);
+ int rc = recv_reply_pipe (msg_);
if (rc != 0)
return rc;
return dealer_t::xhas_out ();
}
+int zmq::req_t::xsetsockopt (int option_, const void *optval_, size_t optvallen_)
+{
+ bool is_int = (optvallen_ == sizeof (int));
+ int value = is_int? *((int *) optval_): 0;
+ switch (option_) {
+ case ZMQ_REQ_CORRELATE:
+ if (is_int && value >= 0) {
+ request_id_frames_enabled = (value != 0);
+ return 0;
+ }
+ break;
+
+ case ZMQ_REQ_RELAXED:
+ if (is_int && value >= 0) {
+ strict = (value == 0);
+ return 0;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ return dealer_t::xsetsockopt (option_, optval_, optvallen_);
+}
+
+void zmq::req_t::xpipe_terminated (pipe_t *pipe_)
+{
+ if (reply_pipe == pipe_)
+ reply_pipe = NULL;
+ dealer_t::xpipe_terminated (pipe_);
+}
+
+int zmq::req_t::recv_reply_pipe (msg_t *msg_)
+{
+ while (true) {
+ pipe_t *pipe = NULL;
+ int rc = dealer_t::recvpipe (msg_, &pipe);
+ if (rc != 0)
+ return rc;
+ if (!reply_pipe || pipe == reply_pipe)
+ return 0;
+ }
+}
+
zmq::req_session_t::req_session_t (io_thread_t *io_thread_, bool connect_,
socket_base_t *socket_, const options_t &options_,
const address_t *addr_) :
- dealer_session_t (io_thread_, connect_, socket_, options_, addr_),
- state (identity)
+ session_base_t (io_thread_, connect_, socket_, options_, addr_),
+ state (bottom)
{
}
zmq::req_session_t::~req_session_t ()
{
- state = options.recv_identity ? identity : bottom;
}
int zmq::req_session_t::push_msg (msg_t *msg_)
case bottom:
if (msg_->flags () == msg_t::more && msg_->size () == 0) {
state = body;
- return dealer_session_t::push_msg (msg_);
+ return session_base_t::push_msg (msg_);
}
break;
case body:
if (msg_->flags () == msg_t::more)
- return dealer_session_t::push_msg (msg_);
- if (msg_->flags () == 0) {
- state = bottom;
- return dealer_session_t::push_msg (msg_);
- }
- break;
- case identity:
+ return session_base_t::push_msg (msg_);
if (msg_->flags () == 0) {
state = bottom;
- return dealer_session_t::push_msg (msg_);
+ return session_base_t::push_msg (msg_);
}
break;
}
void zmq::req_session_t::reset ()
{
session_base_t::reset ();
- state = identity;
+ state = bottom;
}
/*
- Copyright (c) 2007-2012 iMatix Corporation
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2011 VMware, Inc.
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
~req_t ();
// Overloads of functions from socket_base_t.
- int xsend (zmq::msg_t *msg_, int flags_);
- int xrecv (zmq::msg_t *msg_, int flags_);
+ int xsend (zmq::msg_t *msg_);
+ int xrecv (zmq::msg_t *msg_);
bool xhas_in ();
bool xhas_out ();
+ int xsetsockopt (int option_, const void *optval_, size_t optvallen_);
+ void xpipe_terminated (zmq::pipe_t *pipe_);
+
+ protected:
+
+ // Receive only from the pipe the request was sent to, discarding
+ // frames from other pipes.
+ int recv_reply_pipe (zmq::msg_t *msg_);
private:
// of the message must be empty message part (backtrace stack bottom).
bool message_begins;
+ // The pipe the request was sent to and where the reply is expected.
+ zmq::pipe_t *reply_pipe;
+
+ // Whether request id frames shall be sent and expected.
+ bool request_id_frames_enabled;
+
+ // The current request id. It is incremented every time before a new
+ // request is sent.
+ uint32_t request_id;
+
+ // If false, send() will reset its internal state and terminate the
+ // reply_pipe's connection instead of failing if a previous request is
+ // still pending.
+ bool strict;
+
req_t (const req_t&);
const req_t &operator = (const req_t&);
};
- class req_session_t : public dealer_session_t
+ class req_session_t : public session_base_t
{
public:
private:
enum {
- identity,
bottom,
body
} state;
/*
- Copyright (c) 2012 iMatix Corporation
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2011 VMware, Inc.
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
current_out (NULL),
more_out (false),
next_peer_id (generate_random ()),
- mandatory(false)
+ mandatory (false),
+ // raw_sock functionality in ROUTER is deprecated
+ raw_sock (false),
+ probe_router (false)
{
options.type = ZMQ_ROUTER;
-
- // TODO: Uncomment the following line when ROUTER will become true ROUTER
- // rather than generic router socket.
- // If peer disconnect there's noone to send reply to anyway. We can drop
- // all the outstanding requests from that peer.
- // options.delay_on_disconnect = false;
-
options.recv_identity = true;
+ options.raw_sock = false;
prefetched_id.init ();
prefetched_msg.init ();
prefetched_msg.close ();
}
-void zmq::router_t::xattach_pipe (pipe_t *pipe_, bool icanhasall_)
+void zmq::router_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_)
{
- // icanhasall_ is unused
- (void)icanhasall_;
+ // subscribe_to_all_ is unused
+ (void)subscribe_to_all_;
zmq_assert (pipe_);
+ if (probe_router) {
+ msg_t probe_msg_;
+ int rc = probe_msg_.init ();
+ errno_assert (rc == 0);
+
+ rc = pipe_->write (&probe_msg_);
+ // zmq_assert (rc) is not applicable here, since it is not a bug.
+ pipe_->flush ();
+
+ rc = probe_msg_.close ();
+ errno_assert (rc == 0);
+ }
+
bool identity_ok = identify_peer (pipe_);
if (identity_ok)
fq.attach (pipe_);
int zmq::router_t::xsetsockopt (int option_, const void *optval_,
size_t optvallen_)
{
- if (option_ != ZMQ_ROUTER_MANDATORY) {
- errno = EINVAL;
- return -1;
- }
- if (optvallen_ != sizeof (int) || *static_cast <const int*> (optval_) < 0) {
- errno = EINVAL;
- return -1;
+ bool is_int = (optvallen_ == sizeof (int));
+ int value = is_int? *((int *) optval_): 0;
+
+ switch (option_) {
+ case ZMQ_ROUTER_RAW:
+ if (is_int && value >= 0) {
+ raw_sock = (value != 0);
+ if (raw_sock) {
+ options.recv_identity = false;
+ options.raw_sock = true;
+ }
+ return 0;
+ }
+ break;
+
+ case ZMQ_ROUTER_MANDATORY:
+ if (is_int && value >= 0) {
+ mandatory = (value != 0);
+ return 0;
+ }
+ break;
+
+ case ZMQ_PROBE_ROUTER:
+ if (is_int && value >= 0) {
+ probe_router = (value != 0);
+ return 0;
+ }
+ break;
+
+ default:
+ break;
}
- mandatory = *static_cast <const int*> (optval_);
- return 0;
+ errno = EINVAL;
+ return -1;
}
-void zmq::router_t::xterminated (pipe_t *pipe_)
+
+void zmq::router_t::xpipe_terminated (pipe_t *pipe_)
{
std::set <pipe_t*>::iterator it = anonymous_pipes.find (pipe_);
if (it != anonymous_pipes.end ())
outpipes_t::iterator it = outpipes.find (pipe_->get_identity ());
zmq_assert (it != outpipes.end ());
outpipes.erase (it);
- fq.terminated (pipe_);
+ fq.pipe_terminated (pipe_);
if (pipe_ == current_out)
current_out = NULL;
}
it->second.active = true;
}
-int zmq::router_t::xsend (msg_t *msg_, int flags_)
+int zmq::router_t::xsend (msg_t *msg_)
{
- // flags_ is unused
- (void)flags_;
-
// If this is the first part of the message it's the ID of the
// peer to send the message to.
if (!more_out) {
// Find the pipe associated with the identity stored in the prefix.
// If there's no such pipe just silently ignore the message, unless
- // report_unreachable is set.
+ // router_mandatory is set.
blob_t identity ((unsigned char*) msg_->data (), msg_->size ());
outpipes_t::iterator it = outpipes.find (identity);
if (!current_out->check_write ()) {
it->second.active = false;
current_out = NULL;
+ if (mandatory) {
+ more_out = false;
+ errno = EAGAIN;
+ return -1;
+ }
}
- }
- else
+ }
+ else
if (mandatory) {
more_out = false;
errno = EHOSTUNREACH;
return 0;
}
+ // Ignore the MORE flag for raw-sock or assert?
+ if (options.raw_sock)
+ msg_->reset_flags (msg_t::more);
+
// Check whether this is the last part of the message.
more_out = msg_->flags () & msg_t::more ? true : false;
// Push the message into the pipe. If there's no out pipe, just drop it.
if (current_out) {
+
+ // Close the remote connection if user has asked to do so
+ // by sending zero length message.
+ // Pending messages in the pipe will be dropped (on receiving term- ack)
+ if (raw_sock && msg_->size() == 0) {
+ current_out->terminate (false);
+ int rc = msg_->close ();
+ errno_assert (rc == 0);
+ rc = msg_->init ();
+ errno_assert (rc == 0);
+ current_out = NULL;
+ return 0;
+ }
+
bool ok = current_out->write (msg_);
if (unlikely (!ok))
current_out = NULL;
- else if (!more_out) {
+ else
+ if (!more_out) {
current_out->flush ();
current_out = NULL;
}
return 0;
}
-int zmq::router_t::xrecv (msg_t *msg_, int flags_)
+int zmq::router_t::xrecv (msg_t *msg_)
{
- // flags_ is unused
- (void)flags_;
-
if (prefetched) {
if (!identity_sent) {
int rc = msg_->move (prefetched_id);
// It's possible that we receive peer's identity. That happens
// after reconnection. The current implementation assumes that
// the peer always uses the same identity.
- // TODO: handle the situation when the peer changes its identity.
while (rc == 0 && msg_->is_identity ())
rc = fq.recvpipe (msg_, &pipe);
{
msg_t msg;
blob_t identity;
+ bool ok;
- msg.init ();
- bool ok = pipe_->read (&msg);
- if (!ok)
- return false;
-
- if (msg.size () == 0) {
- // Fall back on the auto-generation
+ if (options.raw_sock) { // Always assign identity for raw-socket
unsigned char buf [5];
buf [0] = 0;
put_uint32 (buf + 1, next_peer_id++);
identity = blob_t (buf, sizeof buf);
- msg.close ();
}
else {
- identity = blob_t ((unsigned char*) msg.data (), msg.size ());
- outpipes_t::iterator it = outpipes.find (identity);
- msg.close ();
-
- // Ignore peers with duplicate ID.
- if (it != outpipes.end ())
+ msg.init ();
+ ok = pipe_->read (&msg);
+ if (!ok)
return false;
+
+ if (msg.size () == 0) {
+ // Fall back on the auto-generation
+ unsigned char buf [5];
+ buf [0] = 0;
+ put_uint32 (buf + 1, next_peer_id++);
+ identity = blob_t (buf, sizeof buf);
+ msg.close ();
+ }
+ else {
+ identity = blob_t ((unsigned char*) msg.data (), msg.size ());
+ outpipes_t::iterator it = outpipes.find (identity);
+ msg.close ();
+
+ // Ignore peers with duplicate ID.
+ if (it != outpipes.end ())
+ return false;
+ }
}
pipe_->set_identity (identity);
return true;
}
-
-zmq::router_session_t::router_session_t (io_thread_t *io_thread_, bool connect_,
- socket_base_t *socket_, const options_t &options_,
- const address_t *addr_) :
- session_base_t (io_thread_, connect_, socket_, options_, addr_)
-{
-}
-
-zmq::router_session_t::~router_session_t ()
-{
-}
-
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2011 iMatix Corporation
- Copyright (c) 2011 VMware, Inc.
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
~router_t ();
// Overloads of functions from socket_base_t.
- void xattach_pipe (zmq::pipe_t *pipe_, bool icanhasall_);
+ void xattach_pipe (zmq::pipe_t *pipe_, bool subscribe_to_all_);
int xsetsockopt (int option_, const void *optval_, size_t optvallen_);
- int xsend (msg_t *msg_, int flags_);
- int xrecv (msg_t *msg_, int flags_);
+ int xsend (zmq::msg_t *msg_);
+ int xrecv (zmq::msg_t *msg_);
bool xhas_in ();
bool xhas_out ();
void xread_activated (zmq::pipe_t *pipe_);
void xwrite_activated (zmq::pipe_t *pipe_);
- void xterminated (zmq::pipe_t *pipe_);
+ void xpipe_terminated (zmq::pipe_t *pipe_);
protected:
// If true, report EAGAIN to the caller instead of silently dropping
// the message targeting an unknown peer.
bool mandatory;
+ bool raw_sock;
+
+ // if true, send an empty message to every connected router peer
+ bool probe_router;
router_t (const router_t&);
const router_t &operator = (const router_t&);
};
- class router_session_t : public session_base_t
- {
- public:
-
- router_session_t (zmq::io_thread_t *io_thread_, bool connect_,
- socket_base_t *socket_, const options_t &options_,
- const address_t *addr_);
- ~router_session_t ();
-
- private:
-
- router_session_t (const router_session_t&);
- const router_session_t &operator = (const router_session_t&);
- };
-
}
#endif
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
stopping = true;
}
+int zmq::select_t::max_fds ()
+{
+ return FD_SETSIZE;
+}
+
void zmq::select_t::loop ()
{
while (!stopping) {
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
void start ();
void stop ();
+ static int max_fds ();
+
private:
// Main worker thread routine.
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2011 VMware, Inc.
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdarg.h>
-
#include "session_base.hpp"
#include "i_engine.hpp"
#include "err.hpp"
#include "pgm_receiver.hpp"
#include "address.hpp"
+#include "ctx.hpp"
#include "req.hpp"
-#include "dealer.hpp"
-#include "rep.hpp"
-#include "router.hpp"
-#include "pub.hpp"
-#include "xpub.hpp"
-#include "sub.hpp"
-#include "xsub.hpp"
-#include "push.hpp"
-#include "pull.hpp"
-#include "pair.hpp"
zmq::session_base_t *zmq::session_base_t::create (class io_thread_t *io_thread_,
bool connect_, class socket_base_t *socket_, const options_t &options_,
socket_, options_, addr_);
break;
case ZMQ_DEALER:
- s = new (std::nothrow) dealer_session_t (io_thread_, connect_,
- socket_, options_, addr_);
- break;
case ZMQ_REP:
- s = new (std::nothrow) rep_session_t (io_thread_, connect_,
- socket_, options_, addr_);
- break;
case ZMQ_ROUTER:
- s = new (std::nothrow) router_session_t (io_thread_, connect_,
- socket_, options_, addr_);
- break;
case ZMQ_PUB:
- s = new (std::nothrow) pub_session_t (io_thread_, connect_,
- socket_, options_, addr_);
- break;
case ZMQ_XPUB:
- s = new (std::nothrow) xpub_session_t (io_thread_, connect_,
- socket_, options_, addr_);
- break;
case ZMQ_SUB:
- s = new (std::nothrow) sub_session_t (io_thread_, connect_,
- socket_, options_, addr_);
- break;
case ZMQ_XSUB:
- s = new (std::nothrow) xsub_session_t (io_thread_, connect_,
- socket_, options_, addr_);
- break;
case ZMQ_PUSH:
- s = new (std::nothrow) push_session_t (io_thread_, connect_,
- socket_, options_, addr_);
- break;
case ZMQ_PULL:
- s = new (std::nothrow) pull_session_t (io_thread_, connect_,
- socket_, options_, addr_);
- break;
case ZMQ_PAIR:
- s = new (std::nothrow) pair_session_t (io_thread_, connect_,
+ case ZMQ_STREAM:
+ s = new (std::nothrow) session_base_t (io_thread_, connect_,
socket_, options_, addr_);
break;
default:
io_object_t (io_thread_),
connect (connect_),
pipe (NULL),
+ zap_pipe (NULL),
incomplete_in (false),
pending (false),
engine (NULL),
socket (socket_),
io_thread (io_thread_),
has_linger_timer (false),
- identity_sent (false),
- identity_received (false),
addr (addr_)
{
}
zmq::session_base_t::~session_base_t ()
{
zmq_assert (!pipe);
+ zmq_assert (!zap_pipe);
// If there's still a pending linger timer, remove it.
if (has_linger_timer) {
if (engine)
engine->terminate ();
- if (addr)
- delete addr;
+ delete addr;
}
void zmq::session_base_t::attach_pipe (pipe_t *pipe_)
int zmq::session_base_t::pull_msg (msg_t *msg_)
{
- // First message to send is identity
- if (!identity_sent) {
- zmq_assert (!(msg_->flags () & msg_t::more));
- int rc = msg_->init_size (options.identity_size);
- errno_assert (rc == 0);
- memcpy (msg_->data (), options.identity, options.identity_size);
- identity_sent = true;
- incomplete_in = false;
- return 0;
- }
-
if (!pipe || !pipe->read (msg_)) {
errno = EAGAIN;
return -1;
int zmq::session_base_t::push_msg (msg_t *msg_)
{
- // First message to receive is identity
- if (!identity_received) {
- msg_->set_flags (msg_t::identity);
- identity_received = true;
- if (!options.recv_identity) {
- int rc = msg_->close ();
- errno_assert (rc == 0);
- rc = msg_->init ();
- errno_assert (rc == 0);
- return 0;
- }
- }
-
if (pipe && pipe->write (msg_)) {
int rc = msg_->init ();
errno_assert (rc == 0);
return -1;
}
+int zmq::session_base_t::read_zap_msg (msg_t *msg_)
+{
+ if (zap_pipe == NULL) {
+ errno = ENOTCONN;
+ return -1;
+ }
+
+ if (!zap_pipe->read (msg_)) {
+ errno = EAGAIN;
+ return -1;
+ }
+
+ return 0;
+}
+
+int zmq::session_base_t::write_zap_msg (msg_t *msg_)
+{
+ if (zap_pipe == NULL) {
+ errno = ENOTCONN;
+ return -1;
+ }
+
+ const bool ok = zap_pipe->write (msg_);
+ zmq_assert (ok);
+
+ if ((msg_->flags () & msg_t::more) == 0)
+ zap_pipe->flush ();
+
+ const int rc = msg_->init ();
+ errno_assert (rc == 0);
+ return 0;
+}
+
void zmq::session_base_t::reset ()
{
- // Restore identity flags.
- identity_sent = false;
- identity_received = false;
}
void zmq::session_base_t::flush ()
msg_t msg;
int rc = msg.init ();
errno_assert (rc == 0);
- if (pull_msg (&msg) != 0) {
- zmq_assert (!incomplete_in);
- break;
- }
+ rc = pull_msg (&msg);
+ errno_assert (rc == 0);
rc = msg.close ();
errno_assert (rc == 0);
}
}
}
-void zmq::session_base_t::terminated (pipe_t *pipe_)
+void zmq::session_base_t::pipe_terminated (pipe_t *pipe_)
{
// Drop the reference to the deallocated pipe if required.
- zmq_assert (pipe == pipe_ || terminating_pipes.count (pipe_) == 1);
+ zmq_assert (pipe_ == pipe
+ || pipe_ == zap_pipe
+ || terminating_pipes.count (pipe_) == 1);
- if (pipe == pipe_)
+ if (pipe_ == pipe)
// If this is our current pipe, remove it
pipe = NULL;
+ else
+ if (pipe_ == zap_pipe) {
+ zap_pipe = NULL;
+ }
else
// Remove the pipe from the detached pipes set
terminating_pipes.erase (pipe_);
- // If we are waiting for pending messages to be sent, at this point
- // we are sure that there will be no more messages and we can proceed
- // with termination safely.
- if (pending && !pipe && terminating_pipes.size () == 0)
+ if (!is_terminating () && options.raw_sock) {
+ if (engine) {
+ engine->terminate ();
+ engine = NULL;
+ }
+ terminate ();
+ }
+
+ // If we are waiting for pending messages to be sent, at this point
+ // we are sure that there will be no more messages and we can proceed
+ // with termination safely.
+ if (pending && !pipe && !zap_pipe && terminating_pipes.empty ())
proceed_with_term ();
}
void zmq::session_base_t::read_activated (pipe_t *pipe_)
{
// Skip activating if we're detaching this pipe
- if (pipe != pipe_) {
+ if (unlikely(pipe_ != pipe && pipe_ != zap_pipe)) {
zmq_assert (terminating_pipes.count (pipe_) == 1);
return;
}
- if (likely (engine != NULL))
- engine->activate_out ();
- else
+ if (unlikely (engine == NULL)) {
pipe->check_read ();
+ return;
+ }
+
+ if (likely (pipe_ == pipe))
+ engine->restart_output ();
+ else
+ engine->zap_msg_available ();
}
void zmq::session_base_t::write_activated (pipe_t *pipe_)
}
if (engine)
- engine->activate_in ();
+ engine->restart_input ();
}
void zmq::session_base_t::hiccuped (pipe_t *)
start_connecting (false);
}
+int zmq::session_base_t::zap_connect ()
+{
+ zmq_assert (zap_pipe == NULL);
+
+ endpoint_t peer = find_endpoint ("inproc://zeromq.zap.01");
+ if (peer.socket == NULL) {
+ errno = ECONNREFUSED;
+ return -1;
+ }
+ if (peer.options.type != ZMQ_REP
+ && peer.options.type != ZMQ_ROUTER) {
+ errno = ECONNREFUSED;
+ return -1;
+ }
+
+ // Create a bi-directional pipe that will connect
+ // session with zap socket.
+ object_t *parents [2] = {this, peer.socket};
+ pipe_t *new_pipes [2] = {NULL, NULL};
+ int hwms [2] = {0, 0};
+ bool conflates [2] = {false, false};
+ int rc = pipepair (parents, new_pipes, hwms, conflates);
+ errno_assert (rc == 0);
+
+ // Attach local end of the pipe to this socket object.
+ zap_pipe = new_pipes [0];
+ zap_pipe->set_nodelay ();
+ zap_pipe->set_event_sink (this);
+
+ new_pipes [1]->set_nodelay ();
+ send_bind (peer.socket, new_pipes [1], false);
+
+ // Send empty identity if required by the peer.
+ if (peer.options.recv_identity) {
+ msg_t id;
+ rc = id.init ();
+ errno_assert (rc == 0);
+ id.set_flags (msg_t::identity);
+ bool ok = zap_pipe->write (&id);
+ zmq_assert (ok);
+ zap_pipe->flush ();
+ }
+
+ return 0;
+}
+
void zmq::session_base_t::process_attach (i_engine *engine_)
{
zmq_assert (engine_ != NULL);
if (!pipe && !is_terminating ()) {
object_t *parents [2] = {this, socket};
pipe_t *pipes [2] = {NULL, NULL};
- int hwms [2] = {options.rcvhwm, options.sndhwm};
- bool delays [2] = {options.delay_on_close, options.delay_on_disconnect};
- int rc = pipepair (parents, pipes, hwms, delays);
+
+ bool conflate = options.conflate &&
+ (options.type == ZMQ_DEALER ||
+ options.type == ZMQ_PULL ||
+ options.type == ZMQ_PUSH ||
+ options.type == ZMQ_PUB ||
+ options.type == ZMQ_SUB);
+
+ int hwms [2] = {conflate? -1 : options.rcvhwm,
+ conflate? -1 : options.sndhwm};
+ bool conflates [2] = {conflate, conflate};
+ int rc = pipepair (parents, pipes, hwms, conflates);
errno_assert (rc == 0);
// Plug the local end of the pipe.
// Just in case there's only a delimiter in the pipe.
if (pipe)
pipe->check_read ();
+
+ if (zap_pipe)
+ zap_pipe->check_read ();
}
void zmq::session_base_t::process_term (int linger_)
// If the termination of the pipe happens before the term command is
// delivered there's nothing much to do. We can proceed with the
- // stadard termination immediately.
- if (!pipe) {
+ // standard termination immediately.
+ if (!pipe && !zap_pipe) {
proceed_with_term ();
return;
}
pending = true;
- // If there's finite linger value, delay the termination.
- // If linger is infinite (negative) we don't even have to set
- // the timer.
- if (linger_ > 0) {
- zmq_assert (!has_linger_timer);
- add_timer (linger_, linger_timer_id);
- has_linger_timer = true;
- }
+ if (pipe != NULL) {
+ // If there's finite linger value, delay the termination.
+ // If linger is infinite (negative) we don't even have to set
+ // the timer.
+ if (linger_ > 0) {
+ zmq_assert (!has_linger_timer);
+ add_timer (linger_, linger_timer_id);
+ has_linger_timer = true;
+ }
- // Start pipe termination process. Delay the termination till all messages
- // are processed in case the linger time is non-zero.
- pipe->terminate (linger_ != 0);
+ // Start pipe termination process. Delay the termination till all messages
+ // are processed in case the linger time is non-zero.
+ pipe->terminate (linger_ != 0);
- // TODO: Should this go into pipe_t::terminate ?
- // In case there's no engine and there's only delimiter in the
- // pipe it wouldn't be ever read. Thus we check for it explicitly.
- pipe->check_read ();
+ // TODO: Should this go into pipe_t::terminate ?
+ // In case there's no engine and there's only delimiter in the
+ // pipe it wouldn't be ever read. Thus we check for it explicitly.
+ pipe->check_read ();
+ }
+
+ if (zap_pipe != NULL)
+ zap_pipe->terminate (false);
}
void zmq::session_base_t::proceed_with_term ()
{
- // The pending phase have just ended.
+ // The pending phase has just ended.
pending = false;
// Continue with standard termination.
// For delayed connect situations, terminate the pipe
// and reestablish later on
- if (pipe && options.delay_attach_on_connect == 1
+ if (pipe && options.immediate == 1
&& addr->protocol != "pgm" && addr->protocol != "epgm") {
pipe->hiccup ();
pipe->terminate (false);
}
#endif
-#if defined ZMQ_HAVE_OPENPGM
+#ifdef ZMQ_HAVE_OPENPGM
// Both PGM and EPGM transports are using the same infrastructure.
if (addr->protocol == "pgm" || addr->protocol == "epgm") {
+ zmq_assert (options.type == ZMQ_PUB || options.type == ZMQ_XPUB
+ || options.type == ZMQ_SUB || options.type == ZMQ_XSUB);
+
// For EPGM transport with UDP encapsulation of PGM is used.
- bool udp_encapsulation = (addr->protocol == "epgm");
+ bool const udp_encapsulation = addr->protocol == "epgm";
// At this point we'll create message pipes to the session straight
// away. There's no point in delaying it as no concept of 'connect'
if (options.type == ZMQ_PUB || options.type == ZMQ_XPUB) {
// PGM sender.
- pgm_sender_t *pgm_sender = new (std::nothrow) pgm_sender_t (
+ pgm_sender_t *pgm_sender = new (std::nothrow) pgm_sender_t (
io_thread, options);
alloc_assert (pgm_sender);
send_attach (this, pgm_sender);
}
- else if (options.type == ZMQ_SUB || options.type == ZMQ_XSUB) {
+ else {
// PGM receiver.
- pgm_receiver_t *pgm_receiver = new (std::nothrow) pgm_receiver_t (
+ pgm_receiver_t *pgm_receiver = new (std::nothrow) pgm_receiver_t (
io_thread, options);
alloc_assert (pgm_receiver);
send_attach (this, pgm_receiver);
}
- else
- zmq_assert (false);
return;
}
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2011 VMware, Inc.
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
#include "own.hpp"
#include "io_object.hpp"
#include "pipe.hpp"
-#include "i_msg_source.hpp"
-#include "i_msg_sink.hpp"
#include "socket_base.hpp"
namespace zmq
class session_base_t :
public own_t,
public io_object_t,
- public i_pipe_events,
- public i_msg_source,
- public i_msg_sink
+ public i_pipe_events
{
public:
// To be used once only, when creating the session.
void attach_pipe (zmq::pipe_t *pipe_);
- // i_msg_source interface implementation.
- virtual int pull_msg (msg_t *msg_);
-
- // i_msg_sink interface implementation.
- virtual int push_msg (msg_t *msg_);
-
// Following functions are the interface exposed towards the engine.
virtual void reset ();
void flush ();
void read_activated (zmq::pipe_t *pipe_);
void write_activated (zmq::pipe_t *pipe_);
void hiccuped (zmq::pipe_t *pipe_);
- void terminated (zmq::pipe_t *pipe_);
+ void pipe_terminated (zmq::pipe_t *pipe_);
+
+ // Delivers a message. Returns 0 if successful; -1 otherwise.
+ // The function takes ownership of the message.
+ int push_msg (msg_t *msg_);
+
+ int zap_connect ();
+
+ // Fetches a message. Returns 0 if successful; -1 otherwise.
+ // The caller is responsible for freeing the message when no
+ // longer used.
+ int pull_msg (msg_t *msg_);
+
+ // Receives message from ZAP socket.
+ // Returns 0 on success; -1 otherwise.
+ // The caller is responsible for freeing the message.
+ int read_zap_msg (msg_t *msg_);
+
+ // Sends message to ZAP socket.
+ // Returns 0 on success; -1 otherwise.
+ // The function takes ownership of the message.
+ int write_zap_msg (msg_t *msg_);
socket_base_t *get_socket ();
// Pipe connecting the session to its socket.
zmq::pipe_t *pipe;
-
+
+ // Pipe used to exchange messages with ZAP socket.
+ zmq::pipe_t *zap_pipe;
+
// This set is added to with pipes we are disconnecting, but haven't yet completed
- std::set<pipe_t *> terminating_pipes;
+ std::set <pipe_t *> terminating_pipes;
// This flag is true if the remainder of the message being processed
// is still in the in pipe.
// True is linger timer is running.
bool has_linger_timer;
- // If true, identity has been sent/received from the network.
- bool identity_sent;
- bool identity_received;
-
// Protocol and address to use when connecting.
const address_t *addr;
/*
- Copyright (c) 2010-2011 250bpm s.r.o.
- Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
zmq::signaler_t::signaler_t ()
{
// Create the socketpair for signaling.
- int rc = make_fdpair (&r, &w);
- errno_assert (rc == 0);
-
- // Set both fds to non-blocking mode.
- unblock_socket (w);
- unblock_socket (r);
+ if (make_fdpair (&r, &w) == 0) {
+ unblock_socket (w);
+ unblock_socket (r);
+ }
+#ifdef HAVE_FORK
+ pid = getpid();
+#endif
}
zmq::signaler_t::~signaler_t ()
int rc = close (r);
errno_assert (rc == 0);
#elif defined ZMQ_HAVE_WINDOWS
- int rc = closesocket (w);
+ struct linger so_linger = { 1, 0 };
+ int rc = setsockopt (w, SOL_SOCKET, SO_LINGER,
+ (char *)&so_linger, sizeof (so_linger));
+ wsa_assert (rc != SOCKET_ERROR);
+ rc = closesocket (w);
wsa_assert (rc != SOCKET_ERROR);
rc = closesocket (r);
wsa_assert (rc != SOCKET_ERROR);
void zmq::signaler_t::send ()
{
+#if HAVE_FORK
+ if (unlikely(pid != getpid())) {
+ //printf("Child process %d signaler_t::send returning without sending #1\n", getpid());
+ return; // do not send anything in forked child context
+ }
+#endif
#if defined ZMQ_HAVE_EVENTFD
const uint64_t inc = 1;
ssize_t sz = write (w, &inc, sizeof (inc));
ssize_t nbytes = ::send (w, &dummy, sizeof (dummy), 0);
if (unlikely (nbytes == -1 && errno == EINTR))
continue;
+#if HAVE_FORK
+ if (unlikely(pid != getpid())) {
+ //printf("Child process %d signaler_t::send returning without sending #2\n", getpid());
+ errno = EINTR;
+ break;
+ }
+#endif
zmq_assert (nbytes == sizeof (dummy));
break;
}
int zmq::signaler_t::wait (int timeout_)
{
+#ifdef HAVE_FORK
+ if (unlikely(pid != getpid()))
+ {
+ // we have forked and the file descriptor is closed. Emulate an interupt
+ // response.
+ //printf("Child process %d signaler_t::wait returning simulating interrupt #1\n", getpid());
+ errno = EINTR;
+ return -1;
+ }
+#endif
+
#ifdef ZMQ_SIGNALER_WAIT_BASED_ON_POLL
struct pollfd pfd;
errno_assert (errno == EINTR);
return -1;
}
- else if (unlikely (rc == 0)) {
+ else
+ if (unlikely (rc == 0)) {
errno = EAGAIN;
return -1;
}
+#ifdef HAVE_FORK
+ if (unlikely(pid != getpid())) {
+ // we have forked and the file descriptor is closed. Emulate an interupt
+ // response.
+ //printf("Child process %d signaler_t::wait returning simulating interrupt #2\n", getpid());
+ errno = EINTR;
+ return -1;
+ }
+#endif
zmq_assert (rc == 1);
zmq_assert (pfd.revents & POLLIN);
return 0;
// one, return it back to the eventfd object.
if (unlikely (dummy == 2)) {
const uint64_t inc = 1;
- ssize_t sz = write (w, &inc, sizeof (inc));
- errno_assert (sz == sizeof (inc));
+ ssize_t sz2 = write (w, &inc, sizeof (inc));
+ errno_assert (sz2 == sizeof (inc));
return;
}
#endif
}
+#ifdef HAVE_FORK
+void zmq::signaler_t::forked()
+{
+ // Close file descriptors created in the parent and create new pair
+ close (r);
+ close (w);
+ make_fdpair (&r, &w);
+}
+#endif
+
+// Returns -1 if we could not make the socket pair successfully
int zmq::signaler_t::make_fdpair (fd_t *r_, fd_t *w_)
{
#if defined ZMQ_HAVE_EVENTFD
-
- // Create eventfd object.
fd_t fd = eventfd (0, 0);
- errno_assert (fd != -1);
- *w_ = fd;
- *r_ = fd;
- return 0;
+ if (fd == -1) {
+ errno_assert (errno == ENFILE || errno == EMFILE);
+ *w_ = *r_ = -1;
+ return -1;
+ }
+ else {
+ *w_ = *r_ = fd;
+ return 0;
+ }
#elif defined ZMQ_HAVE_WINDOWS
- SECURITY_DESCRIPTOR sd = {0};
- SECURITY_ATTRIBUTES sa = {0};
+# if !defined _WIN32_WCE
+ // Windows CE does not manage security attributes
+ SECURITY_DESCRIPTOR sd;
+ SECURITY_ATTRIBUTES sa;
+ memset (&sd, 0, sizeof (sd));
+ memset (&sa, 0, sizeof (sa));
InitializeSecurityDescriptor(&sd, SECURITY_DESCRIPTOR_REVISION);
SetSecurityDescriptorDacl(&sd, TRUE, 0, FALSE);
sa.nLength = sizeof(SECURITY_ATTRIBUTES);
sa.lpSecurityDescriptor = &sd;
+# endif
// This function has to be in a system-wide critical section so that
// two instances of the library don't accidentally create signaler
// Note that if the event object already exists, the CreateEvent requests
// EVENT_ALL_ACCESS access right. If this fails, we try to open
// the event object asking for SYNCHRONIZE access only.
+# if !defined _WIN32_WCE
HANDLE sync = CreateEvent (&sa, FALSE, TRUE, TEXT ("Global\\zmq-signaler-port-sync"));
+# else
+ HANDLE sync = CreateEvent (NULL, FALSE, TRUE, TEXT ("Global\\zmq-signaler-port-sync"));
+# endif
if (sync == NULL && GetLastError () == ERROR_ACCESS_DENIED)
- sync = OpenEvent (SYNCHRONIZE | EVENT_MODIFY_STATE, FALSE, TEXT ("Global\\zmq-signaler-port-sync"));
+ sync = OpenEvent (SYNCHRONIZE | EVENT_MODIFY_STATE,
+ FALSE, TEXT ("Global\\zmq-signaler-port-sync"));
win_assert (sync != NULL);
- // Enter the critical section.
- DWORD dwrc = WaitForSingleObject (sync, INFINITE);
- zmq_assert (dwrc == WAIT_OBJECT_0);
-
// Windows has no 'socketpair' function. CreatePipe is no good as pipe
// handles cannot be polled on. Here we create the socketpair by hand.
*w_ = INVALID_SOCKET;
(char *)&tcp_nodelay, sizeof (tcp_nodelay));
wsa_assert (rc != SOCKET_ERROR);
- // Bind listening socket to any free local port.
+ // Init sockaddr to signaler port.
struct sockaddr_in addr;
memset (&addr, 0, sizeof (addr));
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = htonl (INADDR_LOOPBACK);
addr.sin_port = htons (signaler_port);
- rc = bind (listener, (const struct sockaddr*) &addr, sizeof (addr));
- wsa_assert (rc != SOCKET_ERROR);
-
- // Listen for incomming connections.
- rc = listen (listener, 1);
- wsa_assert (rc != SOCKET_ERROR);
// Create the writer socket.
- *w_ = WSASocket (AF_INET, SOCK_STREAM, 0, NULL, 0, 0);
+ *w_ = open_socket (AF_INET, SOCK_STREAM, 0);
wsa_assert (*w_ != INVALID_SOCKET);
- // On Windows, preventing sockets to be inherited by child processes.
- BOOL brc = SetHandleInformation ((HANDLE) *w_, HANDLE_FLAG_INHERIT, 0);
- win_assert (brc);
-
// Set TCP_NODELAY on writer socket.
rc = setsockopt (*w_, IPPROTO_TCP, TCP_NODELAY,
(char *)&tcp_nodelay, sizeof (tcp_nodelay));
wsa_assert (rc != SOCKET_ERROR);
+ // Enter the critical section.
+ DWORD dwrc = WaitForSingleObject (sync, INFINITE);
+ zmq_assert (dwrc == WAIT_OBJECT_0);
+
+ // Bind listening socket to signaler port.
+ rc = bind (listener, (const struct sockaddr*) &addr, sizeof (addr));
+
+ // Listen for incoming connections.
+ if (rc != SOCKET_ERROR)
+ rc = listen (listener, 1);
+
// Connect writer to the listener.
- rc = connect (*w_, (struct sockaddr*) &addr, sizeof (addr));
- wsa_assert (rc != SOCKET_ERROR);
+ if (rc != SOCKET_ERROR)
+ rc = connect (*w_, (struct sockaddr*) &addr, sizeof (addr));
// Accept connection from writer.
- *r_ = accept (listener, NULL, NULL);
- wsa_assert (*r_ != INVALID_SOCKET);
+ if (rc != SOCKET_ERROR)
+ *r_ = accept (listener, NULL, NULL);
- // On Windows, preventing sockets to be inherited by child processes.
- brc = SetHandleInformation ((HANDLE) *r_, HANDLE_FLAG_INHERIT, 0);
- win_assert (brc);
+ // Save errno if error occurred in bind/listen/connect/accept.
+ int saved_errno = 0;
+ if (*r_ == INVALID_SOCKET)
+ saved_errno = WSAGetLastError ();
// We don't need the listening socket anymore. Close it.
- rc = closesocket (listener);
- wsa_assert (rc != SOCKET_ERROR);
+ closesocket (listener);
// Exit the critical section.
- brc = SetEvent (sync);
+ BOOL brc = SetEvent (sync);
win_assert (brc != 0);
- return 0;
+ // Release the kernel object
+ brc = CloseHandle (sync);
+ win_assert (brc != 0);
+
+ if (*r_ != INVALID_SOCKET) {
+# if !defined _WIN32_WCE
+ // On Windows, preventing sockets to be inherited by child processes.
+ brc = SetHandleInformation ((HANDLE) *r_, HANDLE_FLAG_INHERIT, 0);
+ win_assert (brc);
+# endif
+ return 0;
+ }
+ else {
+ // Cleanup writer if connection failed
+ if (*w_ != INVALID_SOCKET) {
+ rc = closesocket (*w_);
+ wsa_assert (rc != SOCKET_ERROR);
+ *w_ = INVALID_SOCKET;
+ }
+ // Set errno from saved value
+ errno = wsa_error_to_errno (saved_errno);
+ return -1;
+ }
#elif defined ZMQ_HAVE_OPENVMS
rc = setsockopt (listener, IPPROTO_TCP, TCP_NODELACK, &on, sizeof (on));
errno_assert (rc != -1);
- rc = bind(listener, (struct sockaddr*) &lcladdr, sizeof (lcladdr));
+ rc = bind (listener, (struct sockaddr*) &lcladdr, sizeof (lcladdr));
errno_assert (rc != -1);
socklen_t lcladdr_len = sizeof (lcladdr);
return 0;
-#else // All other implementations support socketpair()
-
+#else
+ // All other implementations support socketpair()
int sv [2];
int rc = socketpair (AF_UNIX, SOCK_STREAM, 0, sv);
- errno_assert (rc == 0);
- *w_ = sv [0];
- *r_ = sv [1];
- return 0;
-
+ if (rc == -1) {
+ errno_assert (errno == ENFILE || errno == EMFILE);
+ *w_ = *r_ = -1;
+ return -1;
+ }
+ else {
+ *w_ = sv [0];
+ *r_ = sv [1];
+ return 0;
+ }
#endif
}
/*
- Copyright (c) 2010-2011 250bpm s.r.o.
- Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
#ifndef __ZMQ_SIGNALER_HPP_INCLUDED__
#define __ZMQ_SIGNALER_HPP_INCLUDED__
+#ifdef HAVE_FORK
+#include <unistd.h>
+#endif
+
#include "fd.hpp"
namespace zmq
void send ();
int wait (int timeout_);
void recv ();
-
+
+#ifdef HAVE_FORK
+ // close the file descriptors in a forked child process so that they
+ // do not interfere with the context in the parent process.
+ void forked();
+#endif
+
private:
// Creates a pair of filedescriptors that will be used
// to pass the signals.
static int make_fdpair (fd_t *r_, fd_t *w_);
- // Underlying write & read file descriptor.
+ // Underlying write & read file descriptor
+ // Will be -1 if we exceeded number of available handles
fd_t w;
fd_t r;
// Disable copying of signaler_t object.
signaler_t (const signaler_t&);
const signaler_t &operator = (const signaler_t&);
- };
+#ifdef HAVE_FORK
+ // the process that created this context. Used to detect forking.
+ pid_t pid;
+ // idempotent close of file descriptors that is safe to use by destructor
+ // and forked().
+ void close_internal();
+#endif
+ };
}
#endif
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2011 VMware, Inc.
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
#if defined ZMQ_HAVE_WINDOWS
#include "windows.hpp"
#if defined _MSC_VER
-#if defined WINCE
+#if defined _WIN32_WCE
#include <cmnintrin.h>
#else
#include <intrin.h>
#include "router.hpp"
#include "xpub.hpp"
#include "xsub.hpp"
+#include "stream.hpp"
bool zmq::socket_base_t::check_tag ()
{
{
socket_base_t *s = NULL;
switch (type_) {
-
- case ZMQ_PAIR:
- s = new (std::nothrow) pair_t (parent_, tid_, sid_);
- break;
- case ZMQ_PUB:
- s = new (std::nothrow) pub_t (parent_, tid_, sid_);
- break;
- case ZMQ_SUB:
- s = new (std::nothrow) sub_t (parent_, tid_, sid_);
- break;
- case ZMQ_REQ:
- s = new (std::nothrow) req_t (parent_, tid_, sid_);
- break;
- case ZMQ_REP:
- s = new (std::nothrow) rep_t (parent_, tid_, sid_);
- break;
- case ZMQ_DEALER:
- s = new (std::nothrow) dealer_t (parent_, tid_, sid_);
- break;
- case ZMQ_ROUTER:
- s = new (std::nothrow) router_t (parent_, tid_, sid_);
- break;
- case ZMQ_PULL:
- s = new (std::nothrow) pull_t (parent_, tid_, sid_);
- break;
- case ZMQ_PUSH:
- s = new (std::nothrow) push_t (parent_, tid_, sid_);
- break;
- case ZMQ_XPUB:
- s = new (std::nothrow) xpub_t (parent_, tid_, sid_);
- break;
- case ZMQ_XSUB:
- s = new (std::nothrow) xsub_t (parent_, tid_, sid_);
- break;
- default:
- errno = EINVAL;
- return NULL;
+ case ZMQ_PAIR:
+ s = new (std::nothrow) pair_t (parent_, tid_, sid_);
+ break;
+ case ZMQ_PUB:
+ s = new (std::nothrow) pub_t (parent_, tid_, sid_);
+ break;
+ case ZMQ_SUB:
+ s = new (std::nothrow) sub_t (parent_, tid_, sid_);
+ break;
+ case ZMQ_REQ:
+ s = new (std::nothrow) req_t (parent_, tid_, sid_);
+ break;
+ case ZMQ_REP:
+ s = new (std::nothrow) rep_t (parent_, tid_, sid_);
+ break;
+ case ZMQ_DEALER:
+ s = new (std::nothrow) dealer_t (parent_, tid_, sid_);
+ break;
+ case ZMQ_ROUTER:
+ s = new (std::nothrow) router_t (parent_, tid_, sid_);
+ break;
+ case ZMQ_PULL:
+ s = new (std::nothrow) pull_t (parent_, tid_, sid_);
+ break;
+ case ZMQ_PUSH:
+ s = new (std::nothrow) push_t (parent_, tid_, sid_);
+ break;
+ case ZMQ_XPUB:
+ s = new (std::nothrow) xpub_t (parent_, tid_, sid_);
+ break;
+ case ZMQ_XSUB:
+ s = new (std::nothrow) xsub_t (parent_, tid_, sid_);
+ break;
+ case ZMQ_STREAM:
+ s = new (std::nothrow) stream_t (parent_, tid_, sid_);
+ break;
+ default:
+ errno = EINVAL;
+ return NULL;
}
+ if (s->mailbox.get_fd () == retired_fd)
+ return NULL;
+
alloc_assert (s);
return s;
}
monitor_events (0)
{
options.socket_id = sid_;
+ options.ipv6 = (parent_->get (ZMQ_IPV6) != 0);
}
zmq::socket_base_t::~socket_base_t ()
return 0;
}
-void zmq::socket_base_t::attach_pipe (pipe_t *pipe_, bool icanhasall_)
+void zmq::socket_base_t::attach_pipe (pipe_t *pipe_, bool subscribe_to_all_)
{
// First, register the pipe so that we can terminate it later on.
pipe_->set_event_sink (this);
pipes.push_back (pipe_);
// Let the derived socket type know about new pipe.
- xattach_pipe (pipe_, icanhasall_);
+ xattach_pipe (pipe_, subscribe_to_all_);
// If the socket is already being closed, ask any new pipes to terminate
// straight away.
return 0;
}
+ if (option_ == ZMQ_LAST_ENDPOINT) {
+ if (*optvallen_ < last_endpoint.size () + 1) {
+ errno = EINVAL;
+ return -1;
+ }
+ strcpy (static_cast <char *> (optval_), last_endpoint.c_str ());
+ *optvallen_ = last_endpoint.size () + 1;
+ return 0;
+ }
+
return options.getsockopt (option_, optval_, optvallen_);
}
endpoint_t endpoint = {this, options};
int rc = register_endpoint (addr_, endpoint);
if (rc == 0) {
- // Save last endpoint URI
- options.last_endpoint.assign (addr_);
+ connect_pending(addr_, this);
+ last_endpoint.assign (addr_);
}
return rc;
}
}
// Save last endpoint URI
- listener->get_address (options.last_endpoint);
+ listener->get_address (last_endpoint);
- add_endpoint (addr_, (own_t *) listener);
+ add_endpoint (addr_, (own_t *) listener, NULL);
return 0;
}
}
// Save last endpoint URI
- listener->get_address (options.last_endpoint);
+ listener->get_address (last_endpoint);
- add_endpoint (addr_, (own_t *) listener);
+ add_endpoint (addr_, (own_t *) listener, NULL);
return 0;
}
#endif
// Find the peer endpoint.
endpoint_t peer = find_endpoint (addr_);
- if (!peer.socket)
- return -1;
// The total HWM for an inproc connection should be the sum of
// the binder's HWM and the connector's HWM.
int sndhwm = 0;
- if (options.sndhwm != 0 && peer.options.rcvhwm != 0)
+ if (peer.socket == NULL)
+ sndhwm = options.sndhwm;
+ else if (options.sndhwm != 0 && peer.options.rcvhwm != 0)
sndhwm = options.sndhwm + peer.options.rcvhwm;
int rcvhwm = 0;
- if (options.rcvhwm != 0 && peer.options.sndhwm != 0)
+ if (peer.socket == NULL)
+ rcvhwm = options.rcvhwm;
+ else if (options.rcvhwm != 0 && peer.options.sndhwm != 0)
rcvhwm = options.rcvhwm + peer.options.sndhwm;
// Create a bi-directional pipe to connect the peers.
- object_t *parents [2] = {this, peer.socket};
- pipe_t *pipes [2] = {NULL, NULL};
- int hwms [2] = {sndhwm, rcvhwm};
- bool delays [2] = {options.delay_on_disconnect, options.delay_on_close};
- int rc = pipepair (parents, pipes, hwms, delays);
+ object_t *parents [2] = {this, peer.socket == NULL ? this : peer.socket};
+ pipe_t *new_pipes [2] = {NULL, NULL};
+
+ bool conflate = options.conflate &&
+ (options.type == ZMQ_DEALER ||
+ options.type == ZMQ_PULL ||
+ options.type == ZMQ_PUSH ||
+ options.type == ZMQ_PUB ||
+ options.type == ZMQ_SUB);
+
+ int hwms [2] = {conflate? -1 : sndhwm, conflate? -1 : rcvhwm};
+ bool conflates [2] = {conflate, conflate};
+ int rc = pipepair (parents, new_pipes, hwms, conflates);
errno_assert (rc == 0);
// Attach local end of the pipe to this socket object.
- attach_pipe (pipes [0]);
-
- // If required, send the identity of the local socket to the peer.
- if (peer.options.recv_identity) {
- msg_t id;
- rc = id.init_size (options.identity_size);
- errno_assert (rc == 0);
- memcpy (id.data (), options.identity, options.identity_size);
- id.set_flags (msg_t::identity);
- bool written = pipes [0]->write (&id);
- zmq_assert (written);
- pipes [0]->flush ();
- }
+ attach_pipe (new_pipes [0]);
- // If required, send the identity of the peer to the local socket.
- if (options.recv_identity) {
- msg_t id;
- rc = id.init_size (peer.options.identity_size);
- errno_assert (rc == 0);
- memcpy (id.data (), peer.options.identity, peer.options.identity_size);
- id.set_flags (msg_t::identity);
- bool written = pipes [1]->write (&id);
- zmq_assert (written);
- pipes [1]->flush ();
+ if (!peer.socket)
+ {
+ endpoint_t endpoint = {this, options};
+ pending_connection_t pending_connection = {endpoint, new_pipes [0], new_pipes [1]};
+ pend_connection (addr_, pending_connection);
}
+ else
+ {
+ // If required, send the identity of the local socket to the peer.
+ if (peer.options.recv_identity) {
+
+ msg_t id;
+ rc = id.init_size (options.identity_size);
+ errno_assert (rc == 0);
+ memcpy (id.data (), options.identity, options.identity_size);
+ id.set_flags (msg_t::identity);
+ bool written = new_pipes [0]->write (&id);
+ zmq_assert (written);
+ new_pipes [0]->flush ();
+ }
+
+ // If required, send the identity of the peer to the local socket.
+ if (options.recv_identity) {
+ msg_t id;
+ rc = id.init_size (peer.options.identity_size);
+ errno_assert (rc == 0);
+ memcpy (id.data (), peer.options.identity, peer.options.identity_size);
+ id.set_flags (msg_t::identity);
+ bool written = new_pipes [1]->write (&id);
+ zmq_assert (written);
+ new_pipes [1]->flush ();
+ }
- // Attach remote end of the pipe to the peer socket. Note that peer's
- // seqnum was incremented in find_endpoint function. We don't need it
- // increased here.
- send_bind (peer.socket, pipes [1], false);
+ // Attach remote end of the pipe to the peer socket. Note that peer's
+ // seqnum was incremented in find_endpoint function. We don't need it
+ // increased here.
+ send_bind (peer.socket, new_pipes [1], false);
+ }
// Save last endpoint URI
- options.last_endpoint.assign (addr_);
+ last_endpoint.assign (addr_);
+
+ // remember inproc connections for disconnect
+ inprocs.insert (inprocs_t::value_type (std::string (addr_), new_pipes[0]));
return 0;
}
paddr->resolved.tcp_addr = new (std::nothrow) tcp_address_t ();
alloc_assert (paddr->resolved.tcp_addr);
int rc = paddr->resolved.tcp_addr->resolve (
- address.c_str (), false, options.ipv4only ? true : false);
+ address.c_str (), false, options.ipv6);
if (rc != 0) {
delete paddr;
return -1;
// PGM does not support subscription forwarding; ask for all data to be
// sent to this pipe.
- bool icanhasall = protocol == "pgm" || protocol == "epgm";
+ bool subscribe_to_all = protocol == "pgm" || protocol == "epgm";
+ pipe_t *newpipe = NULL;
- if (options.delay_attach_on_connect != 1 || icanhasall) {
+ if (options.immediate != 1 || subscribe_to_all) {
// Create a bi-directional pipe.
object_t *parents [2] = {this, session};
- pipe_t *pipes [2] = {NULL, NULL};
- int hwms [2] = {options.sndhwm, options.rcvhwm};
- bool delays [2] = {options.delay_on_disconnect, options.delay_on_close};
- rc = pipepair (parents, pipes, hwms, delays);
+ pipe_t *new_pipes [2] = {NULL, NULL};
+
+ bool conflate = options.conflate &&
+ (options.type == ZMQ_DEALER ||
+ options.type == ZMQ_PULL ||
+ options.type == ZMQ_PUSH ||
+ options.type == ZMQ_PUB ||
+ options.type == ZMQ_SUB);
+
+ int hwms [2] = {conflate? -1 : options.sndhwm,
+ conflate? -1 : options.rcvhwm};
+ bool conflates [2] = {conflate, conflate};
+ rc = pipepair (parents, new_pipes, hwms, conflates);
errno_assert (rc == 0);
// Attach local end of the pipe to the socket object.
- attach_pipe (pipes [0], icanhasall);
+ attach_pipe (new_pipes [0], subscribe_to_all);
+ newpipe = new_pipes [0];
// Attach remote end of the pipe to the session object later on.
- session->attach_pipe (pipes [1]);
+ session->attach_pipe (new_pipes [1]);
}
// Save last endpoint URI
- paddr->to_string (options.last_endpoint);
+ paddr->to_string (last_endpoint);
- add_endpoint (addr_, (own_t *) session);
+ add_endpoint (addr_, (own_t *) session, newpipe);
return 0;
}
-void zmq::socket_base_t::add_endpoint (const char *addr_, own_t *endpoint_)
+void zmq::socket_base_t::add_endpoint (const char *addr_, own_t *endpoint_, pipe_t *pipe)
{
// Activate the session. Make it a child of this socket.
launch_child (endpoint_);
- endpoints.insert (endpoints_t::value_type (std::string (addr_), endpoint_));
+ endpoints.insert (endpoints_t::value_type (std::string (addr_), endpoint_pipe_t(endpoint_, pipe)));
}
int zmq::socket_base_t::term_endpoint (const char *addr_)
if (unlikely (rc != 0))
return -1;
+ // Parse addr_ string.
+ std::string protocol;
+ std::string address;
+ rc = parse_uri (addr_, protocol, address);
+ if (rc != 0)
+ return -1;
+
+ rc = check_protocol (protocol);
+ if (rc != 0)
+ return -1;
+
+ // Disconnect an inproc socket
+ if (protocol == "inproc") {
+ std::pair <inprocs_t::iterator, inprocs_t::iterator> range = inprocs.equal_range (std::string (addr_));
+ if (range.first == range.second) {
+ errno = ENOENT;
+ return -1;
+ }
+
+ for (inprocs_t::iterator it = range.first; it != range.second; ++it)
+ it->second->terminate(true);
+ inprocs.erase (range.first, range.second);
+ return 0;
+ }
+
// Find the endpoints range (if any) corresponding to the addr_ string.
std::pair <endpoints_t::iterator, endpoints_t::iterator> range = endpoints.equal_range (std::string (addr_));
- if (range.first == range.second)
+ if (range.first == range.second) {
+ errno = ENOENT;
return -1;
+ }
- for (endpoints_t::iterator it = range.first; it != range.second; ++it)
- term_child (it->second);
+ for (endpoints_t::iterator it = range.first; it != range.second; ++it) {
+ // If we have an associated pipe, terminate it.
+ if (it->second.second != NULL)
+ it->second.second->terminate(false);
+ term_child (it->second.first);
+ }
endpoints.erase (range.first, range.second);
return 0;
}
msg_->set_flags (msg_t::more);
// Try to send the message.
- rc = xsend (msg_, flags_);
+ rc = xsend (msg_);
if (rc == 0)
return 0;
if (unlikely (errno != EAGAIN))
return -1;
// Compute the time when the timeout should occur.
- // If the timeout is infite, don't care.
+ // If the timeout is infinite, don't care.
int timeout = options.sndtimeo;
uint64_t end = timeout < 0 ? 0 : (clock.now_ms () + timeout);
while (true) {
if (unlikely (process_commands (timeout, false) != 0))
return -1;
- rc = xsend (msg_, flags_);
+ rc = xsend (msg_);
if (rc == 0)
break;
if (unlikely (errno != EAGAIN))
}
// Get the message.
- int rc = xrecv (msg_, flags_);
+ int rc = xrecv (msg_);
if (unlikely (rc != 0 && errno != EAGAIN))
return -1;
return -1;
ticks = 0;
- rc = xrecv (msg_, flags_);
+ rc = xrecv (msg_);
if (rc < 0)
return rc;
extract_flags (msg_);
}
// Compute the time when the timeout should occur.
- // If the timeout is infite, don't care.
+ // If the timeout is infinite, don't care.
int timeout = options.rcvtimeo;
uint64_t end = timeout < 0 ? 0 : (clock.now_ms () + timeout);
while (true) {
if (unlikely (process_commands (block ? timeout : 0, false) != 0))
return -1;
- rc = xrecv (msg_, flags_);
+ rc = xrecv (msg_);
if (rc == 0) {
ticks = 0;
break;
return false;
}
-int zmq::socket_base_t::xsend (msg_t *, int)
+int zmq::socket_base_t::xsend (msg_t *)
{
errno = ENOTSUP;
return -1;
return false;
}
-int zmq::socket_base_t::xrecv (msg_t *, int)
+int zmq::socket_base_t::xrecv (msg_t *)
{
errno = ENOTSUP;
return -1;
void zmq::socket_base_t::hiccuped (pipe_t *pipe_)
{
- if (options.delay_attach_on_connect == 1)
+ if (options.immediate == 1)
pipe_->terminate (false);
else
// Notify derived sockets of the hiccup
xhiccuped (pipe_);
}
-void zmq::socket_base_t::terminated (pipe_t *pipe_)
+void zmq::socket_base_t::pipe_terminated (pipe_t *pipe_)
{
// Notify the specific socket type about the pipe termination.
- xterminated (pipe_);
+ xpipe_terminated (pipe_);
+
+ // Remove pipe from inproc pipes
+ for (inprocs_t::iterator it = inprocs.begin(); it != inprocs.end(); ++it) {
+ if (it->second == pipe_) {
+ inprocs.erase(it);
+ break;
+ }
+ }
// Remove the pipe from the list of attached pipes and confirm its
// termination if we are already shutting down.
if (monitor_events & ZMQ_EVENT_CONNECTED) {
zmq_event_t event;
event.event = ZMQ_EVENT_CONNECTED;
- event.data.connected.addr = (char *) malloc (addr_.size () + 1);
- copy_monitor_address (event.data.connected.addr, addr_);
- event.data.connected.fd = fd_;
- monitor_event (event);
+ event.value = fd_;
+ monitor_event (event, addr_);
}
}
if (monitor_events & ZMQ_EVENT_CONNECT_DELAYED) {
zmq_event_t event;
event.event = ZMQ_EVENT_CONNECT_DELAYED;
- event.data.connect_delayed.addr = (char *) malloc (addr_.size () + 1);
- copy_monitor_address (event.data.connect_delayed.addr, addr_);
- event.data.connect_delayed.err = err_;
- monitor_event (event);
+ event.value = err_;
+ monitor_event (event, addr_);
}
}
if (monitor_events & ZMQ_EVENT_CONNECT_RETRIED) {
zmq_event_t event;
event.event = ZMQ_EVENT_CONNECT_RETRIED;
- event.data.connect_retried.addr = (char *) malloc (addr_.size () + 1);
- copy_monitor_address (event.data.connect_retried.addr, addr_);
- event.data.connect_retried.interval = interval_;
- monitor_event (event);
+ event.value = interval_;
+ monitor_event (event, addr_);
}
}
if (monitor_events & ZMQ_EVENT_LISTENING) {
zmq_event_t event;
event.event = ZMQ_EVENT_LISTENING;
- event.data.listening.addr = (char *) malloc (addr_.size () + 1);
- copy_monitor_address (event.data.listening.addr, addr_);
- event.data.listening.fd = fd_;
- monitor_event (event);
+ event.value = fd_;
+ monitor_event (event, addr_);
}
}
if (monitor_events & ZMQ_EVENT_BIND_FAILED) {
zmq_event_t event;
event.event = ZMQ_EVENT_BIND_FAILED;
- event.data.bind_failed.addr = (char *) malloc (addr_.size () + 1);
- copy_monitor_address (event.data.bind_failed.addr, addr_);
- event.data.bind_failed.err = err_;
- monitor_event (event);
+ event.value = err_;
+ monitor_event (event, addr_);
}
}
if (monitor_events & ZMQ_EVENT_ACCEPTED) {
zmq_event_t event;
event.event = ZMQ_EVENT_ACCEPTED;
- event.data.accepted.addr = (char *) malloc (addr_.size () + 1);
- copy_monitor_address (event.data.accepted.addr, addr_);
- event.data.accepted.fd = fd_;
- monitor_event (event);
+ event.value = fd_;
+ monitor_event (event, addr_);
}
}
if (monitor_events & ZMQ_EVENT_ACCEPT_FAILED) {
zmq_event_t event;
event.event = ZMQ_EVENT_ACCEPT_FAILED;
- event.data.accept_failed.addr = (char *) malloc (addr_.size () + 1);
- copy_monitor_address (event.data.accept_failed.addr, addr_);
- event.data.accept_failed.err= err_;
- monitor_event (event);
+ event.value= err_;
+ monitor_event (event, addr_);
}
}
if (monitor_events & ZMQ_EVENT_CLOSED) {
zmq_event_t event;
event.event = ZMQ_EVENT_CLOSED;
- event.data.closed.addr = (char *) malloc (addr_.size () + 1);
- copy_monitor_address (event.data.closed.addr, addr_);
- event.data.closed.fd = fd_;
- monitor_event (event);
+ event.value = fd_;
+ monitor_event (event, addr_);
}
}
-
+
void zmq::socket_base_t::event_close_failed (std::string &addr_, int err_)
{
if (monitor_events & ZMQ_EVENT_CLOSE_FAILED) {
zmq_event_t event;
event.event = ZMQ_EVENT_CLOSE_FAILED;
- event.data.close_failed.addr = (char *) malloc (addr_.size () + 1);
- copy_monitor_address (event.data.close_failed.addr, addr_);
- event.data.close_failed.err = err_;
- monitor_event (event);
+ event.value = err_;
+ monitor_event (event, addr_);
}
}
if (monitor_events & ZMQ_EVENT_DISCONNECTED) {
zmq_event_t event;
event.event = ZMQ_EVENT_DISCONNECTED;
- event.data.disconnected.addr = (char *) malloc (addr_.size () + 1);
- copy_monitor_address (event.data.disconnected.addr, addr_);
- event.data.disconnected.fd = fd_;
- monitor_event (event);
+ event.value = fd_;
+ monitor_event (event, addr_);
}
}
-void zmq::socket_base_t::copy_monitor_address (char *dest_, std::string &src_)
-{
- alloc_assert (dest_);
- dest_[src_.size ()] = 0;
- memcpy (dest_, src_.c_str (), src_.size ());
-}
-
-void zmq::socket_base_t::monitor_event (zmq_event_t event_)
+void zmq::socket_base_t::monitor_event (zmq_event_t event_, const std::string& addr_)
{
if (monitor_socket) {
+ const uint16_t eid = (uint16_t)event_.event;
+ const uint32_t value = (uint32_t)event_.value;
+ // prepare and send first message frame
+ // containing event id and value
zmq_msg_t msg;
- void *event_data = malloc (sizeof (event_));
- alloc_assert (event_data);
- memcpy (event_data, &event_, sizeof (event_));
- zmq_msg_init_data (&msg, event_data, sizeof (event_), zmq_free_event, NULL);
+ zmq_msg_init_size (&msg, sizeof(eid) + sizeof(value));
+ char* data1 = (char*)zmq_msg_data(&msg);
+ memcpy (data1, &eid, sizeof(eid));
+ memcpy (data1+sizeof(eid), &value, sizeof(value));
+ zmq_sendmsg (monitor_socket, &msg, ZMQ_SNDMORE);
+ // prepare and send second message frame
+ // containing the address (endpoint)
+ zmq_msg_init_size (&msg, addr_.size());
+ memcpy(zmq_msg_data(&msg), addr_.c_str(), addr_.size());
zmq_sendmsg (monitor_socket, &msg, 0);
- zmq_msg_close (&msg);
}
}
void zmq::socket_base_t::stop_monitor()
{
if (monitor_socket) {
+ if (monitor_events & ZMQ_EVENT_MONITOR_STOPPED) {
+ zmq_event_t event;
+ event.event = ZMQ_EVENT_MONITOR_STOPPED;
+ event.value = 0;
+ monitor_event (event, "");
+ }
zmq_close (monitor_socket);
monitor_socket = NULL;
monitor_events = 0;
/*
- Copyright (c) 2007-2012 iMatix Corporation
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2011 VMware, Inc.
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
void read_activated (pipe_t *pipe_);
void write_activated (pipe_t *pipe_);
void hiccuped (pipe_t *pipe_);
- void terminated (pipe_t *pipe_);
+ void pipe_terminated (pipe_t *pipe_);
void lock();
void unlock();
- int monitor(const char *endpoint_, int events_);
+ int monitor (const char *endpoint_, int events_);
void event_connected (std::string &addr_, int fd_);
void event_connect_delayed (std::string &addr_, int err_);
void event_bind_failed (std::string &addr_, int err_);
void event_accepted (std::string &addr_, int fd_);
void event_accept_failed (std::string &addr_, int err_);
- void event_closed (std::string &addr_, int fd_);
- void event_close_failed (std::string &addr_, int fd_);
- void event_disconnected (std::string &addr_, int fd_);
+ void event_closed (std::string &addr_, int fd_);
+ void event_close_failed (std::string &addr_, int fd_);
+ void event_disconnected (std::string &addr_, int fd_);
protected:
// Concrete algorithms for the x- methods are to be defined by
// individual socket types.
virtual void xattach_pipe (zmq::pipe_t *pipe_,
- bool icanhasall_ = false) = 0;
+ bool subscribe_to_all_ = false) = 0;
// The default implementation assumes there are no specific socket
// options for the particular socket type. If not so, overload this
// The default implementation assumes that send is not supported.
virtual bool xhas_out ();
- virtual int xsend (zmq::msg_t *msg_, int flags_);
+ virtual int xsend (zmq::msg_t *msg_);
// The default implementation assumes that recv in not supported.
virtual bool xhas_in ();
- virtual int xrecv (zmq::msg_t *msg_, int flags_);
+ virtual int xrecv (zmq::msg_t *msg_);
// i_pipe_events will be forwarded to these functions.
virtual void xread_activated (pipe_t *pipe_);
virtual void xwrite_activated (pipe_t *pipe_);
virtual void xhiccuped (pipe_t *pipe_);
- virtual void xterminated (pipe_t *pipe_) = 0;
+ virtual void xpipe_terminated (pipe_t *pipe_) = 0;
// Delay actual destruction of the socket.
void process_destroy ();
// Socket event data dispath
- void monitor_event (zmq_event_t data_);
-
- // Copy monitor specific event endpoints to event messages
- void copy_monitor_address (char *dest_, std::string &src_);
+ void monitor_event (zmq_event_t data_, const std::string& addr_);
// Monitor socket cleanup
void stop_monitor ();
private:
// Creates new endpoint ID and adds the endpoint to the map.
- void add_endpoint (const char *addr_, own_t *endpoint_);
+ void add_endpoint (const char *addr_, own_t *endpoint_, pipe_t *pipe);
// Map of open endpoints.
- typedef std::multimap <std::string, own_t *> endpoints_t;
+ typedef std::pair <own_t *, pipe_t*> endpoint_pipe_t;
+ typedef std::multimap <std::string, endpoint_pipe_t> endpoints_t;
endpoints_t endpoints;
+ // Map of open inproc endpoints.
+ typedef std::multimap <std::string, pipe_t *> inprocs_t;
+ inprocs_t inprocs;
+
// To be called after processing commands or invoking any command
// handlers explicitly. If required, it will deallocate the socket.
void check_destroy ();
int check_protocol (const std::string &protocol_);
// Register the pipe with this socket.
- void attach_pipe (zmq::pipe_t *pipe_, bool icanhasall_ = false);
+ void attach_pipe (zmq::pipe_t *pipe_, bool subscribe_to_all_ = false);
// Processes commands sent to this socket (if any). If timeout is -1,
// returns only after at least one command was processed.
// Bitmask of events being monitored
int monitor_events;
+ // Last socket endpoint resolved URI
+ std::string last_endpoint;
+
socket_base_t (const socket_base_t&);
const socket_base_t &operator = (const socket_base_t&);
mutex_t sync;
/*
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "stream.hpp"
+#include "pipe.hpp"
+#include "wire.hpp"
+#include "random.hpp"
+#include "likely.hpp"
+#include "err.hpp"
+
+zmq::stream_t::stream_t (class ctx_t *parent_, uint32_t tid_, int sid_) :
+ socket_base_t (parent_, tid_, sid_),
+ prefetched (false),
+ identity_sent (false),
+ current_out (NULL),
+ more_out (false),
+ next_peer_id (generate_random ())
+{
+ options.type = ZMQ_STREAM;
+ options.raw_sock = true;
+
+ prefetched_id.init ();
+ prefetched_msg.init ();
+}
+
+zmq::stream_t::~stream_t ()
+{
+ zmq_assert (outpipes.empty ());
+ prefetched_id.close ();
+ prefetched_msg.close ();
+}
+
+void zmq::stream_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_)
+{
+ // subscribe_to_all_ is unused
+ (void)subscribe_to_all_;
+
+ zmq_assert (pipe_);
+
+ identify_peer (pipe_);
+ fq.attach (pipe_);
+}
+
+void zmq::stream_t::xpipe_terminated (pipe_t *pipe_)
+{
+ outpipes_t::iterator it = outpipes.find (pipe_->get_identity ());
+ zmq_assert (it != outpipes.end ());
+ outpipes.erase (it);
+ fq.pipe_terminated (pipe_);
+ if (pipe_ == current_out)
+ current_out = NULL;
+}
+
+void zmq::stream_t::xread_activated (pipe_t *pipe_)
+{
+ fq.activated (pipe_);
+}
+
+void zmq::stream_t::xwrite_activated (pipe_t *pipe_)
+{
+ outpipes_t::iterator it;
+ for (it = outpipes.begin (); it != outpipes.end (); ++it)
+ if (it->second.pipe == pipe_)
+ break;
+
+ zmq_assert (it != outpipes.end ());
+ zmq_assert (!it->second.active);
+ it->second.active = true;
+}
+
+int zmq::stream_t::xsend (msg_t *msg_)
+{
+ // If this is the first part of the message it's the ID of the
+ // peer to send the message to.
+ if (!more_out) {
+ zmq_assert (!current_out);
+
+ // If we have malformed message (prefix with no subsequent message)
+ // then just silently ignore it.
+ // TODO: The connections should be killed instead.
+ if (msg_->flags () & msg_t::more) {
+
+ // Find the pipe associated with the identity stored in the prefix.
+ // If there's no such pipe return an error
+ blob_t identity ((unsigned char*) msg_->data (), msg_->size ());
+ outpipes_t::iterator it = outpipes.find (identity);
+
+ if (it != outpipes.end ()) {
+ current_out = it->second.pipe;
+ if (!current_out->check_write ()) {
+ it->second.active = false;
+ current_out = NULL;
+ errno = EAGAIN;
+ return -1;
+ }
+ }
+ else {
+ errno = EHOSTUNREACH;
+ return -1;
+ }
+ }
+
+ // Expect one more message frame.
+ more_out = true;
+
+ int rc = msg_->close ();
+ errno_assert (rc == 0);
+ rc = msg_->init ();
+ errno_assert (rc == 0);
+ return 0;
+ }
+
+ // Ignore the MORE flag
+ msg_->reset_flags (msg_t::more);
+
+ // This is the last part of the message.
+ more_out = false;
+
+ // Push the message into the pipe. If there's no out pipe, just drop it.
+ if (current_out) {
+
+ // Close the remote connection if user has asked to do so
+ // by sending zero length message.
+ // Pending messages in the pipe will be dropped (on receiving term- ack)
+ if (msg_->size () == 0) {
+ current_out->terminate (false);
+ int rc = msg_->close ();
+ errno_assert (rc == 0);
+ current_out = NULL;
+ return 0;
+ }
+ bool ok = current_out->write (msg_);
+ if (likely (ok))
+ current_out->flush ();
+ current_out = NULL;
+ }
+ else {
+ int rc = msg_->close ();
+ errno_assert (rc == 0);
+ }
+
+ // Detach the message from the data buffer.
+ int rc = msg_->init ();
+ errno_assert (rc == 0);
+
+ return 0;
+}
+
+int zmq::stream_t::xrecv (msg_t *msg_)
+{
+ if (prefetched) {
+ if (!identity_sent) {
+ int rc = msg_->move (prefetched_id);
+ errno_assert (rc == 0);
+ identity_sent = true;
+ }
+ else {
+ int rc = msg_->move (prefetched_msg);
+ errno_assert (rc == 0);
+ prefetched = false;
+ }
+ return 0;
+ }
+
+ pipe_t *pipe = NULL;
+ int rc = fq.recvpipe (&prefetched_msg, &pipe);
+ if (rc != 0)
+ return -1;
+
+ zmq_assert (pipe != NULL);
+ zmq_assert ((prefetched_msg.flags () & msg_t::more) == 0);
+
+ // We have received a frame with TCP data.
+ // Rather than sendig this frame, we keep it in prefetched
+ // buffer and send a frame with peer's ID.
+ blob_t identity = pipe->get_identity ();
+ rc = msg_->init_size (identity.size ());
+ errno_assert (rc == 0);
+ memcpy (msg_->data (), identity.data (), identity.size ());
+ msg_->set_flags (msg_t::more);
+
+ prefetched = true;
+ identity_sent = true;
+
+ return 0;
+}
+
+bool zmq::stream_t::xhas_in ()
+{
+ // We may already have a message pre-fetched.
+ if (prefetched)
+ return true;
+
+ // Try to read the next message.
+ // The message, if read, is kept in the pre-fetch buffer.
+ pipe_t *pipe = NULL;
+ int rc = fq.recvpipe (&prefetched_msg, &pipe);
+ if (rc != 0)
+ return false;
+
+ zmq_assert (pipe != NULL);
+ zmq_assert ((prefetched_msg.flags () & msg_t::more) == 0);
+
+ blob_t identity = pipe->get_identity ();
+ rc = prefetched_id.init_size (identity.size ());
+ errno_assert (rc == 0);
+ memcpy (prefetched_id.data (), identity.data (), identity.size ());
+ prefetched_id.set_flags (msg_t::more);
+
+ prefetched = true;
+ identity_sent = false;
+
+ return true;
+}
+
+bool zmq::stream_t::xhas_out ()
+{
+ // In theory, STREAM socket is always ready for writing. Whether actual
+ // attempt to write succeeds depends on which pipe the message is going
+ // to be routed to.
+ return true;
+}
+
+void zmq::stream_t::identify_peer (pipe_t *pipe_)
+{
+ // Always assign identity for raw-socket
+ unsigned char buffer [5];
+ buffer [0] = 0;
+ put_uint32 (buffer + 1, next_peer_id++);
+ blob_t identity = blob_t (buffer, sizeof buffer);
+
+ memcpy (options.identity, identity.data (), identity.size ());
+ options.identity_size = identity.size ();
+
+ pipe_->set_identity (identity);
+ // Add the record into output pipes lookup table
+ outpipe_t outpipe = {pipe_, true};
+ const bool ok = outpipes.insert (
+ outpipes_t::value_type (identity, outpipe)).second;
+ zmq_assert (ok);
+}
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __ZMQ_STREAM_HPP_INCLUDED__
+#define __ZMQ_STREAM_HPP_INCLUDED__
+
+#include <map>
+
+#include "router.hpp"
+
+namespace zmq
+{
+
+ class ctx_t;
+ class pipe_t;
+
+ class stream_t :
+ public socket_base_t
+ {
+ public:
+
+ stream_t (zmq::ctx_t *parent_, uint32_t tid_, int sid);
+ ~stream_t ();
+
+ // Overloads of functions from socket_base_t.
+ void xattach_pipe (zmq::pipe_t *pipe_, bool subscribe_to_all_);
+ int xsend (zmq::msg_t *msg_);
+ int xrecv (zmq::msg_t *msg_);
+ bool xhas_in ();
+ bool xhas_out ();
+ void xread_activated (zmq::pipe_t *pipe_);
+ void xwrite_activated (zmq::pipe_t *pipe_);
+ void xpipe_terminated (zmq::pipe_t *pipe_);
+
+ private:
+ // Generate peer's id and update lookup map
+ void identify_peer (pipe_t *pipe_);
+
+ // Fair queueing object for inbound pipes.
+ fq_t fq;
+
+ // True iff there is a message held in the pre-fetch buffer.
+ bool prefetched;
+
+ // If true, the receiver got the message part with
+ // the peer's identity.
+ bool identity_sent;
+
+ // Holds the prefetched identity.
+ msg_t prefetched_id;
+
+ // Holds the prefetched message.
+ msg_t prefetched_msg;
+
+ struct outpipe_t
+ {
+ zmq::pipe_t *pipe;
+ bool active;
+ };
+
+ // Outbound pipes indexed by the peer IDs.
+ typedef std::map <blob_t, outpipe_t> outpipes_t;
+ outpipes_t outpipes;
+
+ // The pipe we are currently writing to.
+ zmq::pipe_t *current_out;
+
+ // If true, more outgoing message parts are expected.
+ bool more_out;
+
+ // Peer ID are generated. It's a simple increment and wrap-over
+ // algorithm. This value is the next ID to use (if not used already).
+ uint32_t next_peer_id;
+
+ stream_t (const stream_t&);
+ const stream_t &operator = (const stream_t&);
+ };
+
+}
+
+#endif
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
#include "stream_engine.hpp"
#include "io_thread.hpp"
#include "session_base.hpp"
-#include "encoder.hpp"
-#include "decoder.hpp"
#include "v1_encoder.hpp"
#include "v1_decoder.hpp"
+#include "v2_encoder.hpp"
+#include "v2_decoder.hpp"
+#include "null_mechanism.hpp"
+#include "plain_mechanism.hpp"
+#include "curve_client.hpp"
+#include "curve_server.hpp"
+#include "raw_decoder.hpp"
+#include "raw_encoder.hpp"
#include "config.hpp"
#include "err.hpp"
#include "ip.hpp"
#include "likely.hpp"
#include "wire.hpp"
-zmq::stream_engine_t::stream_engine_t (fd_t fd_, const options_t &options_, const std::string &endpoint_) :
+zmq::stream_engine_t::stream_engine_t (fd_t fd_, const options_t &options_,
+ const std::string &endpoint_) :
s (fd_),
- io_enabled (false),
inpos (NULL),
insize (0),
decoder (NULL),
outsize (0),
encoder (NULL),
handshaking (true),
+ greeting_size (v2_greeting_size),
greeting_bytes_read (0),
session (NULL),
options (options_),
endpoint (endpoint_),
plugged (false),
+ read_msg (&stream_engine_t::read_identity),
+ write_msg (&stream_engine_t::write_identity),
+ io_error (false),
+ subscription_required (false),
+ mechanism (NULL),
+ input_stopped (false),
+ output_stopped (false),
socket (NULL)
{
+ int rc = tx_msg.init ();
+ errno_assert (rc == 0);
+
// Put the socket into non-blocking mode.
unblock_socket (s);
- // Set the socket buffer limits for the underlying socket.
- if (options.sndbuf) {
- int rc = setsockopt (s, SOL_SOCKET, SO_SNDBUF,
- (char*) &options.sndbuf, sizeof (int));
-#ifdef ZMQ_HAVE_WINDOWS
- wsa_assert (rc != SOCKET_ERROR);
-#else
- errno_assert (rc == 0);
-#endif
- }
- if (options.rcvbuf) {
- int rc = setsockopt (s, SOL_SOCKET, SO_RCVBUF,
- (char*) &options.rcvbuf, sizeof (int));
-#ifdef ZMQ_HAVE_WINDOWS
- wsa_assert (rc != SOCKET_ERROR);
-#else
- errno_assert (rc == 0);
-#endif
- }
+
+ if (!get_peer_ip_address (s, peer_address))
+ peer_address = "";
#ifdef SO_NOSIGPIPE
// Make sure that SIGPIPE signal is not generated when writing to a
// connection that was already closed by the peer.
int set = 1;
- int rc = setsockopt (s, SOL_SOCKET, SO_NOSIGPIPE, &set, sizeof (int));
+ rc = setsockopt (s, SOL_SOCKET, SO_NOSIGPIPE, &set, sizeof (int));
errno_assert (rc == 0);
#endif
}
if (s != retired_fd) {
#ifdef ZMQ_HAVE_WINDOWS
- int rc = closesocket (s);
- wsa_assert (rc != SOCKET_ERROR);
+ int rc = closesocket (s);
+ wsa_assert (rc != SOCKET_ERROR);
#else
- int rc = close (s);
+ int rc = close (s);
errno_assert (rc == 0);
#endif
- s = retired_fd;
+ s = retired_fd;
}
- if (encoder != NULL)
- delete encoder;
- if (decoder != NULL)
- delete decoder;
+ int rc = tx_msg.close ();
+ errno_assert (rc == 0);
+
+ delete encoder;
+ delete decoder;
+ delete mechanism;
}
void zmq::stream_engine_t::plug (io_thread_t *io_thread_,
// Connect to I/O threads poller object.
io_object_t::plug (io_thread_);
handle = add_fd (s);
- io_enabled = true;
+ io_error = false;
+
+ if (options.raw_sock) {
+ // no handshaking for raw sock, instantiate raw encoder and decoders
+ encoder = new (std::nothrow) raw_encoder_t (out_batch_size);
+ alloc_assert (encoder);
+
+ decoder = new (std::nothrow) raw_decoder_t (in_batch_size);
+ alloc_assert (decoder);
- // Send the 'length' and 'flags' fields of the identity message.
- // The 'length' field is encoded in the long format.
- outpos = greeting_output_buffer;
- outpos [outsize++] = 0xff;
- put_uint64 (&outpos [outsize], options.identity_size + 1);
- outsize += 8;
- outpos [outsize++] = 0x7f;
+ // disable handshaking for raw socket
+ handshaking = false;
+
+ read_msg = &stream_engine_t::pull_msg_from_session;
+ write_msg = &stream_engine_t::push_msg_to_session;
+ }
+ else {
+ // Send the 'length' and 'flags' fields of the identity message.
+ // The 'length' field is encoded in the long format.
+ outpos = greeting_send;
+ outpos [outsize++] = 0xff;
+ put_uint64 (&outpos [outsize], options.identity_size + 1);
+ outsize += 8;
+ outpos [outsize++] = 0x7f;
+ }
set_pollin (handle);
set_pollout (handle);
plugged = false;
// Cancel all fd subscriptions.
- if (io_enabled) {
+ if (!io_error)
rm_fd (handle);
- io_enabled = false;
- }
// Disconnect from I/O threads poller object.
io_object_t::unplug ();
- // Disconnect from session object.
- if (encoder)
- encoder->set_msg_source (NULL);
- if (decoder)
- decoder->set_msg_sink (NULL);
session = NULL;
}
void zmq::stream_engine_t::in_event ()
{
- // If still handshaking, receive and prcess the greeting message.
+ assert (!io_error);
+
+ // If still handshaking, receive and process the greeting message.
if (unlikely (handshaking))
if (!handshake ())
return;
zmq_assert (decoder);
- bool disconnection = false;
+
+ // If there has been an I/O error, stop polling.
+ if (input_stopped) {
+ rm_fd (handle);
+ io_error = true;
+ return;
+ }
// If there's no data to process in the buffer...
if (!insize) {
// Note that buffer can be arbitrarily large. However, we assume
// the underlying TCP layer has fixed buffer size and thus the
// number of bytes read will be always limited.
- decoder->get_buffer (&inpos, &insize);
- insize = read (inpos, insize);
+ size_t bufsize = 0;
+ decoder->get_buffer (&inpos, &bufsize);
- // Check whether the peer has closed the connection.
- if (insize == (size_t) -1) {
- insize = 0;
- disconnection = true;
+ int const rc = read (inpos, bufsize);
+ if (rc == 0) {
+ error ();
+ return;
+ }
+ if (rc == -1) {
+ if (errno != EAGAIN)
+ error ();
+ return;
}
- }
-
- // Push the data to the decoder.
- size_t processed = decoder->process_buffer (inpos, insize);
- if (unlikely (processed == (size_t) -1)) {
- disconnection = true;
+ // Adjust input size
+ insize = static_cast <size_t> (rc);
}
- else {
- // Stop polling for input if we got stuck.
- if (processed < insize)
- reset_pollin (handle);
+ int rc = 0;
+ size_t processed = 0;
- // Adjust the buffer.
+ while (insize > 0) {
+ rc = decoder->decode (inpos, insize, processed);
+ zmq_assert (processed <= insize);
inpos += processed;
insize -= processed;
+ if (rc == 0 || rc == -1)
+ break;
+ rc = (this->*write_msg) (decoder->msg ());
+ if (rc == -1)
+ break;
}
- // Flush all messages the decoder may have produced.
- session->flush ();
-
- // Input error has occurred. If the last decoded
- // message has already been accepted, we terminate
- // the engine immediately. Otherwise, we stop
- // waiting for input events and postpone the termination
- // until after the session has accepted the message.
- if (disconnection) {
- if (decoder->stalled ()) {
- rm_fd (handle);
- io_enabled = false;
- }
- else
+ // Tear down the connection if we have failed to decode input data
+ // or the session has rejected the message.
+ if (rc == -1) {
+ if (errno != EAGAIN) {
error ();
+ return;
+ }
+ input_stopped = true;
+ reset_pollin (handle);
}
+
+ session->flush ();
}
void zmq::stream_engine_t::out_event ()
{
+ zmq_assert (!io_error);
+
// If write buffer is empty, try to read new data from the encoder.
if (!outsize) {
}
outpos = NULL;
- encoder->get_data (&outpos, &outsize);
+ outsize = encoder->encode (&outpos, 0);
+
+ while (outsize < out_batch_size) {
+ if ((this->*read_msg) (&tx_msg) == -1)
+ break;
+ encoder->load_msg (&tx_msg);
+ unsigned char *bufptr = outpos + outsize;
+ size_t n = encoder->encode (&bufptr, out_batch_size - outsize);
+ zmq_assert (n > 0);
+ if (outpos == NULL)
+ outpos = bufptr;
+ outsize += n;
+ }
// If there is no data to send, stop polling for output.
if (outsize == 0) {
+ output_stopped = true;
reset_pollout (handle);
return;
}
// If there are any data to write in write buffer, write as much as
// possible to the socket. Note that amount of data to write can be
- // arbitratily large. However, we assume that underlying TCP layer has
+ // arbitrarily large. However, we assume that underlying TCP layer has
// limited transmission buffer and thus the actual number of bytes
// written should be reasonably modest.
int nbytes = write (outpos, outsize);
// IO error has occurred. We stop waiting for output events.
// The engine is not terminated until we detect input error;
- // this is necessary to prevent losing incomming messages.
+ // this is necessary to prevent losing incoming messages.
if (nbytes == -1) {
reset_pollout (handle);
return;
reset_pollout (handle);
}
-void zmq::stream_engine_t::activate_out ()
+void zmq::stream_engine_t::restart_output ()
{
- set_pollout (handle);
+ if (unlikely (io_error))
+ return;
+
+ if (likely (output_stopped)) {
+ set_pollout (handle);
+ output_stopped = false;
+ }
// Speculative write: The assumption is that at the moment new message
// was sent by the user the socket is probably available for writing.
out_event ();
}
-void zmq::stream_engine_t::activate_in ()
+void zmq::stream_engine_t::restart_input ()
{
- if (unlikely (!io_enabled)) {
- // There was an input error but the engine could not
- // be terminated (due to the stalled decoder).
- // Flush the pending message and terminate the engine now.
- zmq_assert (decoder);
- decoder->process_buffer (inpos, 0);
- zmq_assert (!decoder->stalled ());
- session->flush ();
- error ();
+ zmq_assert (input_stopped);
+ zmq_assert (session != NULL);
+ zmq_assert (decoder != NULL);
+
+ int rc = (this->*write_msg) (decoder->msg ());
+ if (rc == -1) {
+ if (errno == EAGAIN)
+ session->flush ();
+ else
+ error ();
return;
}
- set_pollin (handle);
+ while (insize > 0) {
+ size_t processed = 0;
+ rc = decoder->decode (inpos, insize, processed);
+ zmq_assert (processed <= insize);
+ inpos += processed;
+ insize -= processed;
+ if (rc == 0 || rc == -1)
+ break;
+ rc = (this->*write_msg) (decoder->msg ());
+ if (rc == -1)
+ break;
+ }
- // Speculative read.
- in_event ();
+ if (rc == -1 && errno == EAGAIN)
+ session->flush ();
+ else
+ if (rc == -1 || io_error)
+ error ();
+ else {
+ input_stopped = false;
+ set_pollin (handle);
+ session->flush ();
+
+ // Speculative read.
+ in_event ();
+ }
}
bool zmq::stream_engine_t::handshake ()
{
zmq_assert (handshaking);
zmq_assert (greeting_bytes_read < greeting_size);
-
// Receive the greeting.
while (greeting_bytes_read < greeting_size) {
- const int n = read (greeting + greeting_bytes_read,
+ const int n = read (greeting_recv + greeting_bytes_read,
greeting_size - greeting_bytes_read);
- if (n == -1) {
+ if (n == 0) {
error ();
return false;
}
-
- if (n == 0)
+ if (n == -1) {
+ if (errno != EAGAIN)
+ error ();
return false;
+ }
greeting_bytes_read += n;
// We have received at least one byte from the peer.
// If the first byte is not 0xff, we know that the
// peer is using unversioned protocol.
- if (greeting [0] != 0xff)
+ if (greeting_recv [0] != 0xff)
break;
- if (greeting_bytes_read < 10)
+ if (greeting_bytes_read < signature_size)
continue;
// Inspect the right-most bit of the 10th byte (which coincides
// with the 'flags' field if a regular message was sent).
// Zero indicates this is a header of identity message
// (i.e. the peer is using the unversioned protocol).
- if (!(greeting [9] & 0x01))
+ if (!(greeting_recv [9] & 0x01))
break;
// The peer is using versioned protocol.
- // Send the rest of the greeting, if necessary.
- if (outpos + outsize != greeting_output_buffer + greeting_size) {
+ // Send the major version number.
+ if (outpos + outsize == greeting_send + signature_size) {
if (outsize == 0)
set_pollout (handle);
- outpos [outsize++] = 1; // Protocol version
- outpos [outsize++] = options.type; // Socket type
+ outpos [outsize++] = 3; // Major version number
+ }
+
+ if (greeting_bytes_read > signature_size) {
+ if (outpos + outsize == greeting_send + signature_size + 1) {
+ if (outsize == 0)
+ set_pollout (handle);
+
+ // Use ZMTP/2.0 to talk to older peers.
+ if (greeting_recv [10] == ZMTP_1_0
+ || greeting_recv [10] == ZMTP_2_0)
+ outpos [outsize++] = options.type;
+ else {
+ outpos [outsize++] = 0; // Minor version number
+ memset (outpos + outsize, 0, 20);
+
+ zmq_assert (options.mechanism == ZMQ_NULL
+ || options.mechanism == ZMQ_PLAIN
+ || options.mechanism == ZMQ_CURVE);
+
+ if (options.mechanism == ZMQ_NULL)
+ memcpy (outpos + outsize, "NULL", 4);
+ else
+ if (options.mechanism == ZMQ_PLAIN)
+ memcpy (outpos + outsize, "PLAIN", 5);
+ else
+ memcpy (outpos + outsize, "CURVE", 5);
+ outsize += 20;
+ memset (outpos + outsize, 0, 32);
+ outsize += 32;
+ greeting_size = v3_greeting_size;
+ }
+ }
}
}
- // Position of the version field in the greeting.
- const size_t version_pos = 10;
+ // Position of the revision field in the greeting.
+ const size_t revision_pos = 10;
- // Is the peer using the unversioned protocol?
- // If so, we send and receive rests of identity
- // messages.
- if (greeting [0] != 0xff || !(greeting [9] & 0x01)) {
- encoder = new (std::nothrow) encoder_t (out_batch_size);
+ // Is the peer using ZMTP/1.0 with no revision number?
+ // If so, we send and receive rest of identity message
+ if (greeting_recv [0] != 0xff || !(greeting_recv [9] & 0x01)) {
+ encoder = new (std::nothrow) v1_encoder_t (out_batch_size);
alloc_assert (encoder);
- encoder->set_msg_source (session);
- decoder = new (std::nothrow) decoder_t (in_batch_size, options.maxmsgsize);
+ decoder = new (std::nothrow) v1_decoder_t (in_batch_size, options.maxmsgsize);
alloc_assert (decoder);
- decoder->set_msg_sink (session);
// We have already sent the message header.
// Since there is no way to tell the encoder to
// header data away.
const size_t header_size = options.identity_size + 1 >= 255 ? 10 : 2;
unsigned char tmp [10], *bufferp = tmp;
- size_t buffer_size = header_size;
- encoder->get_data (&bufferp, &buffer_size);
+
+ // Prepare the identity message and load it into encoder.
+ // Then consume bytes we have already sent to the peer.
+ const int rc = tx_msg.init_size (options.identity_size);
+ zmq_assert (rc == 0);
+ memcpy (tx_msg.data (), options.identity, options.identity_size);
+ encoder->load_msg (&tx_msg);
+ size_t buffer_size = encoder->encode (&bufferp, header_size);
zmq_assert (buffer_size == header_size);
// Make sure the decoder sees the data we have already received.
- inpos = greeting;
+ inpos = greeting_recv;
insize = greeting_bytes_read;
// To allow for interoperability with peers that do not forward
- // their subscriptions, we inject a phony subsription
- // message into the incomming message stream. To put this
- // message right after the identity message, we temporarily
- // divert the message stream from session to ourselves.
+ // their subscriptions, we inject a phantom subscription message
+ // message into the incoming message stream.
if (options.type == ZMQ_PUB || options.type == ZMQ_XPUB)
- decoder->set_msg_sink (this);
+ subscription_required = true;
+
+ // We are sending our identity now and the next message
+ // will come from the socket.
+ read_msg = &stream_engine_t::pull_msg_from_session;
+
+ // We are expecting identity message.
+ write_msg = &stream_engine_t::write_identity;
+ }
+ else
+ if (greeting_recv [revision_pos] == ZMTP_1_0) {
+ encoder = new (std::nothrow) v1_encoder_t (
+ out_batch_size);
+ alloc_assert (encoder);
+
+ decoder = new (std::nothrow) v1_decoder_t (
+ in_batch_size, options.maxmsgsize);
+ alloc_assert (decoder);
}
else
- if (greeting [version_pos] == 0) {
- // ZMTP/1.0 framing.
- encoder = new (std::nothrow) encoder_t (out_batch_size);
+ if (greeting_recv [revision_pos] == ZMTP_2_0) {
+ encoder = new (std::nothrow) v2_encoder_t (out_batch_size);
alloc_assert (encoder);
- encoder->set_msg_source (session);
- decoder = new (std::nothrow) decoder_t (in_batch_size, options.maxmsgsize);
+ decoder = new (std::nothrow) v2_decoder_t (
+ in_batch_size, options.maxmsgsize);
alloc_assert (decoder);
- decoder->set_msg_sink (session);
}
else {
- // v1 framing protocol.
- encoder = new (std::nothrow) v1_encoder_t (out_batch_size, session);
+ encoder = new (std::nothrow) v2_encoder_t (out_batch_size);
alloc_assert (encoder);
- decoder = new (std::nothrow)
- v1_decoder_t (in_batch_size, options.maxmsgsize, session);
+ decoder = new (std::nothrow) v2_decoder_t (
+ in_batch_size, options.maxmsgsize);
alloc_assert (decoder);
+
+ if (memcmp (greeting_recv + 12, "NULL\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 20) == 0) {
+ mechanism = new (std::nothrow)
+ null_mechanism_t (session, peer_address, options);
+ alloc_assert (mechanism);
+ }
+ else
+ if (memcmp (greeting_recv + 12, "PLAIN\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 20) == 0) {
+ mechanism = new (std::nothrow)
+ plain_mechanism_t (session, peer_address, options);
+ alloc_assert (mechanism);
+ }
+#ifdef HAVE_LIBSODIUM
+ else
+ if (memcmp (greeting_recv + 12, "CURVE\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 20) == 0) {
+ if (options.as_server)
+ mechanism = new (std::nothrow)
+ curve_server_t (session, peer_address, options);
+ else
+ mechanism = new (std::nothrow) curve_client_t (options);
+ alloc_assert (mechanism);
+ }
+#endif
+ else {
+ error ();
+ return false;
+ }
+ read_msg = &stream_engine_t::next_handshake_command;
+ write_msg = &stream_engine_t::process_handshake_command;
}
// Start polling for output if necessary.
return true;
}
-int zmq::stream_engine_t::push_msg (msg_t *msg_)
+int zmq::stream_engine_t::read_identity (msg_t *msg_)
{
- zmq_assert (options.type == ZMQ_PUB || options.type == ZMQ_XPUB);
-
- // The first message is identity.
- // Let the session process it.
- int rc = session->push_msg (msg_);
+ int rc = msg_->init_size (options.identity_size);
errno_assert (rc == 0);
+ if (options.identity_size > 0)
+ memcpy (msg_->data (), options.identity, options.identity_size);
+ read_msg = &stream_engine_t::pull_msg_from_session;
+ return 0;
+}
- // Inject the subscription message so that the ZMQ 2.x peer
- // receives our messages.
- rc = msg_->init_size (1);
- errno_assert (rc == 0);
- *(unsigned char*) msg_->data () = 1;
- rc = session->push_msg (msg_);
- session->flush ();
+int zmq::stream_engine_t::write_identity (msg_t *msg_)
+{
+ if (options.recv_identity) {
+ msg_->set_flags (msg_t::identity);
+ int rc = session->push_msg (msg_);
+ errno_assert (rc == 0);
+ }
+ else {
+ int rc = msg_->close ();
+ errno_assert (rc == 0);
+ rc = msg_->init ();
+ errno_assert (rc == 0);
+ }
- // Once we have injected the subscription message, we can
- // Divert the message flow back to the session.
- zmq_assert (decoder);
- decoder->set_msg_sink (session);
+ if (subscription_required)
+ write_msg = &stream_engine_t::write_subscription_msg;
+ else
+ write_msg = &stream_engine_t::push_msg_to_session;
+
+ return 0;
+}
+
+int zmq::stream_engine_t::next_handshake_command (msg_t *msg_)
+{
+ zmq_assert (mechanism != NULL);
+
+ const int rc = mechanism->next_handshake_command (msg_);
+ if (rc == 0) {
+ msg_->set_flags (msg_t::command);
+ if (mechanism->is_handshake_complete ())
+ mechanism_ready ();
+ }
+
+ return rc;
+}
+
+int zmq::stream_engine_t::process_handshake_command (msg_t *msg_)
+{
+ zmq_assert (mechanism != NULL);
+ const int rc = mechanism->process_handshake_command (msg_);
+ if (rc == 0) {
+ if (mechanism->is_handshake_complete ())
+ mechanism_ready ();
+ if (output_stopped)
+ restart_output ();
+ }
return rc;
}
+void zmq::stream_engine_t::zap_msg_available ()
+{
+ zmq_assert (mechanism != NULL);
+
+ const int rc = mechanism->zap_msg_available ();
+ if (rc == -1) {
+ error ();
+ return;
+ }
+ if (input_stopped)
+ restart_input ();
+ if (output_stopped)
+ restart_output ();
+}
+
+void zmq::stream_engine_t::mechanism_ready ()
+{
+ if (options.recv_identity) {
+ msg_t identity;
+ mechanism->peer_identity (&identity);
+ const int rc = session->push_msg (&identity);
+ if (rc == -1 && errno == EAGAIN) {
+ // If the write is failing at this stage with
+ // an EAGAIN the pipe must be being shut down,
+ // so we can just bail out of the identity set.
+ return;
+ }
+ errno_assert (rc == 0);
+ session->flush ();
+ }
+
+ read_msg = &stream_engine_t::pull_and_encode;
+ write_msg = &stream_engine_t::decode_and_push;
+}
+
+int zmq::stream_engine_t::pull_msg_from_session (msg_t *msg_)
+{
+ return session->pull_msg (msg_);
+}
+
+int zmq::stream_engine_t::push_msg_to_session (msg_t *msg_)
+{
+ return session->push_msg (msg_);
+}
+
+int zmq::stream_engine_t::pull_and_encode (msg_t *msg_)
+{
+ zmq_assert (mechanism != NULL);
+
+ if (session->pull_msg (msg_) == -1)
+ return -1;
+ if (mechanism->encode (msg_) == -1)
+ return -1;
+ return 0;
+}
+
+int zmq::stream_engine_t::decode_and_push (msg_t *msg_)
+{
+ zmq_assert (mechanism != NULL);
+
+ if (mechanism->decode (msg_) == -1)
+ return -1;
+ if (session->push_msg (msg_) == -1) {
+ if (errno == EAGAIN)
+ write_msg = &stream_engine_t::push_one_then_decode_and_push;
+ return -1;
+ }
+ return 0;
+}
+
+int zmq::stream_engine_t::push_one_then_decode_and_push (msg_t *msg_)
+{
+ const int rc = session->push_msg (msg_);
+ if (rc == 0)
+ write_msg = &stream_engine_t::decode_and_push;
+ return rc;
+}
+
+int zmq::stream_engine_t::write_subscription_msg (msg_t *msg_)
+{
+ msg_t subscription;
+
+ // Inject the subscription message, so that also
+ // ZMQ 2.x peers receive published messages.
+ int rc = subscription.init_size (1);
+ errno_assert (rc == 0);
+ *(unsigned char*) subscription.data () = 1;
+ rc = session->push_msg (&subscription);
+ if (rc == -1)
+ return -1;
+
+ write_msg = &stream_engine_t::push_msg_to_session;
+ return push_msg_to_session (msg_);
+}
+
void zmq::stream_engine_t::error ()
{
zmq_assert (session);
socket->event_disconnected (endpoint, s);
+ session->flush ();
session->detach ();
unplug ();
delete this;
// we'll get an error (this may happen during the speculative write).
if (nbytes == SOCKET_ERROR && WSAGetLastError () == WSAEWOULDBLOCK)
return 0;
-
+
// Signalise peer failure.
if (nbytes == SOCKET_ERROR && (
WSAGetLastError () == WSAENETDOWN ||
return -1;
}
- return (size_t) nbytes;
+ return static_cast <int> (nbytes);
#endif
}
{
#ifdef ZMQ_HAVE_WINDOWS
- int nbytes = recv (s, (char*) data_, (int) size_, 0);
+ const int rc = recv (s, (char*) data_, (int) size_, 0);
// If not a single byte can be read from the socket in non-blocking mode
// we'll get an error (this may happen during the speculative read).
- if (nbytes == SOCKET_ERROR && WSAGetLastError () == WSAEWOULDBLOCK)
- return 0;
-
- // Connection failure.
- if (nbytes == SOCKET_ERROR && (
- WSAGetLastError () == WSAENETDOWN ||
- WSAGetLastError () == WSAENETRESET ||
- WSAGetLastError () == WSAECONNABORTED ||
- WSAGetLastError () == WSAETIMEDOUT ||
- WSAGetLastError () == WSAECONNRESET ||
- WSAGetLastError () == WSAECONNREFUSED ||
- WSAGetLastError () == WSAENOTCONN))
- return -1;
-
- wsa_assert (nbytes != SOCKET_ERROR);
+ if (rc == SOCKET_ERROR) {
+ if (WSAGetLastError () == WSAEWOULDBLOCK)
+ errno = EAGAIN;
+ else {
+ wsa_assert (WSAGetLastError () == WSAENETDOWN
+ || WSAGetLastError () == WSAENETRESET
+ || WSAGetLastError () == WSAECONNABORTED
+ || WSAGetLastError () == WSAETIMEDOUT
+ || WSAGetLastError () == WSAECONNRESET
+ || WSAGetLastError () == WSAECONNREFUSED
+ || WSAGetLastError () == WSAENOTCONN);
+ errno = wsa_error_to_errno (WSAGetLastError ());
+ }
+ }
- // Orderly shutdown by the other peer.
- if (nbytes == 0)
- return -1;
-
- return nbytes;
+ return rc == SOCKET_ERROR? -1: rc;
#else
- ssize_t nbytes = recv (s, data_, size_, 0);
+ const ssize_t rc = recv (s, data_, size_, 0);
// Several errors are OK. When speculative read is being done we may not
// be able to read a single byte from the socket. Also, SIGSTOP issued
// by a debugging tool can result in EINTR error.
- if (nbytes == -1 && (errno == EAGAIN || errno == EWOULDBLOCK ||
- errno == EINTR))
- return 0;
-
- // Signalise peer failure.
- if (nbytes == -1) {
+ if (rc == -1) {
errno_assert (errno != EBADF
&& errno != EFAULT
&& errno != EINVAL
&& errno != ENOMEM
&& errno != ENOTSOCK);
- return -1;
+ if (errno == EWOULDBLOCK || errno == EINTR)
+ errno = EAGAIN;
}
- // Orderly shutdown by the peer.
- if (nbytes == 0)
- return -1;
-
- return (size_t) nbytes;
+ return static_cast <int> (rc);
#endif
}
-
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
#include "fd.hpp"
#include "i_engine.hpp"
-#include "i_msg_sink.hpp"
#include "io_object.hpp"
#include "i_encoder.hpp"
#include "i_decoder.hpp"
namespace zmq
{
+ // Protocol revisions
+ enum
+ {
+ ZMTP_1_0 = 0,
+ ZMTP_2_0 = 1
+ };
class io_thread_t;
+ class msg_t;
class session_base_t;
+ class mechanism_t;
// This engine handles any socket with SOCK_STREAM semantics,
// e.g. TCP socket or an UNIX domain socket.
- class stream_engine_t : public io_object_t, public i_engine, public i_msg_sink
+ class stream_engine_t : public io_object_t, public i_engine
{
public:
- stream_engine_t (fd_t fd_, const options_t &options_, const std::string &endpoint);
+ stream_engine_t (fd_t fd_, const options_t &options_,
+ const std::string &endpoint);
~stream_engine_t ();
// i_engine interface implementation.
void plug (zmq::io_thread_t *io_thread_,
zmq::session_base_t *session_);
void terminate ();
- void activate_in ();
- void activate_out ();
-
- // i_msg_sink interface implementation.
- virtual int push_msg (msg_t *msg_);
+ void restart_input ();
+ void restart_output ();
+ void zap_msg_available ();
// i_poll_events interface implementation.
void in_event ();
// of error or orderly shutdown by the other peer -1 is returned.
int write (const void *data_, size_t size_);
- // Reads data from the socket (up to 'size' bytes). Returns the number
- // of bytes actually read (even zero is to be considered to be
- // a success). In case of error or orderly shutdown by the other
- // peer -1 is returned.
+ // Reads data from the socket (up to 'size' bytes).
+ // Returns the number of bytes actually read or -1 on error.
+ // Zero indicates the peer has closed the connection.
int read (void *data_, size_t size_);
+ int read_identity (msg_t *msg_);
+ int write_identity (msg_t *msg_);
+
+ int next_handshake_command (msg_t *msg);
+ int process_handshake_command (msg_t *msg);
+
+ int pull_msg_from_session (msg_t *msg_);
+ int push_msg_to_session (msg_t *msg);
+
+ int pull_and_encode (msg_t *msg_);
+ int decode_and_push (msg_t *msg_);
+ int push_one_then_decode_and_push (msg_t *msg_);
+
+ void mechanism_ready ();
+
+ int write_subscription_msg (msg_t *msg_);
+
+ size_t add_property (unsigned char *ptr,
+ const char *name, const void *value, size_t value_len);
+
// Underlying socket.
fd_t s;
- // Size of the greeting message:
- // Preamble (10 bytes) + version (1 byte) + socket type (1 byte).
- const static size_t greeting_size = 12;
+ // True iff this is server's engine.
+ bool as_server;
- // True iff we are registered with an I/O poller.
- bool io_enabled;
+ msg_t tx_msg;
handle_t handle;
// version. When false, normal message flow has started.
bool handshaking;
- // The receive buffer holding the greeting message
- // that we are receiving from the peer.
- unsigned char greeting [greeting_size];
+ static const size_t signature_size = 10;
- // The number of bytes of the greeting message that
- // we have already received.
- unsigned int greeting_bytes_read;
+ // Size of ZMTP/1.0 and ZMTP/2.0 greeting message
+ static const size_t v2_greeting_size = 12;
+
+ // Size of ZMTP/3.0 greeting message
+ static const size_t v3_greeting_size = 64;
- // The send buffer holding the greeting message
- // that we are sending to the peer.
- unsigned char greeting_output_buffer [greeting_size];
+ // Expected greeting size.
+ size_t greeting_size;
+
+ // Greeting received from, and sent to peer
+ unsigned char greeting_recv [v3_greeting_size];
+ unsigned char greeting_send [v3_greeting_size];
+
+ // Size of greeting received so far
+ unsigned int greeting_bytes_read;
// The session this engine is attached to.
zmq::session_base_t *session;
bool plugged;
+ int (stream_engine_t::*read_msg) (msg_t *msg_);
+
+ int (stream_engine_t::*write_msg) (msg_t *msg_);
+
+ bool io_error;
+
+ // Indicates whether the engine is to inject a phantom
+ // subscription message into the incoming stream.
+ // Needed to support old peers.
+ bool subscription_required;
+
+ mechanism_t *mechanism;
+
+ // True iff the engine couldn't consume the last decoded message.
+ bool input_stopped;
+
+ // True iff the engine doesn't have any message to encode.
+ bool output_stopped;
+
// Socket
zmq::socket_base_t *socket;
+ std::string peer_address;
+
stream_engine_t (const stream_engine_t&);
const stream_engine_t &operator = (const stream_engine_t&);
};
/*
- Copyright (c) 2007-2012 iMatix Corporation
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
unsigned char *data = (unsigned char*) msg.data ();
if (option_ == ZMQ_SUBSCRIBE)
*data = 1;
- else if (option_ == ZMQ_UNSUBSCRIBE)
+ else
+ if (option_ == ZMQ_UNSUBSCRIBE)
*data = 0;
memcpy (data + 1, optval_, optvallen_);
// Pass it further on in the stack.
int err = 0;
- rc = xsub_t::xsend (&msg, 0);
+ rc = xsub_t::xsend (&msg);
if (rc != 0)
err = errno;
int rc2 = msg.close ();
return rc;
}
-int zmq::sub_t::xsend (msg_t *, int)
+int zmq::sub_t::xsend (msg_t *)
{
// Overload the XSUB's send.
errno = ENOTSUP;
// Overload the XSUB's send.
return false;
}
-
-zmq::sub_session_t::sub_session_t (io_thread_t *io_thread_, bool connect_,
- socket_base_t *socket_, const options_t &options_,
- const address_t *addr_) :
- xsub_session_t (io_thread_, connect_, socket_, options_, addr_)
-{
-}
-
-zmq::sub_session_t::~sub_session_t ()
-{
-}
-
/*
- Copyright (c) 2007-2012 iMatix Corporation
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
protected:
int xsetsockopt (int option_, const void *optval_, size_t optvallen_);
- int xsend (zmq::msg_t *msg_, int flags_);
+ int xsend (zmq::msg_t *msg_);
bool xhas_out ();
private:
const sub_t &operator = (const sub_t&);
};
- class sub_session_t : public xsub_session_t
- {
- public:
-
- sub_session_t (zmq::io_thread_t *io_thread_, bool connect_,
- zmq::socket_base_t *socket_, const options_t &options_,
- const address_t *addr_);
- ~sub_session_t ();
-
- private:
-
- sub_session_t (const sub_session_t&);
- const sub_session_t &operator = (const sub_session_t&);
- };
-
}
#endif
/*
- Copyright (c) 2010-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
#endif
}
+void zmq::set_tcp_send_buffer (fd_t sockfd_, int bufsize_)
+{
+ const int rc = setsockopt (sockfd_, SOL_SOCKET, SO_SNDBUF,
+ (char*) &bufsize_, sizeof bufsize_);
+#ifdef ZMQ_HAVE_WINDOWS
+ wsa_assert (rc != SOCKET_ERROR);
+#else
+ errno_assert (rc == 0);
+#endif
+}
+
+void zmq::set_tcp_receive_buffer (fd_t sockfd_, int bufsize_)
+{
+ const int rc = setsockopt (sockfd_, SOL_SOCKET, SO_RCVBUF,
+ (char*) &bufsize_, sizeof bufsize_);
+#ifdef ZMQ_HAVE_WINDOWS
+ wsa_assert (rc != SOCKET_ERROR);
+#else
+ errno_assert (rc == 0);
+#endif
+}
+
void zmq::tune_tcp_keepalives (fd_t s_, int keepalive_, int keepalive_cnt_, int keepalive_idle_, int keepalive_intvl_)
{
// These options are used only under certain #ifdefs below.
// Tuning TCP keep-alives if platform allows it
// All values = -1 means skip and leave it for OS
+#ifdef ZMQ_HAVE_WINDOWS
+ tcp_keepalive keepalive_opts;
+ keepalive_opts.onoff = keepalive_;
+ keepalive_opts.keepalivetime = keepalive_idle_ != -1 ? keepalive_idle_ * 1000 : 7200000;
+ keepalive_opts.keepaliveinterval = keepalive_intvl_ != -1 ? keepalive_intvl_ * 1000 : 1000;
+ DWORD num_bytes_returned;
+ int rc = WSAIoctl(s_, SIO_KEEPALIVE_VALS, &keepalive_opts, sizeof(keepalive_opts), NULL, 0, &num_bytes_returned, NULL, NULL);
+ wsa_assert (rc != SOCKET_ERROR);
+#else
#ifdef ZMQ_HAVE_SO_KEEPALIVE
if (keepalive_ != -1) {
int rc = setsockopt (s_, SOL_SOCKET, SO_KEEPALIVE, (char*) &keepalive_, sizeof (int));
-#ifdef ZMQ_HAVE_WINDOWS
- wsa_assert (rc != SOCKET_ERROR);
-#else
errno_assert (rc == 0);
-#endif
#ifdef ZMQ_HAVE_TCP_KEEPCNT
if (keepalive_cnt_ != -1) {
int rc = setsockopt (s_, IPPROTO_TCP, TCP_KEEPCNT, &keepalive_cnt_, sizeof (int));
-#ifdef ZMQ_HAVE_WINDOWS
- wsa_assert (rc != SOCKET_ERROR);
-#else
errno_assert (rc == 0);
-#endif
}
#endif // ZMQ_HAVE_TCP_KEEPCNT
#ifdef ZMQ_HAVE_TCP_KEEPIDLE
if (keepalive_idle_ != -1) {
int rc = setsockopt (s_, IPPROTO_TCP, TCP_KEEPIDLE, &keepalive_idle_, sizeof (int));
-#ifdef ZMQ_HAVE_WINDOWS
- wsa_assert (rc != SOCKET_ERROR);
-#else
errno_assert (rc == 0);
-#endif
}
#else // ZMQ_HAVE_TCP_KEEPIDLE
#ifdef ZMQ_HAVE_TCP_KEEPALIVE
if (keepalive_idle_ != -1) {
int rc = setsockopt (s_, IPPROTO_TCP, TCP_KEEPALIVE, &keepalive_idle_, sizeof (int));
-#ifdef ZMQ_HAVE_WINDOWS
- wsa_assert (rc != SOCKET_ERROR);
-#else
errno_assert (rc == 0);
-#endif
}
#endif // ZMQ_HAVE_TCP_KEEPALIVE
#endif // ZMQ_HAVE_TCP_KEEPIDLE
#ifdef ZMQ_HAVE_TCP_KEEPINTVL
if (keepalive_intvl_ != -1) {
int rc = setsockopt (s_, IPPROTO_TCP, TCP_KEEPINTVL, &keepalive_intvl_, sizeof (int));
-#ifdef ZMQ_HAVE_WINDOWS
- wsa_assert (rc != SOCKET_ERROR);
-#else
errno_assert (rc == 0);
-#endif
}
#endif // ZMQ_HAVE_TCP_KEEPINTVL
}
#endif // ZMQ_HAVE_SO_KEEPALIVE
+#endif // ZMQ_HAVE_WINDOWS
}
/*
- Copyright (c) 2010-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
// Tunes the supplied TCP socket for the best latency.
void tune_tcp_socket (fd_t s_);
+ // Sets the socket send buffer size.
+ void set_tcp_send_buffer (fd_t sockfd_, int bufsize_);
+
+ // Sets the socket receive buffer size.
+ void set_tcp_receive_buffer (fd_t sockfd_, int bufsize_);
+
// Tunes TCP keep-alives
void tune_tcp_keepalives (fd_t s_, int keepalive_, int keepalive_cnt_, int keepalive_idle_, int keepalive_intvl_);
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
#include <stdlib.h>
// On Solaris platform, network interface name can be queried by ioctl.
-int zmq::tcp_address_t::resolve_nic_name (const char *nic_, bool ipv4only_)
+int zmq::tcp_address_t::resolve_nic_name (const char *nic_, bool ipv6_)
{
// TODO: Unused parameter, IPv6 support not implemented for Solaris.
- (void) ipv4only_;
+ (void) ipv6_;
// Create a socket.
int fd = open_socket (AF_INET, SOCK_DGRAM, 0);
errno = ENODEV;
return -1;
}
-
return 0;
}
#include <sys/ioctl.h>
#include <net/if.h>
-int zmq::tcp_address_t::resolve_nic_name (const char *nic_, bool ipv4only_)
+int zmq::tcp_address_t::resolve_nic_name (const char *nic_, bool ipv6_)
{
// TODO: Unused parameter, IPv6 support not implemented for AIX or HP/UX.
- (void) ipv4only_;
+ (void) ipv6_;
// Create a socket.
int sd = open_socket (AF_INET, SOCK_DGRAM, 0);
errno = ENODEV;
return -1;
}
-
memcpy (&address.ipv4.sin_addr, &((sockaddr_in*) &ifr.ifr_addr)->sin_addr,
sizeof (in_addr));
// On these platforms, network interface name can be queried
// using getifaddrs function.
-int zmq::tcp_address_t::resolve_nic_name (const char *nic_, bool ipv4only_)
+int zmq::tcp_address_t::resolve_nic_name (const char *nic_, bool ipv6_)
{
// Get the addresses.
- ifaddrs* ifa = NULL;
+ ifaddrs *ifa = NULL;
int rc = getifaddrs (&ifa);
errno_assert (rc == 0);
zmq_assert (ifa != NULL);
continue;
int family = ifp->ifa_addr->sa_family;
-
- if ((family == AF_INET
- || (!ipv4only_ && family == AF_INET6))
- && !strcmp (nic_, ifp->ifa_name))
- {
+ if ((family == AF_INET || (ipv6_ && family == AF_INET6))
+ && !strcmp (nic_, ifp->ifa_name)) {
memcpy (&address, ifp->ifa_addr,
(family == AF_INET) ? sizeof (struct sockaddr_in)
: sizeof (struct sockaddr_in6));
errno = ENODEV;
return -1;
}
-
return 0;
}
// On other platforms we assume there are no sane interface names.
// This is true especially of Windows.
-int zmq::tcp_address_t::resolve_nic_name (const char *nic_, bool ipv4only_)
+int zmq::tcp_address_t::resolve_nic_name (const char *nic_, bool ipv6_)
{
// All unused parameters.
(void) nic_;
- (void) ipv4only_;
+ (void) ipv6_;
errno = ENODEV;
return -1;
#endif
-int zmq::tcp_address_t::resolve_interface (const char *interface_,
- bool ipv4only_)
+int zmq::tcp_address_t::resolve_interface (const char *interface_, bool ipv6_)
{
// Initialize temporary output pointers with storage address.
sockaddr_storage ss;
// Initialise IP-format family/port and populate temporary output pointers
// with the address.
- if (ipv4only_) {
- sockaddr_in ip4_addr;
- memset (&ip4_addr, 0, sizeof (ip4_addr));
- ip4_addr.sin_family = AF_INET;
- ip4_addr.sin_addr.s_addr = htonl (INADDR_ANY);
- out_addrlen = sizeof ip4_addr;
- memcpy (out_addr, &ip4_addr, out_addrlen);
- }
- else {
+ if (ipv6_) {
sockaddr_in6 ip6_addr;
memset (&ip6_addr, 0, sizeof (ip6_addr));
ip6_addr.sin6_family = AF_INET6;
out_addrlen = sizeof ip6_addr;
memcpy (out_addr, &ip6_addr, out_addrlen);
}
-
- // * resolves to INADDR_ANY or in6addr_any.
+ else {
+ sockaddr_in ip4_addr;
+ memset (&ip4_addr, 0, sizeof (ip4_addr));
+ ip4_addr.sin_family = AF_INET;
+ ip4_addr.sin_addr.s_addr = htonl (INADDR_ANY);
+ out_addrlen = sizeof ip4_addr;
+ memcpy (out_addr, &ip4_addr, out_addrlen);
+ }
+ // "*" resolves to INADDR_ANY or in6addr_any.
if (strcmp (interface_, "*") == 0) {
zmq_assert (out_addrlen <= sizeof address);
memcpy (&address, out_addr, out_addrlen);
}
// Try to resolve the string as a NIC name.
- int rc = resolve_nic_name (interface_, ipv4only_);
+ int rc = resolve_nic_name (interface_, ipv6_);
if (rc != 0 && errno != ENODEV)
return rc;
if (rc == 0)
// Choose IPv4 or IPv6 protocol family. Note that IPv6 allows for
// IPv4-in-IPv6 addresses.
- req.ai_family = ipv4only_ ? AF_INET : AF_INET6;
+ req.ai_family = ipv6_? AF_INET6: AF_INET;
// Arbitrary, not used in the output, but avoids duplicate results.
req.ai_socktype = SOCK_STREAM;
return 0;
}
-int zmq::tcp_address_t::resolve_hostname (const char *hostname_, bool ipv4only_)
+int zmq::tcp_address_t::resolve_hostname (const char *hostname_, bool ipv6_)
{
// Set up the query.
#if defined ZMQ_HAVE_OPENVMS && defined __ia64 && __INITIAL_POINTER_SIZE == 64
// Choose IPv4 or IPv6 protocol family. Note that IPv6 allows for
// IPv4-in-IPv6 addresses.
- req.ai_family = ipv4only_ ? AF_INET : AF_INET6;
+ req.ai_family = ipv6_? AF_INET6: AF_INET;
// Need to choose one to avoid duplicate results from getaddrinfo() - this
// doesn't really matter, since it's not included in the addr-output.
{
}
-int zmq::tcp_address_t::resolve (const char *name_, bool local_, bool ipv4only_)
+int zmq::tcp_address_t::resolve (const char *name_, bool local_, bool ipv6_)
{
// Find the ':' at end that separates address from the port number.
const char *delimiter = strrchr (name_, ':');
errno = EINVAL;
return -1;
}
-
// Separate the address/port.
std::string addr_str (name_, delimiter - name_);
std::string port_str (delimiter + 1);
addr_str [addr_str.size () - 1] == ']')
addr_str = addr_str.substr (1, addr_str.size () - 2);
- uint16_t port;
// Allow 0 specifically, to detect invalid port error in atoi if not
+ uint16_t port;
if (port_str == "*" || port_str == "0")
// Resolve wildcard to 0 to allow autoselection of port
port = 0;
// Resolve the IP address.
int rc;
if (local_)
- rc = resolve_interface (addr_str.c_str (), ipv4only_);
+ rc = resolve_interface (addr_str.c_str (), ipv6_);
else
- rc = resolve_hostname (addr_str.c_str (), ipv4only_);
+ rc = resolve_hostname (addr_str.c_str (), ipv6_);
if (rc != 0)
return -1;
int zmq::tcp_address_t::to_string (std::string &addr_)
{
- if (address.generic.sa_family != AF_INET && address.generic.sa_family != AF_INET6) {
+ if (address.generic.sa_family != AF_INET
+ && address.generic.sa_family != AF_INET6) {
addr_.clear ();
return -1;
}
return address_mask;
}
-int zmq::tcp_address_mask_t::resolve (const char *name_, bool ipv4only_)
+int zmq::tcp_address_mask_t::resolve (const char *name_, bool ipv6_)
{
// Find '/' at the end that separates address from the cidr mask number.
// Allow empty mask clause and threat it like '/32' for ipv4 or '/128' for ipv6.
return -1;
}
}
- else {
+ else
addr_str.assign (name_);
- }
// Parse address part using standard routines.
- int rc = tcp_address_t::resolve_hostname (addr_str.c_str (), ipv4only_);
+ int rc = tcp_address_t::resolve_hostname (addr_str.c_str (), ipv6_);
if (rc != 0)
return rc;
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
// This function translates textual TCP address into an address
// strcuture. If 'local' is true, names are resolved as local interface
// names. If it is false, names are resolved as remote hostnames.
- // If 'ipv4only' is true, the name will never resolve to IPv6 address.
- int resolve (const char* name_, bool local_, bool ipv4only_);
+ // If 'ipv6' is true, the name may resolve to IPv6 address.
+ int resolve (const char *name_, bool local_, bool ipv6_);
// The opposite to resolve()
virtual int to_string (std::string &addr_);
socklen_t addrlen () const;
protected:
-
- int resolve_nic_name (const char *nic_, bool ipv4only_);
- int resolve_interface (const char *interface_, bool ipv4only_);
- int resolve_hostname (const char *hostname_, bool ipv4only_);
+ int resolve_nic_name (const char *nic_, bool ipv6_);
+ int resolve_interface (const char *interface_, bool ipv6_);
+ int resolve_hostname (const char *hostname_, bool ipv6_);
union {
sockaddr generic;
class tcp_address_mask_t : public tcp_address_t
{
public:
-
tcp_address_mask_t ();
// This function enhances tcp_address_t::resolve() with ability to parse
// additional cidr-like(/xx) mask value at the end of the name string.
// Works only with remote hostnames.
- int resolve (const char* name_, bool ipv4only_);
+ int resolve (const char *name_, bool ipv6_);
// The opposite to resolve()
int to_string (std::string &addr_);
bool match_address (const struct sockaddr *ss, const socklen_t ss_len) const;
private:
-
int address_mask;
};
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
void zmq::tcp_connecter_t::in_event ()
{
- // We are not polling for incomming data, so we are actually called
+ // We are not polling for incoming data, so we are actually called
// because of error here. However, we can get error on out event as well
// on some platforms, so we'll simply handle both events in the same way.
out_event ();
tune_tcp_keepalives (fd, options.tcp_keepalive, options.tcp_keepalive_cnt, options.tcp_keepalive_idle, options.tcp_keepalive_intvl);
// Create the engine object for this connection.
- stream_engine_t *engine = new (std::nothrow) stream_engine_t (fd, options, endpoint);
+ stream_engine_t *engine = new (std::nothrow)
+ stream_engine_t (fd, options, endpoint);
alloc_assert (engine);
// Attach the engine to the corresponding session object.
// Set the socket to non-blocking mode so that we get async connect().
unblock_socket (s);
+ // Set the socket buffer limits for the underlying socket.
+ if (options.sndbuf != 0)
+ set_tcp_send_buffer (s, options.sndbuf);
+ if (options.rcvbuf != 0)
+ set_tcp_receive_buffer (s, options.rcvbuf);
+
// Connect to the remote peer.
int rc = ::connect (
s, addr->resolved.tcp_addr->addr (),
zmq::fd_t zmq::tcp_connecter_t::connect ()
{
- // Async connect have finished. Check whether an error occured.
+ // Async connect has finished. Check whether an error occurred
int err = 0;
#if defined ZMQ_HAVE_HPUX
int len = sizeof (err);
#ifdef ZMQ_HAVE_WINDOWS
zmq_assert (rc == 0);
if (err != 0) {
- if (err == WSAECONNREFUSED || err == WSAETIMEDOUT ||
- err == WSAECONNABORTED || err == WSAEHOSTUNREACH ||
- err == WSAENETUNREACH || err == WSAENETDOWN)
+ if (err == WSAECONNREFUSED ||
+ err == WSAETIMEDOUT ||
+ err == WSAECONNABORTED ||
+ err == WSAEHOSTUNREACH ||
+ err == WSAENETUNREACH ||
+ err == WSAENETDOWN ||
+ err == WSAEINVAL)
return retired_fd;
wsa_assert_no (err);
}
err = errno;
if (err != 0) {
errno = err;
- errno_assert (errno == ECONNREFUSED || errno == ECONNRESET ||
- errno == ETIMEDOUT || errno == EHOSTUNREACH ||
- errno == ENETUNREACH || errno == ENETDOWN);
+ errno_assert (
+ errno == ECONNREFUSED ||
+ errno == ECONNRESET ||
+ errno == ETIMEDOUT ||
+ errno == EHOSTUNREACH ||
+ errno == ENETUNREACH ||
+ errno == ENETDOWN ||
+ errno == EINVAL);
return retired_fd;
}
#endif
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2010 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
tune_tcp_keepalives (fd, options.tcp_keepalive, options.tcp_keepalive_cnt, options.tcp_keepalive_idle, options.tcp_keepalive_intvl);
// Create the engine object for this connection.
- stream_engine_t *engine = new (std::nothrow) stream_engine_t (fd, options, endpoint);
+ stream_engine_t *engine = new (std::nothrow)
+ stream_engine_t (fd, options, endpoint);
alloc_assert (engine);
// Choose I/O thread to run connecter in. Given that we are already
int zmq::tcp_listener_t::set_address (const char *addr_)
{
// Convert the textual address into address structure.
- int rc = address.resolve (addr_, true, options.ipv4only ? true : false);
+ int rc = address.resolve (addr_, true, options.ipv6);
if (rc != 0)
return -1;
#endif
// IPv6 address family not supported, try automatic downgrade to IPv4.
- if (address.family () == AF_INET6 && errno == EAFNOSUPPORT &&
- !options.ipv4only) {
+ if (address.family () == AF_INET6
+ && errno == EAFNOSUPPORT
+ && options.ipv6) {
rc = address.resolve (addr_, true, true);
if (rc != 0)
return rc;
errno = wsa_error_to_errno (WSAGetLastError ());
return -1;
}
+#if !defined _WIN32_WCE
// On Windows, preventing sockets to be inherited by child processes.
BOOL brc = SetHandleInformation ((HANDLE) s, HANDLE_FLAG_INHERIT, 0);
win_assert (brc);
+#endif
#else
if (s == -1)
return -1;
if (address.family () == AF_INET6)
enable_ipv4_mapping (s);
+ // Set the socket buffer limits for the underlying socket.
+ if (options.sndbuf != 0)
+ set_tcp_send_buffer (s, options.sndbuf);
+ if (options.rcvbuf != 0)
+ set_tcp_receive_buffer (s, options.rcvbuf);
+
// Allow reusing of the address.
int flag = 1;
#ifdef ZMQ_HAVE_WINDOWS
// Accept one connection and deal with different failure modes.
zmq_assert (s != retired_fd);
- struct sockaddr_storage ss = {};
+ struct sockaddr_storage ss;
+ memset (&ss, 0, sizeof (ss));
#ifdef ZMQ_HAVE_HPUX
int ss_len = sizeof (ss);
#else
WSAGetLastError () == WSAENOBUFS);
return retired_fd;
}
+#if !defined _WIN32_WCE
// On Windows, preventing sockets to be inherited by child processes.
BOOL brc = SetHandleInformation ((HANDLE) sock, HANDLE_FLAG_INHERIT, 0);
win_assert (brc);
+#endif
#else
if (sock == -1) {
errno_assert (errno == EAGAIN || errno == EWOULDBLOCK ||
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2010 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
/*
- Copyright (c) 2010-2011 250bpm s.r.o.
- Copyright (c) 2007-2011 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
{
tfn = tfn_;
arg =arg_;
-#if defined WINCE
+#if defined _WIN32_WCE
descriptor = (HANDLE) CreateThread (NULL, 0,
&::thread_routine, this, 0 , NULL);
#else
/*
- Copyright (c) 2010-2011 250bpm s.r.o.
- Copyright (c) 2007-2011 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2011-2012 Spotify AB
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
delete next.node;
next.node = 0;
}
- else if (count > 1) {
+ else
+ if (count > 1) {
for (unsigned short i = 0; i != count; ++i)
- if (next.table [i])
- delete next.table [i];
+ delete next.table [i];
free (next.table);
}
}
count = 1;
next.node = NULL;
}
- else if (count == 1) {
+ else
+ if (count == 1) {
unsigned char oldc = min;
trie_t *oldp = next.node;
count = (min < c ? c - min : min - c) + 1;
min = std::min (min, c);
next.table [oldc - min] = oldp;
}
- else if (min < c) {
-
+ else
+ if (min < c) {
// The new character is above the current character range.
unsigned short old_count = count;
count = c - min + 1;
bool zmq::trie_t::rm (unsigned char *prefix_, size_t size_)
{
- // TODO: Shouldn't an error be reported if the key does not exist?
-
- if (!size_) {
- if (!refcnt)
- return false;
- refcnt--;
- return refcnt == 0;
- }
-
- unsigned char c = *prefix_;
- if (!count || c < min || c >= min + count)
- return false;
-
- trie_t *next_node =
- count == 1 ? next.node : next.table [c - min];
-
- if (!next_node)
- return false;
-
- bool ret = next_node->rm (prefix_ + 1, size_ - 1);
-
- // Prune redundant nodes
- if (next_node->is_redundant ()) {
- delete next_node;
- zmq_assert (count > 0);
-
- if (count == 1) {
- // The just pruned node is was the only live node
- next.node = 0;
- count = 0;
- --live_nodes;
- zmq_assert (live_nodes == 0);
- }
- else {
- next.table [c - min] = 0;
- zmq_assert (live_nodes > 1);
- --live_nodes;
-
- // Compact the table if possible
- if (live_nodes == 1) {
- // We can switch to using the more compact single-node
- // representation since the table only contains one live node
- trie_t *node = 0;
- // Since we always compact the table the pruned node must
- // either be the left-most or right-most ptr in the node
- // table
- if (c == min) {
- // The pruned node is the left-most node ptr in the
- // node table => keep the right-most node
- node = next.table [count - 1];
- min += count - 1;
- }
- else if (c == min + count - 1) {
- // The pruned node is the right-most node ptr in the
- // node table => keep the left-most node
- node = next.table [0];
- }
-
- zmq_assert (node);
- free (next.table);
- next.node = node;
- count = 1;
- }
- else if (c == min) {
- // We can compact the table "from the left".
- // Find the left-most non-null node ptr, which we'll use as
- // our new min
- unsigned char new_min = min;
- for (unsigned short i = 1; i < count; ++i) {
- if (next.table [i]) {
- new_min = i + min;
- break;
- }
- }
- zmq_assert (new_min != min);
-
- trie_t **old_table = next.table;
- zmq_assert (new_min > min);
- zmq_assert (count > new_min - min);
-
- count = count - (new_min - min);
- next.table = (trie_t**) malloc (sizeof (trie_t*) * count);
- alloc_assert (next.table);
-
- memmove (next.table, old_table + (new_min - min),
- sizeof (trie_t*) * count);
- free (old_table);
-
- min = new_min;
- }
- else if (c == min + count - 1) {
- // We can compact the table "from the right".
- // Find the right-most non-null node ptr, which we'll use to
- // determine the new table size
- unsigned short new_count = count;
- for (unsigned short i = 1; i < count; ++i) {
- if (next.table [count - 1 - i]) {
- new_count = count - i;
- break;
- }
- }
- zmq_assert (new_count != count);
- count = new_count;
-
- trie_t **old_table = next.table;
- next.table = (trie_t**) malloc (sizeof (trie_t*) * count);
- alloc_assert (next.table);
-
- memmove (next.table, old_table, sizeof (trie_t*) * count);
- free (old_table);
- }
- }
- }
-
- return ret;
+ // TODO: Shouldn't an error be reported if the key does not exist?
+ if (!size_) {
+ if (!refcnt)
+ return false;
+ refcnt--;
+ return refcnt == 0;
+ }
+ unsigned char c = *prefix_;
+ if (!count || c < min || c >= min + count)
+ return false;
+
+ trie_t *next_node =
+ count == 1 ? next.node : next.table [c - min];
+
+ if (!next_node)
+ return false;
+
+ bool ret = next_node->rm (prefix_ + 1, size_ - 1);
+
+ // Prune redundant nodes
+ if (next_node->is_redundant ()) {
+ delete next_node;
+ zmq_assert (count > 0);
+
+ if (count == 1) {
+ // The just pruned node is was the only live node
+ next.node = 0;
+ count = 0;
+ --live_nodes;
+ zmq_assert (live_nodes == 0);
+ }
+ else {
+ next.table [c - min] = 0;
+ zmq_assert (live_nodes > 1);
+ --live_nodes;
+
+ // Compact the table if possible
+ if (live_nodes == 1) {
+ // We can switch to using the more compact single-node
+ // representation since the table only contains one live node
+ trie_t *node = 0;
+ // Since we always compact the table the pruned node must
+ // either be the left-most or right-most ptr in the node
+ // table
+ if (c == min) {
+ // The pruned node is the left-most node ptr in the
+ // node table => keep the right-most node
+ node = next.table [count - 1];
+ min += count - 1;
+ }
+ else
+ if (c == min + count - 1) {
+ // The pruned node is the right-most node ptr in the
+ // node table => keep the left-most node
+ node = next.table [0];
+ }
+ zmq_assert (node);
+ free (next.table);
+ next.node = node;
+ count = 1;
+ }
+ else
+ if (c == min) {
+ // We can compact the table "from the left".
+ // Find the left-most non-null node ptr, which we'll use as
+ // our new min
+ unsigned char new_min = min;
+ for (unsigned short i = 1; i < count; ++i) {
+ if (next.table [i]) {
+ new_min = i + min;
+ break;
+ }
+ }
+ zmq_assert (new_min != min);
+
+ trie_t **old_table = next.table;
+ zmq_assert (new_min > min);
+ zmq_assert (count > new_min - min);
+
+ count = count - (new_min - min);
+ next.table = (trie_t**) malloc (sizeof (trie_t*) * count);
+ alloc_assert (next.table);
+
+ memmove (next.table, old_table + (new_min - min),
+ sizeof (trie_t*) * count);
+ free (old_table);
+
+ min = new_min;
+ }
+ else
+ if (c == min + count - 1) {
+ // We can compact the table "from the right".
+ // Find the right-most non-null node ptr, which we'll use to
+ // determine the new table size
+ unsigned short new_count = count;
+ for (unsigned short i = 1; i < count; ++i) {
+ if (next.table [count - 1 - i]) {
+ new_count = count - i;
+ break;
+ }
+ }
+ zmq_assert (new_count != count);
+ count = new_count;
+
+ trie_t **old_table = next.table;
+ next.table = (trie_t**) malloc (sizeof (trie_t*) * count);
+ alloc_assert (next.table);
+
+ memmove (next.table, old_table, sizeof (trie_t*) * count);
+ free (old_table);
+ }
+ }
+ }
+ return ret;
}
bool zmq::trie_t::check (unsigned char *data_, size_t size_)
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2011-2012 Spotify AB
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
#include <stdlib.h>
#include <string.h>
+#include <limits>
#include "platform.hpp"
-#ifdef ZMQ_HAVE_WINDOWS
+#if defined ZMQ_HAVE_WINDOWS
#include "windows.hpp"
#endif
-#include "v1_protocol.hpp"
+#include "decoder.hpp"
#include "v1_decoder.hpp"
#include "likely.hpp"
#include "wire.hpp"
#include "err.hpp"
-zmq::v1_decoder_t::v1_decoder_t (size_t bufsize_,
- int64_t maxmsgsize_, i_msg_sink *msg_sink_) :
+zmq::v1_decoder_t::v1_decoder_t (size_t bufsize_, int64_t maxmsgsize_) :
decoder_base_t <v1_decoder_t> (bufsize_),
- msg_sink (msg_sink_),
- msg_flags (0),
maxmsgsize (maxmsgsize_)
{
int rc = in_progress.init ();
errno_assert (rc == 0);
- // At the beginning, read one byte and go to flags_ready state.
- next_step (tmpbuf, 1, &v1_decoder_t::flags_ready);
+ // At the beginning, read one byte and go to one_byte_size_ready state.
+ next_step (tmpbuf, 1, &v1_decoder_t::one_byte_size_ready);
}
zmq::v1_decoder_t::~v1_decoder_t ()
errno_assert (rc == 0);
}
-void zmq::v1_decoder_t::set_msg_sink (i_msg_sink *msg_sink_)
-{
- msg_sink = msg_sink_;
-}
-
-bool zmq::v1_decoder_t::flags_ready ()
+int zmq::v1_decoder_t::one_byte_size_ready ()
{
- msg_flags = 0;
- if (tmpbuf [0] & v1_protocol_t::more_flag)
- msg_flags |= msg_t::more;
-
- // The payload length is either one or eight bytes,
- // depending on whether the 'large' bit is set.
- if (tmpbuf [0] & v1_protocol_t::large_flag)
+ // First byte of size is read. If it is 0xff read 8-byte size.
+ // Otherwise allocate the buffer for message data and read the
+ // message data into it.
+ if (*tmpbuf == 0xff)
next_step (tmpbuf, 8, &v1_decoder_t::eight_byte_size_ready);
- else
- next_step (tmpbuf, 1, &v1_decoder_t::one_byte_size_ready);
-
- return true;
+ else {
+
+ // There has to be at least one byte (the flags) in the message).
+ if (!*tmpbuf) {
+ errno = EPROTO;
+ return -1;
+ }
+
+ if (maxmsgsize >= 0 && (int64_t) (*tmpbuf - 1) > maxmsgsize) {
+ errno = EMSGSIZE;
+ return -1;
+ }
+
+ // in_progress is initialised at this point so in theory we should
+ // close it before calling zmq_msg_init_size, however, it's a 0-byte
+ // message and thus we can treat it as uninitialised...
+ int rc = in_progress.init_size (*tmpbuf - 1);
+ if (rc != 0) {
+ errno_assert (errno == ENOMEM);
+ rc = in_progress.init ();
+ errno_assert (rc == 0);
+ errno = ENOMEM;
+ return -1;
+ }
+
+ next_step (tmpbuf, 1, &v1_decoder_t::flags_ready);
+ }
+ return 0;
}
-bool zmq::v1_decoder_t::one_byte_size_ready ()
+int zmq::v1_decoder_t::eight_byte_size_ready ()
{
- int rc = 0;
+ // 8-byte payload length is read. Allocate the buffer
+ // for message body and read the message data into it.
+ const uint64_t payload_length = get_uint64 (tmpbuf);
+
+ // There has to be at least one byte (the flags) in the message).
+ if (payload_length == 0) {
+ errno = EPROTO;
+ return -1;
+ }
// Message size must not exceed the maximum allowed size.
- if (maxmsgsize >= 0)
- if (unlikely (tmpbuf [0] > static_cast <uint64_t> (maxmsgsize)))
- goto error;
+ if (maxmsgsize >= 0 && payload_length - 1 > (uint64_t) maxmsgsize) {
+ errno = EMSGSIZE;
+ return -1;
+ }
+
+ // Message size must fit within range of size_t data type.
+ if (payload_length - 1 > std::numeric_limits <size_t>::max ()) {
+ errno = EMSGSIZE;
+ return -1;
+ }
+
+ const size_t msg_size = static_cast <size_t> (payload_length - 1);
// in_progress is initialised at this point so in theory we should
- // close it before calling zmq_msg_init_size, however, it's a 0-byte
+ // close it before calling init_size, however, it's a 0-byte
// message and thus we can treat it as uninitialised...
- rc = in_progress.init_size (tmpbuf [0]);
- if (unlikely (rc)) {
+ int rc = in_progress.init_size (msg_size);
+ if (rc != 0) {
errno_assert (errno == ENOMEM);
- int rc = in_progress.init ();
+ rc = in_progress.init ();
errno_assert (rc == 0);
- goto error;
+ errno = ENOMEM;
+ return -1;
}
- in_progress.set_flags (msg_flags);
- next_step (in_progress.data (), in_progress.size (),
- &v1_decoder_t::message_ready);
-
- return true;
-
-error:
- decoding_error ();
- return false;
+ next_step (tmpbuf, 1, &v1_decoder_t::flags_ready);
+ return 0;
}
-bool zmq::v1_decoder_t::eight_byte_size_ready ()
+int zmq::v1_decoder_t::flags_ready ()
{
- int rc = 0;
-
- // The payload size is encoded as 64-bit unsigned integer.
- // The most significant byte comes first.
- const uint64_t msg_size = get_uint64 (tmpbuf);
-
- // Message size must not exceed the maximum allowed size.
- if (maxmsgsize >= 0)
- if (unlikely (msg_size > static_cast <uint64_t> (maxmsgsize)))
- goto error;
-
- // Message size must fit into size_t data type.
- if (unlikely (msg_size != static_cast <size_t> (msg_size)))
- goto error;
-
- // in_progress is initialised at this point so in theory we should
- // close it before calling init_size, however, it's a 0-byte
- // message and thus we can treat it as uninitialised.
- rc = in_progress.init_size (static_cast <size_t> (msg_size));
- if (unlikely (rc)) {
- errno_assert (errno == ENOMEM);
- int rc = in_progress.init ();
- errno_assert (rc == 0);
- goto error;
- }
+ // Store the flags from the wire into the message structure.
+ in_progress.set_flags (tmpbuf [0] & msg_t::more);
- in_progress.set_flags (msg_flags);
next_step (in_progress.data (), in_progress.size (),
&v1_decoder_t::message_ready);
- return true;
-
-error:
- decoding_error ();
- return false;
+ return 0;
}
-bool zmq::v1_decoder_t::message_ready ()
+int zmq::v1_decoder_t::message_ready ()
{
// Message is completely read. Push it further and start reading
// new message. (in_progress is a 0-byte message after this point.)
- if (unlikely (!msg_sink))
- return false;
- int rc = msg_sink->push_msg (&in_progress);
- if (unlikely (rc != 0)) {
- if (errno != EAGAIN)
- decoding_error ();
- return false;
- }
-
- next_step (tmpbuf, 1, &v1_decoder_t::flags_ready);
- return true;
+ next_step (tmpbuf, 1, &v1_decoder_t::one_byte_size_ready);
+ return 1;
}
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2012 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
#ifndef __ZMQ_V1_DECODER_HPP_INCLUDED__
#define __ZMQ_V1_DECODER_HPP_INCLUDED__
-#include "err.hpp"
-#include "msg.hpp"
#include "decoder.hpp"
-#include "i_msg_sink.hpp"
-#include "stdint.hpp"
namespace zmq
{
-
- // Decoder for 0MQ v1 framing protocol. Converts data stream into messages.
+ // Decoder for ZMTP/1.0 protocol. Converts data batches into messages.
class v1_decoder_t : public decoder_base_t <v1_decoder_t>
{
public:
- v1_decoder_t (size_t bufsize_,
- int64_t maxmsgsize_, i_msg_sink *msg_sink_);
- virtual ~v1_decoder_t ();
+ v1_decoder_t (size_t bufsize_, int64_t maxmsgsize_);
+ ~v1_decoder_t ();
- // i_decoder interface.
- virtual void set_msg_sink (i_msg_sink *msg_sink_);
+ virtual msg_t *msg () { return &in_progress; }
private:
- bool flags_ready ();
- bool one_byte_size_ready ();
- bool eight_byte_size_ready ();
- bool message_ready ();
+ int one_byte_size_ready ();
+ int eight_byte_size_ready ();
+ int flags_ready ();
+ int message_ready ();
- i_msg_sink *msg_sink;
unsigned char tmpbuf [8];
- unsigned char msg_flags;
msg_t in_progress;
- const int64_t maxmsgsize;
+ int64_t maxmsgsize;
v1_decoder_t (const v1_decoder_t&);
void operator = (const v1_decoder_t&);
/*
- Copyright (c) 2007-2012 iMatix Corporation
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2011 VMware, Inc.
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "v1_protocol.hpp"
+#include "encoder.hpp"
#include "v1_encoder.hpp"
#include "likely.hpp"
#include "wire.hpp"
-zmq::v1_encoder_t::v1_encoder_t (size_t bufsize_, i_msg_source *msg_source_) :
- encoder_base_t <v1_encoder_t> (bufsize_),
- msg_source (msg_source_)
+zmq::v1_encoder_t::v1_encoder_t (size_t bufsize_) :
+ encoder_base_t <v1_encoder_t> (bufsize_)
{
- int rc = in_progress.init ();
- errno_assert (rc == 0);
-
// Write 0 bytes to the batch and go to message_ready state.
next_step (NULL, 0, &v1_encoder_t::message_ready, true);
}
zmq::v1_encoder_t::~v1_encoder_t ()
{
- int rc = in_progress.close ();
- errno_assert (rc == 0);
}
-void zmq::v1_encoder_t::set_msg_source (i_msg_source *msg_source_)
+void zmq::v1_encoder_t::size_ready ()
{
- msg_source = msg_source_;
+ // Write message body into the buffer.
+ next_step (in_progress->data (), in_progress->size (),
+ &v1_encoder_t::message_ready, true);
}
-bool zmq::v1_encoder_t::message_ready ()
+void zmq::v1_encoder_t::message_ready ()
{
- // Release the content of the old message.
- int rc = in_progress.close ();
- errno_assert (rc == 0);
+ // Get the message size.
+ size_t size = in_progress->size ();
- // Read new message. If there is none, return false.
- // Note that new state is set only if write is successful. That way
- // unsuccessful write will cause retry on the next state machine
- // invocation.
- if (unlikely (!msg_source)) {
- rc = in_progress.init ();
- errno_assert (rc == 0);
- return false;
- }
+ // Account for the 'flags' byte.
+ size++;
- rc = msg_source->pull_msg (&in_progress);
- if (unlikely (rc)) {
- errno_assert (errno == EAGAIN);
- rc = in_progress.init ();
- errno_assert (rc == 0);
- return false;
- }
-
- // Encode flags.
- unsigned char &protocol_flags = tmpbuf [0];
- protocol_flags = 0;
- if (in_progress.flags () & msg_t::more)
- protocol_flags |= v1_protocol_t::more_flag;
- if (in_progress.size () > 255)
- protocol_flags |= v1_protocol_t::large_flag;
-
- // Encode the message length. For messages less then 256 bytes,
- // the length is encoded as 8-bit unsigned integer. For larger
- // messages, 64-bit unsigned integer in network byte order is used.
- const size_t size = in_progress.size ();
- if (unlikely (size > 255)) {
- put_uint64 (tmpbuf + 1, size);
- next_step (tmpbuf, 9, &v1_encoder_t::size_ready, false);
+ // For messages less than 255 bytes long, write one byte of message size.
+ // For longer messages write 0xff escape character followed by 8-byte
+ // message size. In both cases 'flags' field follows.
+ if (size < 255) {
+ tmpbuf [0] = (unsigned char) size;
+ tmpbuf [1] = (in_progress->flags () & msg_t::more);
+ next_step (tmpbuf, 2, &v1_encoder_t::size_ready, false);
}
else {
- tmpbuf [1] = static_cast <uint8_t> (size);
- next_step (tmpbuf, 2, &v1_encoder_t::size_ready, false);
+ tmpbuf [0] = 0xff;
+ put_uint64 (tmpbuf + 1, size);
+ tmpbuf [9] = (in_progress->flags () & msg_t::more);
+ next_step (tmpbuf, 10, &v1_encoder_t::size_ready, false);
}
- return true;
-}
-
-bool zmq::v1_encoder_t::size_ready ()
-{
- // Write message body into the buffer.
- next_step (in_progress.data (), in_progress.size (),
- &v1_encoder_t::message_ready, !(in_progress.flags () & msg_t::more));
- return true;
}
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2012 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
#ifndef __ZMQ_V1_ENCODER_HPP_INCLUDED__
#define __ZMQ_V1_ENCODER_HPP_INCLUDED__
-#include "msg.hpp"
-#include "i_msg_source.hpp"
#include "encoder.hpp"
namespace zmq
{
-
- class i_msg_source;
-
- // Encoder for 0MQ framing protocol. Converts messages into data stream.
+ // Encoder for ZMTP/1.0 protocol. Converts messages into data batches.
class v1_encoder_t : public encoder_base_t <v1_encoder_t>
{
public:
- v1_encoder_t (size_t bufsize_, i_msg_source *msg_source_);
- virtual ~v1_encoder_t ();
-
- virtual void set_msg_source (i_msg_source *msg_source_);
+ v1_encoder_t (size_t bufsize_);
+ ~v1_encoder_t ();
private:
- bool size_ready ();
- bool message_ready ();
+ void size_ready ();
+ void message_ready ();
- i_msg_source *msg_source;
- msg_t in_progress;
- unsigned char tmpbuf [9];
+ unsigned char tmpbuf [10];
v1_encoder_t (const v1_encoder_t&);
const v1_encoder_t &operator = (const v1_encoder_t&);
+++ /dev/null
-/*
- Copyright (c) 2007-2012 iMatix Corporation
- Copyright (c) 2007-2012 Other contributors as noted in the AUTHORS file
-
- This file is part of 0MQ.
-
- 0MQ is free software; you can redistribute it and/or modify it under
- the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- 0MQ is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef __ZMQ_V1_PROTOCOL_HPP_INCLUDED__
-#define __ZMQ_V1_PROTOCOL_HPP_INCLUDED__
-
-namespace zmq
-{
-
- // Definition of constans for v1 transport protocol.
- class v1_protocol_t
- {
- public:
- // Message flags.
- enum
- {
- more_flag = 1,
- large_flag = 2
- };
-
- };
-
-}
-
-#endif
-
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "platform.hpp"
+#ifdef ZMQ_HAVE_WINDOWS
+#include "windows.hpp"
+#endif
+
+#include "v2_protocol.hpp"
+#include "v2_decoder.hpp"
+#include "likely.hpp"
+#include "wire.hpp"
+#include "err.hpp"
+
+zmq::v2_decoder_t::v2_decoder_t (size_t bufsize_, int64_t maxmsgsize_) :
+ decoder_base_t <v2_decoder_t> (bufsize_),
+ msg_flags (0),
+ maxmsgsize (maxmsgsize_)
+{
+ int rc = in_progress.init ();
+ errno_assert (rc == 0);
+
+ // At the beginning, read one byte and go to flags_ready state.
+ next_step (tmpbuf, 1, &v2_decoder_t::flags_ready);
+}
+
+zmq::v2_decoder_t::~v2_decoder_t ()
+{
+ int rc = in_progress.close ();
+ errno_assert (rc == 0);
+}
+
+int zmq::v2_decoder_t::flags_ready ()
+{
+ msg_flags = 0;
+ if (tmpbuf [0] & v2_protocol_t::more_flag)
+ msg_flags |= msg_t::more;
+ if (tmpbuf [0] & v2_protocol_t::command_flag)
+ msg_flags |= msg_t::command;
+
+ // The payload length is either one or eight bytes,
+ // depending on whether the 'large' bit is set.
+ if (tmpbuf [0] & v2_protocol_t::large_flag)
+ next_step (tmpbuf, 8, &v2_decoder_t::eight_byte_size_ready);
+ else
+ next_step (tmpbuf, 1, &v2_decoder_t::one_byte_size_ready);
+
+ return 0;
+}
+
+int zmq::v2_decoder_t::one_byte_size_ready ()
+{
+ // Message size must not exceed the maximum allowed size.
+ if (maxmsgsize >= 0)
+ if (unlikely (tmpbuf [0] > static_cast <uint64_t> (maxmsgsize))) {
+ errno = EMSGSIZE;
+ return -1;
+ }
+
+ // in_progress is initialised at this point so in theory we should
+ // close it before calling zmq_msg_init_size, however, it's a 0-byte
+ // message and thus we can treat it as uninitialised...
+ int rc = in_progress.init_size (tmpbuf [0]);
+ if (unlikely (rc)) {
+ errno_assert (errno == ENOMEM);
+ rc = in_progress.init ();
+ errno_assert (rc == 0);
+ errno = ENOMEM;
+ return -1;
+ }
+
+ in_progress.set_flags (msg_flags);
+ next_step (in_progress.data (), in_progress.size (),
+ &v2_decoder_t::message_ready);
+
+ return 0;
+}
+
+int zmq::v2_decoder_t::eight_byte_size_ready ()
+{
+ // The payload size is encoded as 64-bit unsigned integer.
+ // The most significant byte comes first.
+ const uint64_t msg_size = get_uint64 (tmpbuf);
+
+ // Message size must not exceed the maximum allowed size.
+ if (maxmsgsize >= 0)
+ if (unlikely (msg_size > static_cast <uint64_t> (maxmsgsize))) {
+ errno = EMSGSIZE;
+ return -1;
+ }
+
+ // Message size must fit into size_t data type.
+ if (unlikely (msg_size != static_cast <size_t> (msg_size))) {
+ errno = EMSGSIZE;
+ return -1;
+ }
+
+ // in_progress is initialised at this point so in theory we should
+ // close it before calling init_size, however, it's a 0-byte
+ // message and thus we can treat it as uninitialised.
+ int rc = in_progress.init_size (static_cast <size_t> (msg_size));
+ if (unlikely (rc)) {
+ errno_assert (errno == ENOMEM);
+ rc = in_progress.init ();
+ errno_assert (rc == 0);
+ errno = ENOMEM;
+ return -1;
+ }
+
+ in_progress.set_flags (msg_flags);
+ next_step (in_progress.data (), in_progress.size (),
+ &v2_decoder_t::message_ready);
+
+ return 0;
+}
+
+int zmq::v2_decoder_t::message_ready ()
+{
+ // Message is completely read. Signal this to the caller
+ // and prepare to decode next message.
+ next_step (tmpbuf, 1, &v2_decoder_t::flags_ready);
+ return 1;
+}
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __ZMQ_V2_DECODER_HPP_INCLUDED__
+#define __ZMQ_V2_DECODER_HPP_INCLUDED__
+
+#include "decoder.hpp"
+
+namespace zmq
+{
+ // Decoder for ZMTP/2.x framing protocol. Converts data stream into messages.
+ class v2_decoder_t : public decoder_base_t <v2_decoder_t>
+ {
+ public:
+
+ v2_decoder_t (size_t bufsize_, int64_t maxmsgsize_);
+ virtual ~v2_decoder_t ();
+
+ // i_decoder interface.
+ virtual msg_t *msg () { return &in_progress; }
+
+ private:
+
+ int flags_ready ();
+ int one_byte_size_ready ();
+ int eight_byte_size_ready ();
+ int message_ready ();
+
+ unsigned char tmpbuf [8];
+ unsigned char msg_flags;
+ msg_t in_progress;
+
+ const int64_t maxmsgsize;
+
+ v2_decoder_t (const v2_decoder_t&);
+ void operator = (const v2_decoder_t&);
+ };
+
+}
+
+#endif
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "v2_protocol.hpp"
+#include "v2_encoder.hpp"
+#include "likely.hpp"
+#include "wire.hpp"
+
+zmq::v2_encoder_t::v2_encoder_t (size_t bufsize_) :
+ encoder_base_t <v2_encoder_t> (bufsize_)
+{
+ // Write 0 bytes to the batch and go to message_ready state.
+ next_step (NULL, 0, &v2_encoder_t::message_ready, true);
+}
+
+zmq::v2_encoder_t::~v2_encoder_t ()
+{
+}
+
+void zmq::v2_encoder_t::message_ready ()
+{
+ // Encode flags.
+ unsigned char &protocol_flags = tmpbuf [0];
+ protocol_flags = 0;
+ if (in_progress->flags () & msg_t::more)
+ protocol_flags |= v2_protocol_t::more_flag;
+ if (in_progress->size () > 255)
+ protocol_flags |= v2_protocol_t::large_flag;
+ if (in_progress->flags () & msg_t::command)
+ protocol_flags |= v2_protocol_t::command_flag;
+
+ // Encode the message length. For messages less then 256 bytes,
+ // the length is encoded as 8-bit unsigned integer. For larger
+ // messages, 64-bit unsigned integer in network byte order is used.
+ const size_t size = in_progress->size ();
+ if (unlikely (size > 255)) {
+ put_uint64 (tmpbuf + 1, size);
+ next_step (tmpbuf, 9, &v2_encoder_t::size_ready, false);
+ }
+ else {
+ tmpbuf [1] = static_cast <uint8_t> (size);
+ next_step (tmpbuf, 2, &v2_encoder_t::size_ready, false);
+ }
+}
+
+void zmq::v2_encoder_t::size_ready ()
+{
+ // Write message body into the buffer.
+ next_step (in_progress->data (), in_progress->size (),
+ &v2_encoder_t::message_ready, true);
+}
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __ZMQ_V2_ENCODER_HPP_INCLUDED__
+#define __ZMQ_V2_ENCODER_HPP_INCLUDED__
+
+#include "encoder.hpp"
+
+namespace zmq
+{
+ // Encoder for 0MQ framing protocol. Converts messages into data stream.
+
+ class v2_encoder_t : public encoder_base_t <v2_encoder_t>
+ {
+ public:
+
+ v2_encoder_t (size_t bufsize_);
+ virtual ~v2_encoder_t ();
+
+ private:
+
+ void size_ready ();
+ void message_ready ();
+
+ unsigned char tmpbuf [9];
+
+ v2_encoder_t (const v2_encoder_t&);
+ const v2_encoder_t &operator = (const v2_encoder_t&);
+ };
+}
+
+#endif
+
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __ZMQ_V2_PROTOCOL_HPP_INCLUDED__
+#define __ZMQ_V2_PROTOCOL_HPP_INCLUDED__
+
+namespace zmq
+{
+ // Definition of constants for ZMTP/2.0 transport protocol.
+ class v2_protocol_t
+ {
+ public:
+ // Message flags.
+ enum
+ {
+ more_flag = 1,
+ large_flag = 2,
+ command_flag = 4
+ };
+ };
+}
+
+#endif
/*
- Copyright (c) 2010-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
#include <winsock2.h>
#include <mswsock.h>
+#include <Mstcpip.h>
#include <ws2tcpip.h>
#include <ipexport.h>
-#if !defined WINCE
+#if !defined _WIN32_WCE
#include <process.h>
#endif
/*
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
*buffer_ = value;
}
- inline uint8_t get_uint8 (unsigned char *buffer_)
+ inline uint8_t get_uint8 (const unsigned char *buffer_)
{
return *buffer_;
}
buffer_ [1] = (unsigned char) (value & 0xff);
}
- inline uint16_t get_uint16 (unsigned char *buffer_)
+ inline uint16_t get_uint16 (const unsigned char *buffer_)
{
return
(((uint16_t) buffer_ [0]) << 8) |
buffer_ [3] = (unsigned char) (value & 0xff);
}
- inline uint32_t get_uint32 (unsigned char *buffer_)
+ inline uint32_t get_uint32 (const unsigned char *buffer_)
{
return
(((uint32_t) buffer_ [0]) << 24) |
buffer_ [7] = (unsigned char) (value & 0xff);
}
- inline uint64_t get_uint64 (unsigned char *buffer_)
+ inline uint64_t get_uint64 (const unsigned char *buffer_)
{
return
(((uint64_t) buffer_ [0]) << 56) |
/*
- Copyright (c) 2010-2011 250bpm s.r.o.
- Copyright (c) 2011 VMware, Inc.
- Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
{
}
-void zmq::xpub_t::xattach_pipe (pipe_t *pipe_, bool icanhasall_)
+void zmq::xpub_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_)
{
zmq_assert (pipe_);
dist.attach (pipe_);
- // If icanhasall_ is specified, the caller would like to subscribe
+ // If subscribe_to_all_ is specified, the caller would like to subscribe
// to all data on this pipe, implicitly.
- if (icanhasall_)
+ if (subscribe_to_all_)
subscriptions.add (NULL, 0, pipe_);
// The pipe is active when attached. Let's read the subscriptions from
// There are some subscriptions waiting. Let's process them.
msg_t sub;
while (pipe_->read (&sub)) {
-
- // Apply the subscription to the trie.
- unsigned char *const data = (unsigned char*) sub.data ();
+ // Apply the subscription to the trie
+ unsigned char *const data = (unsigned char *) sub.data ();
const size_t size = sub.size ();
if (size > 0 && (*data == 0 || *data == 1)) {
bool unique;
// If the subscription is not a duplicate store it so that it can be
// passed to used on next recv call. (Unsubscribe is not verbose.)
- if (options.type == ZMQ_XPUB && (unique || (*data && verbose)))
- pending.push_back (blob_t (data, size));
+ if (options.type == ZMQ_XPUB && (unique || (*data && verbose))) {
+ pending_data.push_back (blob_t (data, size));
+ pending_flags.push_back (0);
+ }
+ }
+ else {
+ // Process user message coming upstream from xsub socket
+ pending_data.push_back (blob_t (data, size));
+ pending_flags.push_back (sub.flags ());
}
-
sub.close ();
}
}
errno = EINVAL;
return -1;
}
- verbose = *static_cast <const int*> (optval_);
+ verbose = (*static_cast <const int*> (optval_) != 0);
return 0;
}
-void zmq::xpub_t::xterminated (pipe_t *pipe_)
+void zmq::xpub_t::xpipe_terminated (pipe_t *pipe_)
{
// Remove the pipe from the trie. If there are topics that nobody
// is interested in anymore, send corresponding unsubscriptions
// upstream.
subscriptions.rm (pipe_, send_unsubscription, this);
- dist.terminated (pipe_);
+ dist.pipe_terminated (pipe_);
}
void zmq::xpub_t::mark_as_matching (pipe_t *pipe_, void *arg_)
self->dist.match (pipe_);
}
-int zmq::xpub_t::xsend (msg_t *msg_, int flags_)
+int zmq::xpub_t::xsend (msg_t *msg_)
{
bool msg_more = msg_->flags () & msg_t::more ? true : false;
// Send the message to all the pipes that were marked as matching
// in the previous step.
- int rc = dist.send_to_matching (msg_, flags_);
+ int rc = dist.send_to_matching (msg_);
if (rc != 0)
return rc;
return dist.has_out ();
}
-int zmq::xpub_t::xrecv (msg_t *msg_, int flags_)
+int zmq::xpub_t::xrecv (msg_t *msg_)
{
- // flags_ is unused
- (void)flags_;
-
// If there is at least one
- if (pending.empty ()) {
+ if (pending_data.empty ()) {
errno = EAGAIN;
return -1;
}
int rc = msg_->close ();
errno_assert (rc == 0);
- rc = msg_->init_size (pending.front ().size ());
+ rc = msg_->init_size (pending_data.front ().size ());
errno_assert (rc == 0);
- memcpy (msg_->data (), pending.front ().data (),
- pending.front ().size ());
- pending.pop_front ();
+ memcpy (msg_->data (),
+ pending_data.front ().data (),
+ pending_data.front ().size ());
+ msg_->set_flags (pending_flags.front ());
+ pending_data.pop_front ();
+ pending_flags.pop_front ();
return 0;
}
bool zmq::xpub_t::xhas_in ()
{
- return !pending.empty ();
+ return !pending_data.empty ();
}
void zmq::xpub_t::send_unsubscription (unsigned char *data_, size_t size_,
xpub_t *self = (xpub_t*) arg_;
if (self->options.type != ZMQ_PUB) {
-
- // Place the unsubscription to the queue of pending (un)sunscriptions
- // to be retrived by the user later on.
- blob_t unsub (size_ + 1, 0);
- unsub [0] = 0;
- memcpy (&unsub [1], data_, size_);
- self->pending.push_back (unsub);
+ // Place the unsubscription to the queue of pending (un)sunscriptions
+ // to be retrived by the user later on.
+ blob_t unsub (size_ + 1, 0);
+ unsub [0] = 0;
+ memcpy (&unsub [1], data_, size_);
+ self->pending_data.push_back (unsub);
+ self->pending_flags.push_back (0);
}
}
-
-zmq::xpub_session_t::xpub_session_t (io_thread_t *io_thread_, bool connect_,
- socket_base_t *socket_, const options_t &options_,
- const address_t *addr_) :
- session_base_t (io_thread_, connect_, socket_, options_, addr_)
-{
-}
-
-zmq::xpub_session_t::~xpub_session_t ()
-{
-}
-
/*
- Copyright (c) 2010-2011 250bpm s.r.o.
- Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
~xpub_t ();
// Implementations of virtual functions from socket_base_t.
- void xattach_pipe (zmq::pipe_t *pipe_, bool icanhasall_ = false);
- int xsend (zmq::msg_t *msg_, int flags_);
+ void xattach_pipe (zmq::pipe_t *pipe_, bool subscribe_to_all_ = false);
+ int xsend (zmq::msg_t *msg_);
bool xhas_out ();
- int xrecv (zmq::msg_t *msg_, int flags_);
+ int xrecv (zmq::msg_t *msg_);
bool xhas_in ();
void xread_activated (zmq::pipe_t *pipe_);
void xwrite_activated (zmq::pipe_t *pipe_);
int xsetsockopt (int option_, const void *optval_, size_t optvallen_);
- void xterminated (zmq::pipe_t *pipe_);
+ void xpipe_terminated (zmq::pipe_t *pipe_);
private:
// List of pending (un)subscriptions, ie. those that were already
// applied to the trie, but not yet received by the user.
typedef std::basic_string <unsigned char> blob_t;
- typedef std::deque <blob_t> pending_t;
- pending_t pending;
+ std::deque <blob_t> pending_data;
+ std::deque <unsigned char> pending_flags;
xpub_t (const xpub_t&);
const xpub_t &operator = (const xpub_t&);
};
- class xpub_session_t : public session_base_t
- {
- public:
-
- xpub_session_t (zmq::io_thread_t *io_thread_, bool connect_,
- socket_base_t *socket_, const options_t &options_,
- const address_t *addr_);
- ~xpub_session_t ();
-
- private:
-
- xpub_session_t (const xpub_session_t&);
- const xpub_session_t &operator = (const xpub_session_t&);
- };
-
}
#endif
/*
- Copyright (c) 2010-2011 250bpm s.r.o.
- Copyright (c) 2011 VMware, Inc.
- Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
errno_assert (rc == 0);
}
-void zmq::xsub_t::xattach_pipe (pipe_t *pipe_, bool icanhasall_)
+void zmq::xsub_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_)
{
- // icanhasall_ is unused
- (void)icanhasall_;
+ // subscribe_to_all_ is unused
+ (void) subscribe_to_all_;
zmq_assert (pipe_);
fq.attach (pipe_);
dist.activated (pipe_);
}
-void zmq::xsub_t::xterminated (pipe_t *pipe_)
+void zmq::xsub_t::xpipe_terminated (pipe_t *pipe_)
{
- fq.terminated (pipe_);
- dist.terminated (pipe_);
+ fq.pipe_terminated (pipe_);
+ dist.pipe_terminated (pipe_);
}
void zmq::xsub_t::xhiccuped (pipe_t *pipe_)
pipe_->flush ();
}
-int zmq::xsub_t::xsend (msg_t *msg_, int flags_)
+int zmq::xsub_t::xsend (msg_t *msg_)
{
size_t size = msg_->size ();
- unsigned char *data = (unsigned char*) msg_->data ();
-
- // Malformed subscriptions.
- if (size < 1 || (*data != 0 && *data != 1)) {
- errno = EINVAL;
- return -1;
- }
-
- // Process the subscription.
- if (*data == 1) {
- if (subscriptions.add (data + 1, size - 1))
- return dist.send_to_all (msg_, flags_);
+ unsigned char *data = (unsigned char *) msg_->data ();
+
+ if (size > 0 && *data == 1) {
+ // Process subscribe message
+ // This used to filter out duplicate subscriptions,
+ // however this is alread done on the XPUB side and
+ // doing it here as well breaks ZMQ_XPUB_VERBOSE
+ // when there are forwarding devices involved.
+ subscriptions.add (data + 1, size - 1);
+ return dist.send_to_all (msg_);
}
- else {
+ else
+ if (size > 0 && *data == 0) {
+ // Process unsubscribe message
if (subscriptions.rm (data + 1, size - 1))
- return dist.send_to_all (msg_, flags_);
+ return dist.send_to_all (msg_);
}
+ else
+ // User message sent upstream to XPUB socket
+ return dist.send_to_all (msg_);
int rc = msg_->close ();
errno_assert (rc == 0);
return true;
}
-int zmq::xsub_t::xrecv (msg_t *msg_, int flags_)
+int zmq::xsub_t::xrecv (msg_t *msg_)
{
- // flags_ is unused
- (void)flags_;
-
// If there's already a message prepared by a previous call to zmq_poll,
// return it straight ahead.
if (has_message) {
if (!sent)
msg.close ();
}
-
-zmq::xsub_session_t::xsub_session_t (io_thread_t *io_thread_, bool connect_,
- socket_base_t *socket_, const options_t &options_,
- const address_t *addr_) :
- session_base_t (io_thread_, connect_, socket_, options_, addr_)
-{
-}
-
-zmq::xsub_session_t::~xsub_session_t ()
-{
-}
-
/*
- Copyright (c) 2010-2011 250bpm s.r.o.
- Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
protected:
// Overloads of functions from socket_base_t.
- void xattach_pipe (zmq::pipe_t *pipe_, bool icanhasall_);
- int xsend (zmq::msg_t *msg_, int flags_);
+ void xattach_pipe (zmq::pipe_t *pipe_, bool subscribe_to_all_);
+ int xsend (zmq::msg_t *msg_);
bool xhas_out ();
- int xrecv (zmq::msg_t *msg_, int flags_);
+ int xrecv (zmq::msg_t *msg_);
bool xhas_in ();
void xread_activated (zmq::pipe_t *pipe_);
void xwrite_activated (zmq::pipe_t *pipe_);
void xhiccuped (pipe_t *pipe_);
- void xterminated (zmq::pipe_t *pipe_);
+ void xpipe_terminated (zmq::pipe_t *pipe_);
private:
const xsub_t &operator = (const xsub_t&);
};
- class xsub_session_t : public session_base_t
- {
- public:
-
- xsub_session_t (class io_thread_t *io_thread_, bool connect_,
- socket_base_t *socket_, const options_t &options_,
- const address_t *addr_);
- ~xsub_session_t ();
-
- private:
-
- xsub_session_t (const xsub_session_t&);
- const xsub_session_t &operator = (const xsub_session_t&);
- };
-
}
#endif
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
#include "atomic_ptr.hpp"
#include "yqueue.hpp"
#include "platform.hpp"
+#include "ypipe_base.hpp"
namespace zmq
{
// N is granularity of the pipe, i.e. how many items are needed to
// perform next memory allocation.
- template <typename T, int N> class ypipe_t
+ template <typename T, int N> class ypipe_t : public ypipe_base_t<T,N>
{
public:
--- /dev/null
+
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __ZMQ_YPIPE_BASE_HPP_INCLUDED__
+#define __ZMQ_YPIPE_BASE_HPP_INCLUDED__
+
+
+namespace zmq
+{
+ // ypipe_base abstracts ypipe and ypipe_conflate specific
+ // classes, one is selected according to a the conflate
+ // socket option
+
+ template <typename T, int N> class ypipe_base_t
+ {
+ public:
+ virtual ~ypipe_base_t () {}
+ virtual void write (const T &value_, bool incomplete_) = 0;
+ virtual bool unwrite (T *value_) = 0;
+ virtual bool flush () = 0;
+ virtual bool check_read () = 0;
+ virtual bool read (T *value_) = 0;
+ virtual bool probe (bool (*fn)(T &)) = 0;
+ };
+}
+
+#endif
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __ZMQ_YPIPE_CONFLATE_HPP_INCLUDED__
+#define __ZMQ_YPIPE_CONFLATE_HPP_INCLUDED__
+
+#include "platform.hpp"
+#include "dbuffer.hpp"
+#include "ypipe_base.hpp"
+
+namespace zmq
+{
+
+ // Adapter for dbuffer, to plug it in instead of a queue for the sake
+ // of implementing the conflate socket option, which, if set, makes
+ // the receiving side to discard all incoming messages but the last one.
+ //
+ // reader_awake flag is needed here to mimic ypipe delicate behaviour
+ // around the reader being asleep (see 'c' pointer being NULL in ypipe.hpp)
+
+ template <typename T, int N> class ypipe_conflate_t : public ypipe_base_t<T,N>
+ {
+ public:
+
+ // Initialises the pipe.
+ inline ypipe_conflate_t ()
+ : reader_awake(false)
+ {
+ }
+
+ // The destructor doesn't have to be virtual. It is mad virtual
+ // just to keep ICC and code checking tools from complaining.
+ inline virtual ~ypipe_conflate_t ()
+ {
+ }
+
+ // Following function (write) deliberately copies uninitialised data
+ // when used with zmq_msg. Initialising the VSM body for
+ // non-VSM messages won't be good for performance.
+
+#ifdef ZMQ_HAVE_OPENVMS
+#pragma message save
+#pragma message disable(UNINIT)
+#endif
+ inline void write (const T &value_, bool incomplete_)
+ {
+ (void)incomplete_;
+
+ dbuffer.write (value_);
+ }
+
+#ifdef ZMQ_HAVE_OPENVMS
+#pragma message restore
+#endif
+
+ // There are no incomplete items for conflate ypipe
+ inline bool unwrite (T *value_)
+ {
+ return false;
+ }
+
+ // Flush is no-op for conflate ypipe. Reader asleep behaviour
+ // is as of the usual ypipe.
+ // Returns false if the reader thread is sleeping. In that case,
+ // caller is obliged to wake the reader up before using the pipe again.
+ inline bool flush ()
+ {
+ return reader_awake;
+ }
+
+ // Check whether item is available for reading.
+ inline bool check_read ()
+ {
+ bool res = dbuffer.check_read ();
+ if (!res)
+ reader_awake = false;
+
+ return res;
+ }
+
+ // Reads an item from the pipe. Returns false if there is no value.
+ // available.
+ inline bool read (T *value_)
+ {
+ if (!check_read ())
+ return false;
+
+ return dbuffer.read (value_);
+ }
+
+ // Applies the function fn to the first elemenent in the pipe
+ // and returns the value returned by the fn.
+ // The pipe mustn't be empty or the function crashes.
+ inline bool probe (bool (*fn)(T &))
+ {
+ return dbuffer.probe (fn);
+ }
+
+ protected:
+
+ dbuffer_t <T> dbuffer;
+ bool reader_awake;
+
+ // Disable copying of ypipe object.
+ ypipe_conflate_t (const ypipe_conflate_t&);
+ const ypipe_conflate_t &operator = (const ypipe_conflate_t&);
+ };
+
+}
+
+#endif
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
}
chunk_t *sc = spare_chunk.xchg (NULL);
- if (sc)
- free (sc);
+ free (sc);
}
// Returns reference to the front element of the queue.
// so for cache reasons we'll get rid of the spare and
// use 'o' as the spare.
chunk_t *cs = spare_chunk.xchg (o);
- if (cs)
- free (cs);
+ free (cs);
}
}
/*
- Copyright (c) 2007-2012 iMatix Corporation
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
// XSI vector I/O
-#if ZMQ_HAVE_UIO
+#if defined ZMQ_HAVE_UIO
#include <sys/uio.h>
#else
struct iovec {
return zmq::errno_to_string (errnum_);
}
-int zmq_errno ()
+int zmq_errno (void)
{
return errno;
}
return ctx;
}
-int zmq_ctx_destroy (void *ctx_)
+int zmq_ctx_term (void *ctx_)
{
if (!ctx_ || !((zmq::ctx_t*) ctx_)->check_tag ()) {
errno = EFAULT;
return rc;
}
+int zmq_ctx_shutdown (void *ctx_)
+{
+ if (!ctx_ || !((zmq::ctx_t*) ctx_)->check_tag ()) {
+ errno = EFAULT;
+ return -1;
+ }
+
+ return ((zmq::ctx_t*) ctx_)->shutdown ();
+}
+
int zmq_ctx_set (void *ctx_, int option_, int optval_)
{
if (!ctx_ || !((zmq::ctx_t*) ctx_)->check_tag ()) {
int zmq_term (void *ctx_)
{
- return zmq_ctx_destroy (ctx_);
+ return zmq_ctx_term (ctx_);
+}
+
+int zmq_ctx_destroy (void *ctx_)
+{
+ return zmq_ctx_term (ctx_);
}
return rc;
}
+int zmq_send_const (void *s_, const void *buf_, size_t len_, int flags_)
+{
+ if (!s_ || !((zmq::socket_base_t*) s_)->check_tag ()) {
+ errno = ENOTSOCK;
+ return -1;
+ }
+ zmq_msg_t msg;
+ int rc = zmq_msg_init_data (&msg, (void*)buf_, len_, NULL, NULL);
+ if (rc != 0)
+ return -1;
+
+ zmq::socket_base_t *s = (zmq::socket_base_t *) s_;
+ rc = s_sendmsg (s, &msg, flags_);
+ if (unlikely (rc < 0)) {
+ int err = errno;
+ int rc2 = zmq_msg_close (&msg);
+ errno_assert (rc2 == 0);
+ errno = err;
+ return -1;
+ }
+
+ // Note the optimisation here. We don't close the msg object as it is
+ // empty anyway. This may change when implementation of zmq_msg_t changes.
+ return rc;
+}
+
+
// Send multiple messages.
+// TODO: this function has no man page
//
// If flag bit ZMQ_SNDMORE is set the vector is treated as
// a single multi-part message, i.e. the last message has
//
// The iov_base* buffers of each iovec *a_ filled in by this
// function may be freed using free().
-//
-// Implementation note: We assume zmq::msg_t buffer allocated
-// by zmq::recvmsg can be freed by free().
-// We assume it is safe to steal these buffers by simply
-// not closing the zmq::msg_t.
+// TODO: this function has no man page
//
int zmq_recviov (void *s_, iovec *a_, size_t *count_, int flags_)
{
*count_ = 0;
for (size_t i = 0; recvmore && i < count; ++i) {
- // Cheat! We never close any msg
- // because we want to steal the buffer.
+
zmq_msg_t msg;
int rc = zmq_msg_init (&msg);
errno_assert (rc == 0);
nread = -1;
break;
}
- ++*count_;
- ++nread;
- // Cheat: acquire zmq_msg buffer.
- a_[i].iov_base = static_cast<char *> (zmq_msg_data (&msg));
a_[i].iov_len = zmq_msg_size (&msg);
-
+ a_[i].iov_base = malloc(a_[i].iov_len);
+ if (unlikely (!a_[i].iov_base)) {
+ errno = ENOMEM;
+ return -1;
+ }
+ memcpy(a_[i].iov_base,static_cast<char *> (zmq_msg_data (&msg)),
+ a_[i].iov_len);
// Assume zmq_socket ZMQ_RVCMORE is properly set.
recvmore = ((zmq::msg_t*) (void *) &msg)->flags () & zmq::msg_t::more;
+ rc = zmq_msg_close(&msg);
+ errno_assert (rc == 0);
+ ++*count_;
+ ++nread;
}
return nread;
}
zmq::clock_t clock;
uint64_t now = 0;
uint64_t end = 0;
+ pollfd spollfds[ZMQ_POLLITEMS_DFLT];
+ pollfd *pollfds = spollfds;
- pollfd *pollfds = (pollfd*) malloc (nitems_ * sizeof (pollfd));
- alloc_assert (pollfds);
+ if (nitems_ > ZMQ_POLLITEMS_DFLT) {
+ pollfds = (pollfd*) malloc (nitems_ * sizeof (pollfd));
+ alloc_assert (pollfds);
+ }
// Build pollset for poll () system call.
for (int i = 0; i != nitems_; i++) {
size_t zmq_fd_size = sizeof (zmq::fd_t);
if (zmq_getsockopt (items_ [i].socket, ZMQ_FD, &pollfds [i].fd,
&zmq_fd_size) == -1) {
- free (pollfds);
+ if (pollfds != spollfds)
+ free (pollfds);
return -1;
}
pollfds [i].events = items_ [i].events ? POLLIN : 0;
while (true) {
int rc = poll (pollfds, nitems_, timeout);
if (rc == -1 && errno == EINTR) {
- free (pollfds);
+ if (pollfds != spollfds)
+ free (pollfds);
return -1;
}
errno_assert (rc >= 0);
uint32_t zmq_events;
if (zmq_getsockopt (items_ [i].socket, ZMQ_EVENTS, &zmq_events,
&zmq_events_size) == -1) {
- free (pollfds);
+ if (pollfds != spollfds)
+ free (pollfds);
return -1;
}
if ((items_ [i].events & ZMQ_POLLOUT) &&
break;
}
- free (pollfds);
+ if (pollfds != spollfds)
+ free (pollfds);
return nevents;
#elif defined ZMQ_POLL_BASED_ON_SELECT
// The deprecated device functionality
-int zmq_device (int type, void *frontend_, void *backend_)
+int zmq_device (int /* type */, void *frontend_, void *backend_)
{
return zmq::proxy (
(zmq::socket_base_t*) frontend_,
(zmq::socket_base_t*) backend_, NULL);
}
-
-// Callback to free socket event data
-
-void zmq_free_event (void *event_data, void *hint)
-{
- zmq_event_t *event = (zmq_event_t *) event_data;
-
- switch (event->event) {
- case ZMQ_EVENT_CONNECTED:
- free (event->data.connected.addr);
- break;
- case ZMQ_EVENT_CONNECT_DELAYED:
- free (event->data.connect_delayed.addr);
- break;
- case ZMQ_EVENT_CONNECT_RETRIED:
- free (event->data.connect_retried.addr);
- break;
- case ZMQ_EVENT_LISTENING:
- free (event->data.listening.addr);
- break;
- case ZMQ_EVENT_BIND_FAILED:
- free (event->data.bind_failed.addr);
- break;
- case ZMQ_EVENT_ACCEPTED:
- free (event->data.accepted.addr);
- break;
- case ZMQ_EVENT_ACCEPT_FAILED:
- free (event->data.accept_failed.addr);
- break;
- case ZMQ_EVENT_CLOSED:
- free (event->data.closed.addr);
- break;
- case ZMQ_EVENT_CLOSE_FAILED:
- free (event->data.close_failed.addr);
- break;
- case ZMQ_EVENT_DISCONNECTED:
- free (event->data.disconnected.addr);
- break;
- }
- free (event_data);
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// 0MQ utils - to be used by perf tests
-////////////////////////////////////////////////////////////////////////////////
-
-void zmq_sleep (int seconds_)
-{
-#if defined ZMQ_HAVE_WINDOWS
- Sleep (seconds_ * 1000);
-#else
- sleep (seconds_);
-#endif
-}
-
-void *zmq_stopwatch_start ()
-{
- uint64_t *watch = (uint64_t*) malloc (sizeof (uint64_t));
- alloc_assert (watch);
- *watch = zmq::clock_t::now_us ();
- return (void*) watch;
-}
-
-unsigned long zmq_stopwatch_stop (void *watch_)
-{
- uint64_t end = zmq::clock_t::now_us ();
- uint64_t start = *(uint64_t*) watch_;
- free (watch_);
- return (unsigned long) (end - start);
-}
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2009 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
#include "platform.hpp"
-#include "../include/zmq_utils.h"
-
-#include <stdlib.h>
-
-#include "stdint.hpp"
#include "clock.hpp"
#include "err.hpp"
+#include "thread.hpp"
+#include <assert.h>
+#include "../include/zmq_utils.h"
#if !defined ZMQ_HAVE_WINDOWS
#include <unistd.h>
#else
#include "windows.hpp"
#endif
+#ifdef HAVE_LIBSODIUM
+# include <sodium.h>
+#endif
+
void zmq_sleep (int seconds_)
{
free (watch_);
return (unsigned long) (end - start);
}
+
+void *zmq_threadstart(zmq_thread_fn* func, void* arg)
+{
+ zmq::thread_t* thread = new zmq::thread_t;
+ thread->start(func, arg);
+ return thread;
+}
+
+void zmq_threadclose(void* thread)
+{
+ zmq::thread_t* pThread = static_cast<zmq::thread_t*>(thread);
+ pThread->stop();
+ delete pThread;
+}
+
+// Z85 codec, taken from 0MQ RFC project, implements RFC32 Z85 encoding
+
+// Maps base 256 to base 85
+static char encoder [85 + 1] = {
+ "0123456789" "abcdefghij" "klmnopqrst" "uvwxyzABCD"
+ "EFGHIJKLMN" "OPQRSTUVWX" "YZ.-:+=^!/" "*?&<>()[]{"
+ "}@%$#"
+};
+
+// Maps base 85 to base 256
+// We chop off lower 32 and higher 128 ranges
+static uint8_t decoder [96] = {
+ 0x00, 0x44, 0x00, 0x54, 0x53, 0x52, 0x48, 0x00,
+ 0x4B, 0x4C, 0x46, 0x41, 0x00, 0x3F, 0x3E, 0x45,
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x40, 0x00, 0x49, 0x42, 0x4A, 0x47,
+ 0x51, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A,
+ 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32,
+ 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A,
+ 0x3B, 0x3C, 0x3D, 0x4D, 0x00, 0x4E, 0x43, 0x00,
+ 0x00, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10,
+ 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
+ 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20,
+ 0x21, 0x22, 0x23, 0x4F, 0x00, 0x50, 0x00, 0x00
+};
+
+// --------------------------------------------------------------------------
+// Encode a binary frame as a string; destination string MUST be at least
+// size * 5 / 4 bytes long plus 1 byte for the null terminator. Returns
+// dest. Size must be a multiple of 4.
+// Returns NULL and sets errno = EINVAL for invalid input.
+
+char *zmq_z85_encode (char *dest, uint8_t *data, size_t size)
+{
+ if (size % 4 != 0) {
+ errno = EINVAL;
+ return NULL;
+ }
+ unsigned int char_nbr = 0;
+ unsigned int byte_nbr = 0;
+ uint32_t value = 0;
+ while (byte_nbr < size) {
+ // Accumulate value in base 256 (binary)
+ value = value * 256 + data [byte_nbr++];
+ if (byte_nbr % 4 == 0) {
+ // Output value in base 85
+ unsigned int divisor = 85 * 85 * 85 * 85;
+ while (divisor) {
+ dest [char_nbr++] = encoder [value / divisor % 85];
+ divisor /= 85;
+ }
+ value = 0;
+ }
+ }
+ assert (char_nbr == size * 5 / 4);
+ dest [char_nbr] = 0;
+ return dest;
+}
+
+
+// --------------------------------------------------------------------------
+// Decode an encoded string into a binary frame; dest must be at least
+// strlen (string) * 4 / 5 bytes long. Returns dest. strlen (string)
+// must be a multiple of 5.
+// Returns NULL and sets errno = EINVAL for invalid input.
+
+uint8_t *zmq_z85_decode (uint8_t *dest, char *string)
+{
+ if (strlen (string) % 5 != 0) {
+ errno = EINVAL;
+ return NULL;
+ }
+ unsigned int byte_nbr = 0;
+ unsigned int char_nbr = 0;
+ unsigned int string_len = strlen (string);
+ uint32_t value = 0;
+ while (char_nbr < string_len) {
+ // Accumulate value in base 85
+ value = value * 85 + decoder [(uint8_t) string [char_nbr++] - 32];
+ if (char_nbr % 5 == 0) {
+ // Output value in base 256
+ unsigned int divisor = 256 * 256 * 256;
+ while (divisor) {
+ dest [byte_nbr++] = value / divisor % 256;
+ divisor /= 256;
+ }
+ value = 0;
+ }
+ }
+ assert (byte_nbr == strlen (string) * 4 / 5);
+ return dest;
+}
+
+// --------------------------------------------------------------------------
+// Generate a public/private keypair with libsodium.
+// Generated keys will be 40 byte z85-encoded strings.
+// Returns 0 on success, -1 on failure, setting errno.
+// Sets errno = ENOTSUP in the absence of libsodium.
+
+int zmq_curve_keypair (char *z85_public_key, char *z85_secret_key)
+{
+#ifdef HAVE_LIBSODIUM
+# if crypto_box_PUBLICKEYBYTES != 32 \
+ || crypto_box_SECRETKEYBYTES != 32
+# error "libsodium not built correctly"
+# endif
+
+ uint8_t public_key [32];
+ uint8_t secret_key [32];
+
+ int rc = crypto_box_keypair (public_key, secret_key);
+ // Is there a sensible errno to set here?
+ if (rc)
+ return rc;
+
+ zmq_z85_encode (z85_public_key, public_key, 32);
+ zmq_z85_encode (z85_secret_key, secret_key, 32);
+
+ return 0;
+#else // requires libsodium
+ errno = ENOTSUP;
+ return -1;
+#endif
+}
LDADD = $(top_builddir)/src/libzmq.la
-noinst_PROGRAMS = test_pair_inproc \
+noinst_PROGRAMS = test_system \
+ test_pair_inproc \
test_pair_tcp \
test_reqrep_inproc \
test_reqrep_tcp \
test_invalid_rep \
test_msg_flags \
test_connect_resolve \
- test_connect_delay \
+ test_immediate \
test_last_endpoint \
test_term_endpoint \
test_monitor \
- test_router_mandatory
+ test_router_mandatory \
+ test_router_raw_empty \
+ test_probe_router \
+ test_stream \
+ test_disconnect_inproc \
+ test_ctx_options \
+ test_ctx_destroy \
+ test_security_null \
+ test_security_plain \
+ test_security_curve \
+ test_iov \
+ test_spec_req \
+ test_spec_rep \
+ test_spec_dealer \
+ test_spec_router \
+ test_spec_pushpull \
+ test_req_correlate \
+ test_req_relaxed \
+ test_conflate \
+ test_inproc_connect \
+ test_issue_566 \
+ test_abstract_ipc \
+ test_many_sockets
if !ON_MINGW
noinst_PROGRAMS += test_shutdown_stress \
test_pair_ipc \
test_reqrep_ipc \
- test_timeo
+ test_timeo \
+ test_fork
endif
+test_system_SOURCES = test_system.cpp
test_pair_inproc_SOURCES = test_pair_inproc.cpp testutil.hpp
test_pair_tcp_SOURCES = test_pair_tcp.cpp testutil.hpp
test_reqrep_inproc_SOURCES = test_reqrep_inproc.cpp testutil.hpp
test_invalid_rep_SOURCES = test_invalid_rep.cpp
test_msg_flags_SOURCES = test_msg_flags.cpp
test_connect_resolve_SOURCES = test_connect_resolve.cpp
-test_connect_delay_SOURCES = test_connect_delay.cpp
+test_immediate_SOURCES = test_immediate.cpp
test_last_endpoint_SOURCES = test_last_endpoint.cpp
test_term_endpoint_SOURCES = test_term_endpoint.cpp
test_monitor_SOURCES = test_monitor.cpp
test_router_mandatory_SOURCES = test_router_mandatory.cpp
-
+test_router_raw_empty_SOURCES = test_router_raw_empty.cpp
+test_probe_router_SOURCES = test_probe_router.cpp
+test_stream_SOURCES = test_stream.cpp
+test_disconnect_inproc_SOURCES = test_disconnect_inproc.cpp
+test_ctx_options_SOURCES = test_ctx_options.cpp
+test_iov_SOURCES = test_iov.cpp
+test_ctx_destroy_SOURCES = test_ctx_destroy.cpp
+test_security_null_SOURCES = test_security_null.cpp
+test_security_plain_SOURCES = test_security_plain.cpp
+test_security_curve_SOURCES = test_security_curve.cpp
+test_spec_req_SOURCES = test_spec_req.cpp
+test_spec_rep_SOURCES = test_spec_rep.cpp
+test_spec_dealer_SOURCES = test_spec_dealer.cpp
+test_spec_router_SOURCES = test_spec_router.cpp
+test_spec_pushpull_SOURCES = test_spec_pushpull.cpp
+test_req_correlate_SOURCES = test_req_correlate.cpp
+test_req_relaxed_SOURCES = test_req_relaxed.cpp
+test_conflate_SOURCES = test_conflate.cpp
+test_inproc_connect_SOURCES = test_inproc_connect.cpp
+test_issue_566_SOURCES = test_issue_566.cpp
+test_abstract_ipc_SOURCES = test_abstract_ipc.cpp
+test_many_sockets_SOURCES = test_many_sockets.cpp
if !ON_MINGW
test_shutdown_stress_SOURCES = test_shutdown_stress.cpp
test_pair_ipc_SOURCES = test_pair_ipc.cpp testutil.hpp
test_reqrep_ipc_SOURCES = test_reqrep_ipc.cpp testutil.hpp
test_timeo_SOURCES = test_timeo.cpp
+test_fork_SOURCES = test_fork.cpp
endif
+# Run the test cases
TESTS = $(noinst_PROGRAMS)
+
+if !ON_LINUX
+XFAIL_TESTS = test_abstract_ipc
+endif
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-noinst_PROGRAMS = test_pair_inproc$(EXEEXT) test_pair_tcp$(EXEEXT) \
- test_reqrep_inproc$(EXEEXT) test_reqrep_tcp$(EXEEXT) \
- test_hwm$(EXEEXT) test_reqrep_device$(EXEEXT) \
- test_sub_forward$(EXEEXT) test_invalid_rep$(EXEEXT) \
- test_msg_flags$(EXEEXT) test_connect_resolve$(EXEEXT) \
- test_connect_delay$(EXEEXT) test_last_endpoint$(EXEEXT) \
- test_term_endpoint$(EXEEXT) test_monitor$(EXEEXT) \
- test_router_mandatory$(EXEEXT) $(am__EXEEXT_1)
+noinst_PROGRAMS = test_system$(EXEEXT) test_pair_inproc$(EXEEXT) \
+ test_pair_tcp$(EXEEXT) test_reqrep_inproc$(EXEEXT) \
+ test_reqrep_tcp$(EXEEXT) test_hwm$(EXEEXT) \
+ test_reqrep_device$(EXEEXT) test_sub_forward$(EXEEXT) \
+ test_invalid_rep$(EXEEXT) test_msg_flags$(EXEEXT) \
+ test_connect_resolve$(EXEEXT) test_immediate$(EXEEXT) \
+ test_last_endpoint$(EXEEXT) test_term_endpoint$(EXEEXT) \
+ test_monitor$(EXEEXT) test_router_mandatory$(EXEEXT) \
+ test_router_raw_empty$(EXEEXT) test_probe_router$(EXEEXT) \
+ test_stream$(EXEEXT) test_disconnect_inproc$(EXEEXT) \
+ test_ctx_options$(EXEEXT) test_ctx_destroy$(EXEEXT) \
+ test_security_null$(EXEEXT) test_security_plain$(EXEEXT) \
+ test_security_curve$(EXEEXT) test_iov$(EXEEXT) \
+ test_spec_req$(EXEEXT) test_spec_rep$(EXEEXT) \
+ test_spec_dealer$(EXEEXT) test_spec_router$(EXEEXT) \
+ test_spec_pushpull$(EXEEXT) test_req_correlate$(EXEEXT) \
+ test_req_relaxed$(EXEEXT) test_conflate$(EXEEXT) \
+ test_inproc_connect$(EXEEXT) test_issue_566$(EXEEXT) \
+ test_abstract_ipc$(EXEEXT) test_many_sockets$(EXEEXT) \
+ $(am__EXEEXT_1)
@ON_MINGW_FALSE@am__append_1 = test_shutdown_stress \
@ON_MINGW_FALSE@ test_pair_ipc \
@ON_MINGW_FALSE@ test_reqrep_ipc \
-@ON_MINGW_FALSE@ test_timeo
+@ON_MINGW_FALSE@ test_timeo \
+@ON_MINGW_FALSE@ test_fork
+@ON_LINUX_FALSE@XFAIL_TESTS = test_abstract_ipc$(EXEEXT)
subdir = tests
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
$(top_srcdir)/config/ltsugar.m4 \
$(top_srcdir)/config/ltversion.m4 \
$(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_VPATH_FILES =
@ON_MINGW_FALSE@am__EXEEXT_1 = test_shutdown_stress$(EXEEXT) \
@ON_MINGW_FALSE@ test_pair_ipc$(EXEEXT) \
-@ON_MINGW_FALSE@ test_reqrep_ipc$(EXEEXT) test_timeo$(EXEEXT)
+@ON_MINGW_FALSE@ test_reqrep_ipc$(EXEEXT) test_timeo$(EXEEXT) \
+@ON_MINGW_FALSE@ test_fork$(EXEEXT)
PROGRAMS = $(noinst_PROGRAMS)
-am_test_connect_delay_OBJECTS = test_connect_delay.$(OBJEXT)
-test_connect_delay_OBJECTS = $(am_test_connect_delay_OBJECTS)
-test_connect_delay_LDADD = $(LDADD)
-test_connect_delay_DEPENDENCIES = $(top_builddir)/src/libzmq.la
+am_test_abstract_ipc_OBJECTS = test_abstract_ipc.$(OBJEXT)
+test_abstract_ipc_OBJECTS = $(am_test_abstract_ipc_OBJECTS)
+test_abstract_ipc_LDADD = $(LDADD)
+test_abstract_ipc_DEPENDENCIES = $(top_builddir)/src/libzmq.la
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
+am_test_conflate_OBJECTS = test_conflate.$(OBJEXT)
+test_conflate_OBJECTS = $(am_test_conflate_OBJECTS)
+test_conflate_LDADD = $(LDADD)
+test_conflate_DEPENDENCIES = $(top_builddir)/src/libzmq.la
am_test_connect_resolve_OBJECTS = test_connect_resolve.$(OBJEXT)
test_connect_resolve_OBJECTS = $(am_test_connect_resolve_OBJECTS)
test_connect_resolve_LDADD = $(LDADD)
test_connect_resolve_DEPENDENCIES = $(top_builddir)/src/libzmq.la
+am_test_ctx_destroy_OBJECTS = test_ctx_destroy.$(OBJEXT)
+test_ctx_destroy_OBJECTS = $(am_test_ctx_destroy_OBJECTS)
+test_ctx_destroy_LDADD = $(LDADD)
+test_ctx_destroy_DEPENDENCIES = $(top_builddir)/src/libzmq.la
+am_test_ctx_options_OBJECTS = test_ctx_options.$(OBJEXT)
+test_ctx_options_OBJECTS = $(am_test_ctx_options_OBJECTS)
+test_ctx_options_LDADD = $(LDADD)
+test_ctx_options_DEPENDENCIES = $(top_builddir)/src/libzmq.la
+am_test_disconnect_inproc_OBJECTS = test_disconnect_inproc.$(OBJEXT)
+test_disconnect_inproc_OBJECTS = $(am_test_disconnect_inproc_OBJECTS)
+test_disconnect_inproc_LDADD = $(LDADD)
+test_disconnect_inproc_DEPENDENCIES = $(top_builddir)/src/libzmq.la
+am__test_fork_SOURCES_DIST = test_fork.cpp
+@ON_MINGW_FALSE@am_test_fork_OBJECTS = test_fork.$(OBJEXT)
+test_fork_OBJECTS = $(am_test_fork_OBJECTS)
+test_fork_LDADD = $(LDADD)
+test_fork_DEPENDENCIES = $(top_builddir)/src/libzmq.la
am_test_hwm_OBJECTS = test_hwm.$(OBJEXT)
test_hwm_OBJECTS = $(am_test_hwm_OBJECTS)
test_hwm_LDADD = $(LDADD)
test_hwm_DEPENDENCIES = $(top_builddir)/src/libzmq.la
+am_test_immediate_OBJECTS = test_immediate.$(OBJEXT)
+test_immediate_OBJECTS = $(am_test_immediate_OBJECTS)
+test_immediate_LDADD = $(LDADD)
+test_immediate_DEPENDENCIES = $(top_builddir)/src/libzmq.la
+am_test_inproc_connect_OBJECTS = test_inproc_connect.$(OBJEXT)
+test_inproc_connect_OBJECTS = $(am_test_inproc_connect_OBJECTS)
+test_inproc_connect_LDADD = $(LDADD)
+test_inproc_connect_DEPENDENCIES = $(top_builddir)/src/libzmq.la
am_test_invalid_rep_OBJECTS = test_invalid_rep.$(OBJEXT)
test_invalid_rep_OBJECTS = $(am_test_invalid_rep_OBJECTS)
test_invalid_rep_LDADD = $(LDADD)
test_invalid_rep_DEPENDENCIES = $(top_builddir)/src/libzmq.la
+am_test_iov_OBJECTS = test_iov.$(OBJEXT)
+test_iov_OBJECTS = $(am_test_iov_OBJECTS)
+test_iov_LDADD = $(LDADD)
+test_iov_DEPENDENCIES = $(top_builddir)/src/libzmq.la
+am_test_issue_566_OBJECTS = test_issue_566.$(OBJEXT)
+test_issue_566_OBJECTS = $(am_test_issue_566_OBJECTS)
+test_issue_566_LDADD = $(LDADD)
+test_issue_566_DEPENDENCIES = $(top_builddir)/src/libzmq.la
am_test_last_endpoint_OBJECTS = test_last_endpoint.$(OBJEXT)
test_last_endpoint_OBJECTS = $(am_test_last_endpoint_OBJECTS)
test_last_endpoint_LDADD = $(LDADD)
test_last_endpoint_DEPENDENCIES = $(top_builddir)/src/libzmq.la
+am_test_many_sockets_OBJECTS = test_many_sockets.$(OBJEXT)
+test_many_sockets_OBJECTS = $(am_test_many_sockets_OBJECTS)
+test_many_sockets_LDADD = $(LDADD)
+test_many_sockets_DEPENDENCIES = $(top_builddir)/src/libzmq.la
am_test_monitor_OBJECTS = test_monitor.$(OBJEXT)
test_monitor_OBJECTS = $(am_test_monitor_OBJECTS)
test_monitor_LDADD = $(LDADD)
test_pair_tcp_OBJECTS = $(am_test_pair_tcp_OBJECTS)
test_pair_tcp_LDADD = $(LDADD)
test_pair_tcp_DEPENDENCIES = $(top_builddir)/src/libzmq.la
+am_test_probe_router_OBJECTS = test_probe_router.$(OBJEXT)
+test_probe_router_OBJECTS = $(am_test_probe_router_OBJECTS)
+test_probe_router_LDADD = $(LDADD)
+test_probe_router_DEPENDENCIES = $(top_builddir)/src/libzmq.la
+am_test_req_correlate_OBJECTS = test_req_correlate.$(OBJEXT)
+test_req_correlate_OBJECTS = $(am_test_req_correlate_OBJECTS)
+test_req_correlate_LDADD = $(LDADD)
+test_req_correlate_DEPENDENCIES = $(top_builddir)/src/libzmq.la
+am_test_req_relaxed_OBJECTS = test_req_relaxed.$(OBJEXT)
+test_req_relaxed_OBJECTS = $(am_test_req_relaxed_OBJECTS)
+test_req_relaxed_LDADD = $(LDADD)
+test_req_relaxed_DEPENDENCIES = $(top_builddir)/src/libzmq.la
am_test_reqrep_device_OBJECTS = test_reqrep_device.$(OBJEXT)
test_reqrep_device_OBJECTS = $(am_test_reqrep_device_OBJECTS)
test_reqrep_device_LDADD = $(LDADD)
test_router_mandatory_OBJECTS = $(am_test_router_mandatory_OBJECTS)
test_router_mandatory_LDADD = $(LDADD)
test_router_mandatory_DEPENDENCIES = $(top_builddir)/src/libzmq.la
+am_test_router_raw_empty_OBJECTS = test_router_raw_empty.$(OBJEXT)
+test_router_raw_empty_OBJECTS = $(am_test_router_raw_empty_OBJECTS)
+test_router_raw_empty_LDADD = $(LDADD)
+test_router_raw_empty_DEPENDENCIES = $(top_builddir)/src/libzmq.la
+am_test_security_curve_OBJECTS = test_security_curve.$(OBJEXT)
+test_security_curve_OBJECTS = $(am_test_security_curve_OBJECTS)
+test_security_curve_LDADD = $(LDADD)
+test_security_curve_DEPENDENCIES = $(top_builddir)/src/libzmq.la
+am_test_security_null_OBJECTS = test_security_null.$(OBJEXT)
+test_security_null_OBJECTS = $(am_test_security_null_OBJECTS)
+test_security_null_LDADD = $(LDADD)
+test_security_null_DEPENDENCIES = $(top_builddir)/src/libzmq.la
+am_test_security_plain_OBJECTS = test_security_plain.$(OBJEXT)
+test_security_plain_OBJECTS = $(am_test_security_plain_OBJECTS)
+test_security_plain_LDADD = $(LDADD)
+test_security_plain_DEPENDENCIES = $(top_builddir)/src/libzmq.la
am__test_shutdown_stress_SOURCES_DIST = test_shutdown_stress.cpp
@ON_MINGW_FALSE@am_test_shutdown_stress_OBJECTS = \
@ON_MINGW_FALSE@ test_shutdown_stress.$(OBJEXT)
test_shutdown_stress_OBJECTS = $(am_test_shutdown_stress_OBJECTS)
test_shutdown_stress_LDADD = $(LDADD)
test_shutdown_stress_DEPENDENCIES = $(top_builddir)/src/libzmq.la
+am_test_spec_dealer_OBJECTS = test_spec_dealer.$(OBJEXT)
+test_spec_dealer_OBJECTS = $(am_test_spec_dealer_OBJECTS)
+test_spec_dealer_LDADD = $(LDADD)
+test_spec_dealer_DEPENDENCIES = $(top_builddir)/src/libzmq.la
+am_test_spec_pushpull_OBJECTS = test_spec_pushpull.$(OBJEXT)
+test_spec_pushpull_OBJECTS = $(am_test_spec_pushpull_OBJECTS)
+test_spec_pushpull_LDADD = $(LDADD)
+test_spec_pushpull_DEPENDENCIES = $(top_builddir)/src/libzmq.la
+am_test_spec_rep_OBJECTS = test_spec_rep.$(OBJEXT)
+test_spec_rep_OBJECTS = $(am_test_spec_rep_OBJECTS)
+test_spec_rep_LDADD = $(LDADD)
+test_spec_rep_DEPENDENCIES = $(top_builddir)/src/libzmq.la
+am_test_spec_req_OBJECTS = test_spec_req.$(OBJEXT)
+test_spec_req_OBJECTS = $(am_test_spec_req_OBJECTS)
+test_spec_req_LDADD = $(LDADD)
+test_spec_req_DEPENDENCIES = $(top_builddir)/src/libzmq.la
+am_test_spec_router_OBJECTS = test_spec_router.$(OBJEXT)
+test_spec_router_OBJECTS = $(am_test_spec_router_OBJECTS)
+test_spec_router_LDADD = $(LDADD)
+test_spec_router_DEPENDENCIES = $(top_builddir)/src/libzmq.la
+am_test_stream_OBJECTS = test_stream.$(OBJEXT)
+test_stream_OBJECTS = $(am_test_stream_OBJECTS)
+test_stream_LDADD = $(LDADD)
+test_stream_DEPENDENCIES = $(top_builddir)/src/libzmq.la
am_test_sub_forward_OBJECTS = test_sub_forward.$(OBJEXT)
test_sub_forward_OBJECTS = $(am_test_sub_forward_OBJECTS)
test_sub_forward_LDADD = $(LDADD)
test_sub_forward_DEPENDENCIES = $(top_builddir)/src/libzmq.la
+am_test_system_OBJECTS = test_system.$(OBJEXT)
+test_system_OBJECTS = $(am_test_system_OBJECTS)
+test_system_LDADD = $(LDADD)
+test_system_DEPENDENCIES = $(top_builddir)/src/libzmq.la
am_test_term_endpoint_OBJECTS = test_term_endpoint.$(OBJEXT)
test_term_endpoint_OBJECTS = $(am_test_term_endpoint_OBJECTS)
test_term_endpoint_LDADD = $(LDADD)
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
-SOURCES = $(test_connect_delay_SOURCES) \
- $(test_connect_resolve_SOURCES) $(test_hwm_SOURCES) \
- $(test_invalid_rep_SOURCES) $(test_last_endpoint_SOURCES) \
- $(test_monitor_SOURCES) $(test_msg_flags_SOURCES) \
- $(test_pair_inproc_SOURCES) $(test_pair_ipc_SOURCES) \
- $(test_pair_tcp_SOURCES) $(test_reqrep_device_SOURCES) \
+SOURCES = $(test_abstract_ipc_SOURCES) $(test_conflate_SOURCES) \
+ $(test_connect_resolve_SOURCES) $(test_ctx_destroy_SOURCES) \
+ $(test_ctx_options_SOURCES) $(test_disconnect_inproc_SOURCES) \
+ $(test_fork_SOURCES) $(test_hwm_SOURCES) \
+ $(test_immediate_SOURCES) $(test_inproc_connect_SOURCES) \
+ $(test_invalid_rep_SOURCES) $(test_iov_SOURCES) \
+ $(test_issue_566_SOURCES) $(test_last_endpoint_SOURCES) \
+ $(test_many_sockets_SOURCES) $(test_monitor_SOURCES) \
+ $(test_msg_flags_SOURCES) $(test_pair_inproc_SOURCES) \
+ $(test_pair_ipc_SOURCES) $(test_pair_tcp_SOURCES) \
+ $(test_probe_router_SOURCES) $(test_req_correlate_SOURCES) \
+ $(test_req_relaxed_SOURCES) $(test_reqrep_device_SOURCES) \
$(test_reqrep_inproc_SOURCES) $(test_reqrep_ipc_SOURCES) \
$(test_reqrep_tcp_SOURCES) $(test_router_mandatory_SOURCES) \
- $(test_shutdown_stress_SOURCES) $(test_sub_forward_SOURCES) \
+ $(test_router_raw_empty_SOURCES) \
+ $(test_security_curve_SOURCES) $(test_security_null_SOURCES) \
+ $(test_security_plain_SOURCES) $(test_shutdown_stress_SOURCES) \
+ $(test_spec_dealer_SOURCES) $(test_spec_pushpull_SOURCES) \
+ $(test_spec_rep_SOURCES) $(test_spec_req_SOURCES) \
+ $(test_spec_router_SOURCES) $(test_stream_SOURCES) \
+ $(test_sub_forward_SOURCES) $(test_system_SOURCES) \
$(test_term_endpoint_SOURCES) $(test_timeo_SOURCES)
-DIST_SOURCES = $(test_connect_delay_SOURCES) \
- $(test_connect_resolve_SOURCES) $(test_hwm_SOURCES) \
- $(test_invalid_rep_SOURCES) $(test_last_endpoint_SOURCES) \
- $(test_monitor_SOURCES) $(test_msg_flags_SOURCES) \
- $(test_pair_inproc_SOURCES) $(am__test_pair_ipc_SOURCES_DIST) \
- $(test_pair_tcp_SOURCES) $(test_reqrep_device_SOURCES) \
+DIST_SOURCES = $(test_abstract_ipc_SOURCES) $(test_conflate_SOURCES) \
+ $(test_connect_resolve_SOURCES) $(test_ctx_destroy_SOURCES) \
+ $(test_ctx_options_SOURCES) $(test_disconnect_inproc_SOURCES) \
+ $(am__test_fork_SOURCES_DIST) $(test_hwm_SOURCES) \
+ $(test_immediate_SOURCES) $(test_inproc_connect_SOURCES) \
+ $(test_invalid_rep_SOURCES) $(test_iov_SOURCES) \
+ $(test_issue_566_SOURCES) $(test_last_endpoint_SOURCES) \
+ $(test_many_sockets_SOURCES) $(test_monitor_SOURCES) \
+ $(test_msg_flags_SOURCES) $(test_pair_inproc_SOURCES) \
+ $(am__test_pair_ipc_SOURCES_DIST) $(test_pair_tcp_SOURCES) \
+ $(test_probe_router_SOURCES) $(test_req_correlate_SOURCES) \
+ $(test_req_relaxed_SOURCES) $(test_reqrep_device_SOURCES) \
$(test_reqrep_inproc_SOURCES) \
$(am__test_reqrep_ipc_SOURCES_DIST) $(test_reqrep_tcp_SOURCES) \
$(test_router_mandatory_SOURCES) \
+ $(test_router_raw_empty_SOURCES) \
+ $(test_security_curve_SOURCES) $(test_security_null_SOURCES) \
+ $(test_security_plain_SOURCES) \
$(am__test_shutdown_stress_SOURCES_DIST) \
- $(test_sub_forward_SOURCES) $(test_term_endpoint_SOURCES) \
- $(am__test_timeo_SOURCES_DIST)
+ $(test_spec_dealer_SOURCES) $(test_spec_pushpull_SOURCES) \
+ $(test_spec_rep_SOURCES) $(test_spec_req_SOURCES) \
+ $(test_spec_router_SOURCES) $(test_stream_SOURCES) \
+ $(test_sub_forward_SOURCES) $(test_system_SOURCES) \
+ $(test_term_endpoint_SOURCES) $(am__test_timeo_SOURCES_DIST)
ETAGS = etags
CTAGS = ctags
am__tty_colors = \
-I$(top_srcdir)/include
LDADD = $(top_builddir)/src/libzmq.la
+test_system_SOURCES = test_system.cpp
test_pair_inproc_SOURCES = test_pair_inproc.cpp testutil.hpp
test_pair_tcp_SOURCES = test_pair_tcp.cpp testutil.hpp
test_reqrep_inproc_SOURCES = test_reqrep_inproc.cpp testutil.hpp
test_invalid_rep_SOURCES = test_invalid_rep.cpp
test_msg_flags_SOURCES = test_msg_flags.cpp
test_connect_resolve_SOURCES = test_connect_resolve.cpp
-test_connect_delay_SOURCES = test_connect_delay.cpp
+test_immediate_SOURCES = test_immediate.cpp
test_last_endpoint_SOURCES = test_last_endpoint.cpp
test_term_endpoint_SOURCES = test_term_endpoint.cpp
test_monitor_SOURCES = test_monitor.cpp
test_router_mandatory_SOURCES = test_router_mandatory.cpp
+test_router_raw_empty_SOURCES = test_router_raw_empty.cpp
+test_probe_router_SOURCES = test_probe_router.cpp
+test_stream_SOURCES = test_stream.cpp
+test_disconnect_inproc_SOURCES = test_disconnect_inproc.cpp
+test_ctx_options_SOURCES = test_ctx_options.cpp
+test_iov_SOURCES = test_iov.cpp
+test_ctx_destroy_SOURCES = test_ctx_destroy.cpp
+test_security_null_SOURCES = test_security_null.cpp
+test_security_plain_SOURCES = test_security_plain.cpp
+test_security_curve_SOURCES = test_security_curve.cpp
+test_spec_req_SOURCES = test_spec_req.cpp
+test_spec_rep_SOURCES = test_spec_rep.cpp
+test_spec_dealer_SOURCES = test_spec_dealer.cpp
+test_spec_router_SOURCES = test_spec_router.cpp
+test_spec_pushpull_SOURCES = test_spec_pushpull.cpp
+test_req_correlate_SOURCES = test_req_correlate.cpp
+test_req_relaxed_SOURCES = test_req_relaxed.cpp
+test_conflate_SOURCES = test_conflate.cpp
+test_inproc_connect_SOURCES = test_inproc_connect.cpp
+test_issue_566_SOURCES = test_issue_566.cpp
+test_abstract_ipc_SOURCES = test_abstract_ipc.cpp
+test_many_sockets_SOURCES = test_many_sockets.cpp
@ON_MINGW_FALSE@test_shutdown_stress_SOURCES = test_shutdown_stress.cpp
@ON_MINGW_FALSE@test_pair_ipc_SOURCES = test_pair_ipc.cpp testutil.hpp
@ON_MINGW_FALSE@test_reqrep_ipc_SOURCES = test_reqrep_ipc.cpp testutil.hpp
@ON_MINGW_FALSE@test_timeo_SOURCES = test_timeo.cpp
+@ON_MINGW_FALSE@test_fork_SOURCES = test_fork.cpp
+
+# Run the test cases
TESTS = $(noinst_PROGRAMS)
all: all-am
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
echo " rm -f" $$list; \
rm -f $$list
-test_connect_delay$(EXEEXT): $(test_connect_delay_OBJECTS) $(test_connect_delay_DEPENDENCIES) $(EXTRA_test_connect_delay_DEPENDENCIES)
- @rm -f test_connect_delay$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(test_connect_delay_OBJECTS) $(test_connect_delay_LDADD) $(LIBS)
+test_abstract_ipc$(EXEEXT): $(test_abstract_ipc_OBJECTS) $(test_abstract_ipc_DEPENDENCIES) $(EXTRA_test_abstract_ipc_DEPENDENCIES)
+ @rm -f test_abstract_ipc$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(test_abstract_ipc_OBJECTS) $(test_abstract_ipc_LDADD) $(LIBS)
+test_conflate$(EXEEXT): $(test_conflate_OBJECTS) $(test_conflate_DEPENDENCIES) $(EXTRA_test_conflate_DEPENDENCIES)
+ @rm -f test_conflate$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(test_conflate_OBJECTS) $(test_conflate_LDADD) $(LIBS)
test_connect_resolve$(EXEEXT): $(test_connect_resolve_OBJECTS) $(test_connect_resolve_DEPENDENCIES) $(EXTRA_test_connect_resolve_DEPENDENCIES)
@rm -f test_connect_resolve$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(test_connect_resolve_OBJECTS) $(test_connect_resolve_LDADD) $(LIBS)
+test_ctx_destroy$(EXEEXT): $(test_ctx_destroy_OBJECTS) $(test_ctx_destroy_DEPENDENCIES) $(EXTRA_test_ctx_destroy_DEPENDENCIES)
+ @rm -f test_ctx_destroy$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(test_ctx_destroy_OBJECTS) $(test_ctx_destroy_LDADD) $(LIBS)
+test_ctx_options$(EXEEXT): $(test_ctx_options_OBJECTS) $(test_ctx_options_DEPENDENCIES) $(EXTRA_test_ctx_options_DEPENDENCIES)
+ @rm -f test_ctx_options$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(test_ctx_options_OBJECTS) $(test_ctx_options_LDADD) $(LIBS)
+test_disconnect_inproc$(EXEEXT): $(test_disconnect_inproc_OBJECTS) $(test_disconnect_inproc_DEPENDENCIES) $(EXTRA_test_disconnect_inproc_DEPENDENCIES)
+ @rm -f test_disconnect_inproc$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(test_disconnect_inproc_OBJECTS) $(test_disconnect_inproc_LDADD) $(LIBS)
+test_fork$(EXEEXT): $(test_fork_OBJECTS) $(test_fork_DEPENDENCIES) $(EXTRA_test_fork_DEPENDENCIES)
+ @rm -f test_fork$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(test_fork_OBJECTS) $(test_fork_LDADD) $(LIBS)
test_hwm$(EXEEXT): $(test_hwm_OBJECTS) $(test_hwm_DEPENDENCIES) $(EXTRA_test_hwm_DEPENDENCIES)
@rm -f test_hwm$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(test_hwm_OBJECTS) $(test_hwm_LDADD) $(LIBS)
+test_immediate$(EXEEXT): $(test_immediate_OBJECTS) $(test_immediate_DEPENDENCIES) $(EXTRA_test_immediate_DEPENDENCIES)
+ @rm -f test_immediate$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(test_immediate_OBJECTS) $(test_immediate_LDADD) $(LIBS)
+test_inproc_connect$(EXEEXT): $(test_inproc_connect_OBJECTS) $(test_inproc_connect_DEPENDENCIES) $(EXTRA_test_inproc_connect_DEPENDENCIES)
+ @rm -f test_inproc_connect$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(test_inproc_connect_OBJECTS) $(test_inproc_connect_LDADD) $(LIBS)
test_invalid_rep$(EXEEXT): $(test_invalid_rep_OBJECTS) $(test_invalid_rep_DEPENDENCIES) $(EXTRA_test_invalid_rep_DEPENDENCIES)
@rm -f test_invalid_rep$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(test_invalid_rep_OBJECTS) $(test_invalid_rep_LDADD) $(LIBS)
+test_iov$(EXEEXT): $(test_iov_OBJECTS) $(test_iov_DEPENDENCIES) $(EXTRA_test_iov_DEPENDENCIES)
+ @rm -f test_iov$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(test_iov_OBJECTS) $(test_iov_LDADD) $(LIBS)
+test_issue_566$(EXEEXT): $(test_issue_566_OBJECTS) $(test_issue_566_DEPENDENCIES) $(EXTRA_test_issue_566_DEPENDENCIES)
+ @rm -f test_issue_566$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(test_issue_566_OBJECTS) $(test_issue_566_LDADD) $(LIBS)
test_last_endpoint$(EXEEXT): $(test_last_endpoint_OBJECTS) $(test_last_endpoint_DEPENDENCIES) $(EXTRA_test_last_endpoint_DEPENDENCIES)
@rm -f test_last_endpoint$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(test_last_endpoint_OBJECTS) $(test_last_endpoint_LDADD) $(LIBS)
+test_many_sockets$(EXEEXT): $(test_many_sockets_OBJECTS) $(test_many_sockets_DEPENDENCIES) $(EXTRA_test_many_sockets_DEPENDENCIES)
+ @rm -f test_many_sockets$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(test_many_sockets_OBJECTS) $(test_many_sockets_LDADD) $(LIBS)
test_monitor$(EXEEXT): $(test_monitor_OBJECTS) $(test_monitor_DEPENDENCIES) $(EXTRA_test_monitor_DEPENDENCIES)
@rm -f test_monitor$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(test_monitor_OBJECTS) $(test_monitor_LDADD) $(LIBS)
test_pair_tcp$(EXEEXT): $(test_pair_tcp_OBJECTS) $(test_pair_tcp_DEPENDENCIES) $(EXTRA_test_pair_tcp_DEPENDENCIES)
@rm -f test_pair_tcp$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(test_pair_tcp_OBJECTS) $(test_pair_tcp_LDADD) $(LIBS)
+test_probe_router$(EXEEXT): $(test_probe_router_OBJECTS) $(test_probe_router_DEPENDENCIES) $(EXTRA_test_probe_router_DEPENDENCIES)
+ @rm -f test_probe_router$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(test_probe_router_OBJECTS) $(test_probe_router_LDADD) $(LIBS)
+test_req_correlate$(EXEEXT): $(test_req_correlate_OBJECTS) $(test_req_correlate_DEPENDENCIES) $(EXTRA_test_req_correlate_DEPENDENCIES)
+ @rm -f test_req_correlate$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(test_req_correlate_OBJECTS) $(test_req_correlate_LDADD) $(LIBS)
+test_req_relaxed$(EXEEXT): $(test_req_relaxed_OBJECTS) $(test_req_relaxed_DEPENDENCIES) $(EXTRA_test_req_relaxed_DEPENDENCIES)
+ @rm -f test_req_relaxed$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(test_req_relaxed_OBJECTS) $(test_req_relaxed_LDADD) $(LIBS)
test_reqrep_device$(EXEEXT): $(test_reqrep_device_OBJECTS) $(test_reqrep_device_DEPENDENCIES) $(EXTRA_test_reqrep_device_DEPENDENCIES)
@rm -f test_reqrep_device$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(test_reqrep_device_OBJECTS) $(test_reqrep_device_LDADD) $(LIBS)
test_router_mandatory$(EXEEXT): $(test_router_mandatory_OBJECTS) $(test_router_mandatory_DEPENDENCIES) $(EXTRA_test_router_mandatory_DEPENDENCIES)
@rm -f test_router_mandatory$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(test_router_mandatory_OBJECTS) $(test_router_mandatory_LDADD) $(LIBS)
+test_router_raw_empty$(EXEEXT): $(test_router_raw_empty_OBJECTS) $(test_router_raw_empty_DEPENDENCIES) $(EXTRA_test_router_raw_empty_DEPENDENCIES)
+ @rm -f test_router_raw_empty$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(test_router_raw_empty_OBJECTS) $(test_router_raw_empty_LDADD) $(LIBS)
+test_security_curve$(EXEEXT): $(test_security_curve_OBJECTS) $(test_security_curve_DEPENDENCIES) $(EXTRA_test_security_curve_DEPENDENCIES)
+ @rm -f test_security_curve$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(test_security_curve_OBJECTS) $(test_security_curve_LDADD) $(LIBS)
+test_security_null$(EXEEXT): $(test_security_null_OBJECTS) $(test_security_null_DEPENDENCIES) $(EXTRA_test_security_null_DEPENDENCIES)
+ @rm -f test_security_null$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(test_security_null_OBJECTS) $(test_security_null_LDADD) $(LIBS)
+test_security_plain$(EXEEXT): $(test_security_plain_OBJECTS) $(test_security_plain_DEPENDENCIES) $(EXTRA_test_security_plain_DEPENDENCIES)
+ @rm -f test_security_plain$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(test_security_plain_OBJECTS) $(test_security_plain_LDADD) $(LIBS)
test_shutdown_stress$(EXEEXT): $(test_shutdown_stress_OBJECTS) $(test_shutdown_stress_DEPENDENCIES) $(EXTRA_test_shutdown_stress_DEPENDENCIES)
@rm -f test_shutdown_stress$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(test_shutdown_stress_OBJECTS) $(test_shutdown_stress_LDADD) $(LIBS)
+test_spec_dealer$(EXEEXT): $(test_spec_dealer_OBJECTS) $(test_spec_dealer_DEPENDENCIES) $(EXTRA_test_spec_dealer_DEPENDENCIES)
+ @rm -f test_spec_dealer$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(test_spec_dealer_OBJECTS) $(test_spec_dealer_LDADD) $(LIBS)
+test_spec_pushpull$(EXEEXT): $(test_spec_pushpull_OBJECTS) $(test_spec_pushpull_DEPENDENCIES) $(EXTRA_test_spec_pushpull_DEPENDENCIES)
+ @rm -f test_spec_pushpull$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(test_spec_pushpull_OBJECTS) $(test_spec_pushpull_LDADD) $(LIBS)
+test_spec_rep$(EXEEXT): $(test_spec_rep_OBJECTS) $(test_spec_rep_DEPENDENCIES) $(EXTRA_test_spec_rep_DEPENDENCIES)
+ @rm -f test_spec_rep$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(test_spec_rep_OBJECTS) $(test_spec_rep_LDADD) $(LIBS)
+test_spec_req$(EXEEXT): $(test_spec_req_OBJECTS) $(test_spec_req_DEPENDENCIES) $(EXTRA_test_spec_req_DEPENDENCIES)
+ @rm -f test_spec_req$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(test_spec_req_OBJECTS) $(test_spec_req_LDADD) $(LIBS)
+test_spec_router$(EXEEXT): $(test_spec_router_OBJECTS) $(test_spec_router_DEPENDENCIES) $(EXTRA_test_spec_router_DEPENDENCIES)
+ @rm -f test_spec_router$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(test_spec_router_OBJECTS) $(test_spec_router_LDADD) $(LIBS)
+test_stream$(EXEEXT): $(test_stream_OBJECTS) $(test_stream_DEPENDENCIES) $(EXTRA_test_stream_DEPENDENCIES)
+ @rm -f test_stream$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(test_stream_OBJECTS) $(test_stream_LDADD) $(LIBS)
test_sub_forward$(EXEEXT): $(test_sub_forward_OBJECTS) $(test_sub_forward_DEPENDENCIES) $(EXTRA_test_sub_forward_DEPENDENCIES)
@rm -f test_sub_forward$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(test_sub_forward_OBJECTS) $(test_sub_forward_LDADD) $(LIBS)
+test_system$(EXEEXT): $(test_system_OBJECTS) $(test_system_DEPENDENCIES) $(EXTRA_test_system_DEPENDENCIES)
+ @rm -f test_system$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(test_system_OBJECTS) $(test_system_LDADD) $(LIBS)
test_term_endpoint$(EXEEXT): $(test_term_endpoint_OBJECTS) $(test_term_endpoint_DEPENDENCIES) $(EXTRA_test_term_endpoint_DEPENDENCIES)
@rm -f test_term_endpoint$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(test_term_endpoint_OBJECTS) $(test_term_endpoint_LDADD) $(LIBS)
distclean-compile:
-rm -f *.tab.c
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_connect_delay.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_abstract_ipc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_conflate.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_connect_resolve.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ctx_destroy.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ctx_options.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_disconnect_inproc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_fork.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_hwm.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_immediate.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_inproc_connect.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_invalid_rep.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_iov.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_issue_566.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_last_endpoint.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_many_sockets.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_monitor.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_msg_flags.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_pair_inproc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_pair_ipc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_pair_tcp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_probe_router.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_req_correlate.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_req_relaxed.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_reqrep_device.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_reqrep_inproc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_reqrep_ipc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_reqrep_tcp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_router_mandatory.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_router_raw_empty.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_security_curve.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_security_null.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_security_plain.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_shutdown_stress.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_spec_dealer.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_spec_pushpull.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_spec_rep.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_spec_req.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_spec_router.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_stream.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_sub_forward.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_system.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_term_endpoint.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_timeo.Po@am__quote@
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "testutil.hpp"
+
+int main (void)
+{
+ setup_test_environment();
+ void *ctx = zmq_ctx_new ();
+ assert (ctx);
+
+ void *sb = zmq_socket (ctx, ZMQ_PAIR);
+ assert (sb);
+ int rc = zmq_bind (sb, "ipc://@/tmp/tester");
+ assert (rc == 0);
+
+ char endpoint[200];
+ size_t size = sizeof(endpoint);
+ rc = zmq_getsockopt (sb, ZMQ_LAST_ENDPOINT, endpoint, &size);
+ assert (rc == 0);
+ rc = strncmp(endpoint, "ipc://@/tmp/tester", size);
+ assert (rc == 0);
+
+ void *sc = zmq_socket (ctx, ZMQ_PAIR);
+ assert (sc);
+ rc = zmq_connect (sc, "ipc://@/tmp/tester");
+ assert (rc == 0);
+
+ bounce (sb, sc);
+
+ rc = zmq_close (sc);
+ assert (rc == 0);
+
+ rc = zmq_close (sb);
+ assert (rc == 0);
+
+ rc = zmq_ctx_term (ctx);
+ assert (rc == 0);
+
+ return 0 ;
+}
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "testutil.hpp"
+
+int main (int argc, char *argv [])
+{
+ const char *bind_to = "tcp://127.0.0.1:5555";
+
+ int rc;
+
+ void* ctx = zmq_init (1);
+ assert (ctx);
+
+ void* s_in = zmq_socket (ctx, ZMQ_PULL);
+ assert (s_in);
+
+ int conflate = 1;
+ rc = zmq_setsockopt (s_in, ZMQ_CONFLATE, &conflate, sizeof(conflate));
+ assert (rc == 0);
+
+ rc = zmq_bind (s_in, bind_to);
+ assert (rc == 0);
+
+ void* s_out = zmq_socket (ctx, ZMQ_PUSH);
+ assert (s_out);
+
+ rc = zmq_connect (s_out, bind_to);
+ assert (rc == 0);
+
+ int message_count = 20;
+ for (int j = 0; j < message_count; ++j) {
+ rc = zmq_send(s_out, (void*)&j, sizeof(int), 0);
+ if (rc < 0) {
+ printf ("error in zmq_sendmsg: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+ }
+ msleep (SETTLE_TIME);
+
+ int payload_recved = 0;
+ rc = zmq_recv (s_in, (void*)&payload_recved, sizeof(int), 0);
+ assert (rc > 0);
+ assert (payload_recved == message_count - 1);
+
+ rc = zmq_close (s_in);
+ assert (rc == 0);
+
+ rc = zmq_close (s_out);
+ assert (rc == 0);
+
+ rc = zmq_term (ctx);
+ assert (rc == 0);
+
+ return 0;
+}
+++ /dev/null
-/*
-Copyright (c) 2012 Ian Barber
-Copyright (c) 2012 Other contributors as noted in the AUTHORS file
-
-This file is part of 0MQ.
-
-0MQ is free software; you can redistribute it and/or modify it under
-the terms of the GNU Lesser General Public License as published by
-the Free Software Foundation; either version 3 of the License, or
-(at your option) any later version.
-
-0MQ is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "../include/zmq.h"
-#include "../include/zmq_utils.h"
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <string>
-#include <pthread.h>
-
-#undef NDEBUG
-#include <assert.h>
-
-static void *server (void *)
-{
- void *socket, *context;
- char buffer[16];
- int rc, val;
-
- context = zmq_init (1);
- assert (context);
-
- socket = zmq_socket (context, ZMQ_PULL);
- assert (socket);
-
- val = 0;
- rc = zmq_setsockopt(socket, ZMQ_LINGER, &val, sizeof(val));
- assert (rc == 0);
-
- rc = zmq_bind (socket, "ipc:///tmp/recon");
- assert (rc == 0);
-
- memset (&buffer, 0, sizeof(buffer));
- rc = zmq_recv (socket, &buffer, sizeof(buffer), 0);
-
- // Intentionally bail out
- rc = zmq_close (socket);
- assert (rc == 0);
-
- rc = zmq_term (context);
- assert (rc == 0);
-
- usleep (200000);
-
- context = zmq_init (1);
- assert (context);
-
- socket = zmq_socket (context, ZMQ_PULL);
- assert (socket);
-
- val = 0;
- rc = zmq_setsockopt(socket, ZMQ_LINGER, &val, sizeof(val));
- assert (rc == 0);
-
- rc = zmq_bind (socket, "ipc:///tmp/recon");
- assert (rc == 0);
-
- usleep (200000);
-
- memset (&buffer, 0, sizeof(buffer));
- rc = zmq_recv (socket, &buffer, sizeof(buffer), ZMQ_DONTWAIT);
- assert (rc != -1);
-
- // Start closing the socket while the connecting process is underway.
- rc = zmq_close (socket);
- assert (rc == 0);
-
- rc = zmq_term (context);
- assert (rc == 0);
-
- return NULL;
-}
-
-static void *worker (void *)
-{
- void *socket, *context;
- int rc, hadone, val;
-
- context = zmq_init (1);
- assert (context);
-
- socket = zmq_socket (context, ZMQ_PUSH);
- assert (socket);
-
- val = 0;
- rc = zmq_setsockopt(socket, ZMQ_LINGER, &val, sizeof(val));
- assert (rc == 0);
-
- val = 1;
- rc = zmq_setsockopt (socket, ZMQ_DELAY_ATTACH_ON_CONNECT, &val, sizeof(val));
- assert (rc == 0);
-
- rc = zmq_connect (socket, "ipc:///tmp/recon");
- assert (rc == 0);
-
- hadone = 0;
- // Not checking RC as some may be -1
- for (int i = 0; i < 6; i++) {
- usleep(200000);
- rc = zmq_send (socket, "hi", 2, ZMQ_DONTWAIT);
- if (rc != -1)
- hadone ++;
- }
-
- assert (hadone >= 2);
- assert (hadone < 4);
-
- rc = zmq_close (socket);
- assert (rc == 0);
-
- rc = zmq_term (context);
- assert (rc == 0);
-
- return NULL;
-}
-
-int main (void)
-{
- fprintf (stderr, "test_connect_delay running...\n");
- int val;
- int rc;
- char buffer[16];
- int seen = 0;
-
- void *context = zmq_ctx_new();
- assert (context);
- void *to = zmq_socket(context, ZMQ_PULL);
- assert (to);
-
- val = 0;
- rc = zmq_setsockopt(to, ZMQ_LINGER, &val, sizeof(val));
- assert (rc == 0);
- rc = zmq_bind(to, "tcp://*:6555");
- assert (rc == 0);
-
- // Create a socket pushing to two endpoints - only 1 message should arrive.
- void *from = zmq_socket (context, ZMQ_PUSH);
- assert(from);
-
- val = 0;
- zmq_setsockopt (from, ZMQ_LINGER, &val, sizeof(val));
- rc = zmq_connect (from, "tcp://localhost:6556");
- assert (rc == 0);
- rc = zmq_connect (from, "tcp://localhost:6555");
- assert (rc == 0);
-
- for (int i = 0; i < 10; ++i)
- {
- std::string message("message ");
- message += ('0' + i);
- rc = zmq_send (from, message.data(), message.size(), 0);
- assert(rc >= 0);
- }
-
- zmq_sleep (1);
- seen = 0;
- for (int i = 0; i < 10; ++i)
- {
- memset (&buffer, 0, sizeof(buffer));
- rc = zmq_recv (to, &buffer, sizeof(buffer), ZMQ_DONTWAIT);
- if( rc == -1)
- break;
- seen++;
- }
- assert (seen == 5);
-
- rc = zmq_close (from);
- assert (rc == 0);
-
- rc = zmq_close (to);
- assert (rc == 0);
-
- rc = zmq_ctx_destroy(context);
- assert (rc == 0);
-
- context = zmq_ctx_new();
- fprintf (stderr, " Rerunning with DELAY_ATTACH_ON_CONNECT\n");
-
- to = zmq_socket (context, ZMQ_PULL);
- assert (to);
- rc = zmq_bind (to, "tcp://*:5560");
- assert (rc == 0);
-
- val = 0;
- rc = zmq_setsockopt (to, ZMQ_LINGER, &val, sizeof(val));
- assert (rc == 0);
-
- // Create a socket pushing to two endpoints - all messages should arrive.
- from = zmq_socket (context, ZMQ_PUSH);
- assert (from);
-
- val = 0;
- rc = zmq_setsockopt (from, ZMQ_LINGER, &val, sizeof(val));
- assert (rc == 0);
-
- val = 1;
- rc = zmq_setsockopt (from, ZMQ_DELAY_ATTACH_ON_CONNECT, &val, sizeof(val));
- assert (rc == 0);
-
- rc = zmq_connect (from, "tcp://localhost:5561");
- assert (rc == 0);
-
- rc = zmq_connect (from, "tcp://localhost:5560");
- assert (rc == 0);
-
- for (int i = 0; i < 10; ++i)
- {
- std::string message("message ");
- message += ('0' + i);
- rc = zmq_send (from, message.data(), message.size(), 0);
- assert (rc >= 0);
- }
-
- zmq_sleep (1);
-
- seen = 0;
- for (int i = 0; i < 10; ++i)
- {
- memset(&buffer, 0, sizeof(buffer));
- rc = zmq_recv (to, &buffer, sizeof(buffer), ZMQ_DONTWAIT);
- assert (rc != -1);
- }
-
- rc = zmq_close (from);
- assert (rc == 0);
-
- rc = zmq_close (to);
- assert (rc == 0);
-
- rc = zmq_ctx_destroy(context);
- assert (rc == 0);
-
- fprintf (stderr, " Running DELAY_ATTACH_ON_CONNECT with disconnect\n");
-
- pthread_t serv, work;
-
- rc = pthread_create (&serv, NULL, server, NULL);
- assert (rc == 0);
-
- rc = pthread_create (&work, NULL, worker, NULL);
- assert (rc == 0);
-
- pthread_exit(NULL);
-}
/*
- Copyright (c) 2012 Spotify AB
- Copyright (c) 2012 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "../include/zmq.h"
-#include <stdio.h>
-#include <errno.h>
-
-#undef NDEBUG
-#include <assert.h>
+#include "testutil.hpp"
int main (void)
{
- fprintf (stderr, "test_connect_resolve running...\n");
-
- void *ctx = zmq_init (1);
+ setup_test_environment();
+ void *ctx = zmq_ctx_new ();
assert (ctx);
- // Create pair of socket, each with high watermark of 2. Thus the total
- // buffer space should be 4 messages.
void *sock = zmq_socket (ctx, ZMQ_PUB);
assert (sock);
int rc = zmq_connect (sock, "tcp://localhost:1234");
assert (rc == 0);
- rc = zmq_connect (sock, "tcp://0mq.is.teh.best:1234");
+ rc = zmq_connect (sock, "tcp://localhost:invalid");
assert (rc == -1);
assert (errno == EINVAL);
+ rc = zmq_connect (sock, "tcp://in val id:1234");
+ assert (rc == -1);
+ assert (errno == EINVAL);
+
+ rc = zmq_connect (sock, "invalid://localhost:1234");
+ assert (rc == -1);
+ assert (errno == EPROTONOSUPPORT);
+
rc = zmq_close (sock);
assert (rc == 0);
- rc = zmq_term (ctx);
+ rc = zmq_ctx_term (ctx);
assert (rc == 0);
return 0;
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "testutil.hpp"
+
+static void receiver (void *socket)
+{
+ char buffer[16];
+ int rc = zmq_recv (socket, &buffer, sizeof (buffer), 0);
+ assert(rc == -1);
+}
+
+void test_ctx_destroy()
+{
+ int rc;
+
+ // Set up our context and sockets
+ void *ctx = zmq_ctx_new ();
+ assert (ctx);
+
+ void *socket = zmq_socket (ctx, ZMQ_PULL);
+ assert (socket);
+
+ // Close the socket
+ rc = zmq_close (socket);
+ assert (rc == 0);
+
+ // Destroy the context
+ rc = zmq_ctx_destroy (ctx);
+ assert (rc == 0);
+}
+
+void test_ctx_shutdown()
+{
+ int rc;
+
+ // Set up our context and sockets
+ void *ctx = zmq_ctx_new ();
+ assert (ctx);
+
+ void *socket = zmq_socket (ctx, ZMQ_PULL);
+ assert (socket);
+
+ // Spawn a thread to receive on socket
+ void *receiver_thread = zmq_threadstart (&receiver, socket);
+
+ // Wait for thread to start up and block
+ msleep (SETTLE_TIME);
+
+ // Shutdown context, if we used destroy here we would deadlock.
+ rc = zmq_ctx_shutdown (ctx);
+ assert (rc == 0);
+
+ // Wait for thread to finish
+ zmq_threadclose (receiver_thread);
+
+ // Close the socket.
+ rc = zmq_close (socket);
+ assert (rc == 0);
+
+ // Destory the context, will now not hang as we have closed the socket.
+ rc = zmq_ctx_destroy (ctx);
+ assert (rc == 0);
+}
+
+int main (void)
+{
+ setup_test_environment();
+
+ test_ctx_destroy();
+ test_ctx_shutdown();
+
+ return 0;
+}
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "testutil.hpp"
+
+int main (void)
+{
+ setup_test_environment();
+ int rc;
+
+ // Set up our context and sockets
+ void *ctx = zmq_ctx_new ();
+ assert (ctx);
+
+ assert (zmq_ctx_get (ctx, ZMQ_MAX_SOCKETS) == ZMQ_MAX_SOCKETS_DFLT);
+ assert (zmq_ctx_get (ctx, ZMQ_IO_THREADS) == ZMQ_IO_THREADS_DFLT);
+ assert (zmq_ctx_get (ctx, ZMQ_IPV6) == 0);
+
+ rc = zmq_ctx_set (ctx, ZMQ_IPV6, true);
+ assert (zmq_ctx_get (ctx, ZMQ_IPV6) == 1);
+
+ void *router = zmq_socket (ctx, ZMQ_ROUTER);
+ int ipv6;
+ size_t optsize = sizeof (int);
+ rc = zmq_getsockopt (router, ZMQ_IPV6, &ipv6, &optsize);
+ assert (rc == 0);
+ assert (ipv6);
+
+ rc = zmq_close (router);
+ assert (rc == 0);
+
+ rc = zmq_ctx_term (ctx);
+ assert (rc == 0);
+
+ return 0;
+}
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "testutil.hpp"
+
+/// Initialize a zeromq message with a given null-terminated string
+#define ZMQ_PREPARE_STRING(msg, data, size) \
+zmq_msg_init(&msg) && printf("zmq_msg_init: %s\n", zmq_strerror(errno)); \
+zmq_msg_init_size (&msg, size + 1) && printf("zmq_msg_init_size: %s\n",zmq_strerror(errno)); \
+memcpy(zmq_msg_data(&msg), data, size + 1);
+
+int publicationsReceived = 0;
+bool isSubscribed = false;
+
+int main(int argc, char** argv) {
+ setup_test_environment();
+ void* context = zmq_ctx_new();
+ void* pubSocket;
+ void* subSocket;
+
+ (pubSocket = zmq_socket(context, ZMQ_XPUB)) || printf("zmq_socket: %s\n", zmq_strerror(errno));
+ (subSocket = zmq_socket(context, ZMQ_SUB)) || printf("zmq_socket: %s\n", zmq_strerror(errno));
+ zmq_setsockopt(subSocket, ZMQ_SUBSCRIBE, "foo", 3) && printf("zmq_setsockopt: %s\n",zmq_strerror(errno));
+
+ zmq_bind(pubSocket, "inproc://someInProcDescriptor") && printf("zmq_bind: %s\n", zmq_strerror(errno));
+ //zmq_bind(pubSocket, "tcp://127.0.0.1:30010") && printf("zmq_bind: %s\n", zmq_strerror(errno));
+
+ int more;
+ size_t more_size = sizeof(more);
+ int iteration = 0;
+
+ while (1) {
+ zmq_pollitem_t items [] = {
+ { subSocket, 0, ZMQ_POLLIN, 0 }, // read publications
+ { pubSocket, 0, ZMQ_POLLIN, 0 }, // read subscriptions
+ };
+ int rc = zmq_poll (items, 2, 100);
+
+ if (items [1].revents & ZMQ_POLLIN) {
+ while (1) {
+ zmq_msg_t msg;
+ zmq_msg_init (&msg);
+ zmq_msg_recv (&msg, pubSocket, 0);
+ char* buffer = (char*)zmq_msg_data(&msg);
+
+ if (buffer[0] == 0) {
+ assert(isSubscribed);
+ isSubscribed = false;
+ }
+ else {
+ assert(!isSubscribed);
+ isSubscribed = true;
+ }
+
+ zmq_getsockopt (pubSocket, ZMQ_RCVMORE, &more, &more_size);
+ zmq_msg_close (&msg);
+
+ if (!more)
+ break; // Last message part
+ }
+ }
+
+ if (items[0].revents & ZMQ_POLLIN) {
+ while (1) {
+ zmq_msg_t msg;
+ zmq_msg_init (&msg);
+ zmq_msg_recv (&msg, subSocket, 0);
+ zmq_getsockopt (subSocket, ZMQ_RCVMORE, &more, &more_size);
+ zmq_msg_close (&msg);
+
+ if (!more) {
+ publicationsReceived++;
+ break; // Last message part
+ }
+ }
+ }
+ if (iteration == 1) {
+ zmq_connect(subSocket, "inproc://someInProcDescriptor") && printf("zmq_connect: %s\n", zmq_strerror(errno));
+ //zmq_connect(subSocket, "tcp://127.0.0.1:30010") && printf("zmq_connect: %s\n", zmq_strerror(errno));
+ }
+ if (iteration == 4) {
+ zmq_disconnect(subSocket, "inproc://someInProcDescriptor") && printf("zmq_disconnect(%d): %s\n", errno, zmq_strerror(errno));
+ //zmq_disconnect(subSocket, "tcp://127.0.0.1:30010") && printf("zmq_disconnect: %s\n", zmq_strerror(errno));
+ }
+ if (iteration > 4 && rc == 0)
+ break;
+
+ zmq_msg_t channelEnvlp;
+ ZMQ_PREPARE_STRING(channelEnvlp, "foo", 3);
+ zmq_msg_send (&channelEnvlp, pubSocket, ZMQ_SNDMORE) >= 0 || printf("zmq_msg_send: %s\n",zmq_strerror(errno));
+ zmq_msg_close(&channelEnvlp) && printf("zmq_msg_close: %s\n",zmq_strerror(errno));
+
+ zmq_msg_t message;
+ ZMQ_PREPARE_STRING(message, "this is foo!", 12);
+ zmq_msg_send (&message, pubSocket, 0) >= 0 || printf("zmq_msg_send: %s\n",zmq_strerror(errno));
+ zmq_msg_close(&message) && printf("zmq_msg_close: %s\n",zmq_strerror(errno));
+
+ iteration++;
+ }
+ assert(publicationsReceived == 3);
+ assert(!isSubscribed);
+
+ zmq_close(pubSocket) && printf("zmq_close: %s", zmq_strerror(errno));
+ zmq_close(subSocket) && printf("zmq_close: %s", zmq_strerror(errno));
+
+ zmq_ctx_term(context);
+ return 0;
+}
+
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "testutil.hpp"
+
+const char *address = "tcp://127.0.0.1:6571";
+
+#define NUM_MESSAGES 5
+
+int main (void)
+{
+ setup_test_environment ();
+ void *ctx = zmq_ctx_new ();
+ assert (ctx);
+
+ // Create and bind pull socket to receive messages
+ void *pull = zmq_socket (ctx, ZMQ_PULL);
+ assert (pull);
+ int rc = zmq_bind (pull, address);
+ assert (rc == 0);
+
+ int pid = fork ();
+ if (pid == 0) {
+ // Child process
+ // Immediately close parent sockets and context
+ zmq_close (pull);
+ zmq_term (ctx);
+
+ // Create new context, socket, connect and send some messages
+ void *child_ctx = zmq_ctx_new ();
+ assert (child_ctx);
+ void *push = zmq_socket (child_ctx, ZMQ_PUSH);
+ assert (push);
+ rc = zmq_connect (push, address);
+ assert (rc == 0);
+ int count;
+ for (count = 0; count < NUM_MESSAGES; count++)
+ zmq_send (push, "Hello", 5, 0);
+
+ zmq_close (push);
+ zmq_ctx_destroy (child_ctx);
+ exit (0);
+ }
+ else {
+ // Parent process
+ int count;
+ for (count = 0; count < NUM_MESSAGES; count++) {
+ char buffer [5];
+ int num_bytes = zmq_recv (pull, buffer, 5, 0);
+ assert (num_bytes == 5);
+ }
+ int child_status;
+ while (true) {
+ rc = waitpid (pid, &child_status, 0);
+ if (rc == -1 && errno == EINTR)
+ continue;
+ assert (rc > 0);
+ // Verify the status code of the child was zero
+ assert (WEXITSTATUS (child_status) == 0);
+ break;
+ }
+ exit (0);
+ }
+ return 0;
+}
/*
- Copyright (c) 2010-2011 250bpm s.r.o.
- Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-
-#include <stdio.h>
#include "testutil.hpp"
-int main (void)
-{
- fprintf (stderr, "test_hwm running...\n");
+const int MAX_SENDS = 10000;
- void *ctx = zmq_init (1);
+enum TestType { BIND_FIRST, CONNECT_FIRST };
+
+int test_defaults ()
+{
+ void *ctx = zmq_ctx_new ();
assert (ctx);
+ int rc;
- // Create pair of socket, each with high watermark of 2. Thus the total
- // buffer space should be 4 messages.
- void *sb = zmq_socket (ctx, ZMQ_PULL);
- assert (sb);
- int hwm = 2;
- int rc = zmq_setsockopt (sb, ZMQ_RCVHWM, &hwm, sizeof (hwm));
+ // Set up bind socket
+ void *bind_socket = zmq_socket (ctx, ZMQ_PULL);
+ assert (bind_socket);
+ rc = zmq_bind (bind_socket, "inproc://a");
assert (rc == 0);
- rc = zmq_bind (sb, "inproc://a");
+
+ // Set up connect socket
+ void *connect_socket = zmq_socket (ctx, ZMQ_PUSH);
+ assert (connect_socket);
+ rc = zmq_connect (connect_socket, "inproc://a");
+ assert (rc == 0);
+
+ // Send until we block
+ int send_count = 0;
+ while (send_count < MAX_SENDS && zmq_send (connect_socket, NULL, 0, ZMQ_DONTWAIT) == 0)
+ ++send_count;
+
+ // Now receive all sent messages
+ int recv_count = 0;
+ while (zmq_recv (bind_socket, NULL, 0, ZMQ_DONTWAIT) == 0)
+ ++recv_count;
+
+ assert (send_count == recv_count);
+
+ // Clean up
+ rc = zmq_close (connect_socket);
assert (rc == 0);
- void *sc = zmq_socket (ctx, ZMQ_PUSH);
- assert (sc);
- rc = zmq_setsockopt (sc, ZMQ_SNDHWM, &hwm, sizeof (hwm));
+ rc = zmq_close (bind_socket);
assert (rc == 0);
- rc = zmq_connect (sc, "inproc://a");
+
+ rc = zmq_ctx_term (ctx);
assert (rc == 0);
- // Try to send 10 messages. Only 4 should succeed.
- for (int i = 0; i < 10; i++)
+ return send_count;
+}
+
+int count_msg (int send_hwm, int recv_hwm, TestType testType)
+{
+ void *ctx = zmq_ctx_new ();
+ assert (ctx);
+ int rc;
+
+ void *bind_socket;
+ void *connect_socket;
+ if (testType == BIND_FIRST)
{
- int rc = zmq_send (sc, NULL, 0, ZMQ_DONTWAIT);
- if (i < 4)
- assert (rc == 0);
- else
- assert (rc < 0 && errno == EAGAIN);
+ // Set up bind socket
+ bind_socket = zmq_socket (ctx, ZMQ_PULL);
+ assert (bind_socket);
+ rc = zmq_setsockopt (bind_socket, ZMQ_RCVHWM, &recv_hwm, sizeof (recv_hwm));
+ assert (rc == 0);
+ rc = zmq_bind (bind_socket, "inproc://a");
+ assert (rc == 0);
+
+ // Set up connect socket
+ connect_socket = zmq_socket (ctx, ZMQ_PUSH);
+ assert (connect_socket);
+ rc = zmq_setsockopt (connect_socket, ZMQ_SNDHWM, &send_hwm, sizeof (send_hwm));
+ assert (rc == 0);
+ rc = zmq_connect (connect_socket, "inproc://a");
+ assert (rc == 0);
}
+ else
+ {
+ // Set up connect socket
+ connect_socket = zmq_socket (ctx, ZMQ_PUSH);
+ assert (connect_socket);
+ rc = zmq_setsockopt (connect_socket, ZMQ_SNDHWM, &send_hwm, sizeof (send_hwm));
+ assert (rc == 0);
+ rc = zmq_connect (connect_socket, "inproc://a");
+ assert (rc == 0);
- // There should be now 4 messages pending, consume them.
- for (int i = 0; i != 4; i++) {
- rc = zmq_recv (sb, NULL, 0, 0);
+ // Set up bind socket
+ bind_socket = zmq_socket (ctx, ZMQ_PULL);
+ assert (bind_socket);
+ rc = zmq_setsockopt (bind_socket, ZMQ_RCVHWM, &recv_hwm, sizeof (recv_hwm));
+ assert (rc == 0);
+ rc = zmq_bind (bind_socket, "inproc://a");
assert (rc == 0);
}
+ // Send until we block
+ int send_count = 0;
+ while (send_count < MAX_SENDS && zmq_send (connect_socket, NULL, 0, ZMQ_DONTWAIT) == 0)
+ ++send_count;
+
+ // Now receive all sent messages
+ int recv_count = 0;
+ while (zmq_recv (bind_socket, NULL, 0, ZMQ_DONTWAIT) == 0)
+ ++recv_count;
+
+ assert (send_count == recv_count);
+
// Now it should be possible to send one more.
- rc = zmq_send (sc, NULL, 0, 0);
+ rc = zmq_send (connect_socket, NULL, 0, 0);
assert (rc == 0);
// Consume the remaining message.
- rc = zmq_recv (sb, NULL, 0, 0);
+ rc = zmq_recv (bind_socket, NULL, 0, 0);
+ assert (rc == 0);
+
+ // Clean up
+ rc = zmq_close (connect_socket);
+ assert (rc == 0);
+
+ rc = zmq_close (bind_socket);
+ assert (rc == 0);
+
+ rc = zmq_ctx_term (ctx);
+ assert (rc == 0);
+
+ return send_count;
+}
+
+int test_inproc_bind_first (int send_hwm, int recv_hwm)
+{
+ return count_msg(send_hwm, recv_hwm, BIND_FIRST);
+}
+
+int test_inproc_connect_first (int send_hwm, int recv_hwm)
+{
+ return count_msg(send_hwm, recv_hwm, CONNECT_FIRST);
+}
+
+int test_inproc_connect_and_close_first (int send_hwm, int recv_hwm)
+{
+ void *ctx = zmq_ctx_new ();
+ assert (ctx);
+ int rc;
+
+ // Set up connect socket
+ void *connect_socket = zmq_socket (ctx, ZMQ_PUSH);
+ assert (connect_socket);
+ rc = zmq_setsockopt (connect_socket, ZMQ_SNDHWM, &send_hwm, sizeof (send_hwm));
+ assert (rc == 0);
+ rc = zmq_connect (connect_socket, "inproc://a");
+ assert (rc == 0);
+
+ // Send until we block
+ int send_count = 0;
+ while (send_count < MAX_SENDS && zmq_send (connect_socket, NULL, 0, ZMQ_DONTWAIT) == 0)
+ ++send_count;
+
+ // Close connect
+ rc = zmq_close (connect_socket);
+ assert (rc == 0);
+
+ // Set up bind socket
+ void *bind_socket = zmq_socket (ctx, ZMQ_PULL);
+ assert (bind_socket);
+ rc = zmq_setsockopt (bind_socket, ZMQ_RCVHWM, &recv_hwm, sizeof (recv_hwm));
assert (rc == 0);
+ rc = zmq_bind (bind_socket, "inproc://a");
+ assert (rc == 0);
+
+ // Now receive all sent messages
+ int recv_count = 0;
+ while (zmq_recv (bind_socket, NULL, 0, ZMQ_DONTWAIT) == 0)
+ ++recv_count;
+
+ assert (send_count == recv_count);
- rc = zmq_close (sc);
+ // Clean up
+ rc = zmq_close (bind_socket);
assert (rc == 0);
- rc = zmq_close (sb);
+ rc = zmq_ctx_term (ctx);
assert (rc == 0);
- rc = zmq_term (ctx);
+ return send_count;
+}
+
+int test_inproc_bind_and_close_first (int send_hwm, int recv_hwm)
+{
+ void *ctx = zmq_ctx_new ();
+ assert (ctx);
+ int rc;
+
+ // Set up bind socket
+ void *bind_socket = zmq_socket (ctx, ZMQ_PUSH);
+ assert (bind_socket);
+ rc = zmq_setsockopt (bind_socket, ZMQ_SNDHWM, &send_hwm, sizeof (send_hwm));
+ assert (rc == 0);
+ rc = zmq_bind (bind_socket, "inproc://a");
assert (rc == 0);
- return 0;
+ // Send until we block
+ int send_count = 0;
+ while (send_count < MAX_SENDS && zmq_send (bind_socket, NULL, 0, ZMQ_DONTWAIT) == 0)
+ ++send_count;
+
+ // Close bind
+ rc = zmq_close (bind_socket);
+ assert (rc == 0);
+
+ /* Can't currently do connect without then wiring up a bind as things hang, this needs top be fixed.
+ // Set up connect socket
+ void *connect_socket = zmq_socket (ctx, ZMQ_PULL);
+ assert (connect_socket);
+ rc = zmq_setsockopt (connect_socket, ZMQ_RCVHWM, &recv_hwm, sizeof (recv_hwm));
+ assert (rc == 0);
+ rc = zmq_connect (connect_socket, "inproc://a");
+ assert (rc == 0);
+
+ // Now receive all sent messages
+ int recv_count = 0;
+ while (zmq_recv (connect_socket, NULL, 0, ZMQ_DONTWAIT) == 0)
+ ++recv_count;
+
+ assert (send_count == recv_count);
+ */
+
+ // Clean up
+ //rc = zmq_close (connect_socket);
+ //assert (rc == 0);
+
+ rc = zmq_ctx_term (ctx);
+ assert (rc == 0);
+
+ return send_count;
+}
+
+int main (void)
+{
+ setup_test_environment();
+
+ int count;
+
+ // Default values are 1000 on send and 1000 one receive, so 2000 total
+ count = test_defaults ();
+ assert (count == 2000);
+
+ // Infinite send and receive buffer
+ count = test_inproc_bind_first (0, 0);
+ assert (count == MAX_SENDS);
+ count = test_inproc_connect_first (0, 0);
+ assert (count == MAX_SENDS);
+
+ // Infinite send buffer
+ count = test_inproc_bind_first (1, 0);
+ assert (count == MAX_SENDS);
+ count = test_inproc_connect_first (1, 0);
+ assert (count == MAX_SENDS);
+
+ // Infinite receive buffer
+ count = test_inproc_bind_first (0, 1);
+ assert (count == MAX_SENDS);
+ count = test_inproc_connect_first (0, 1);
+ assert (count == MAX_SENDS);
+
+ // Send and recv buffers hwm 1, so total that can be queued is 2
+ count = test_inproc_bind_first (1, 1);
+ assert (count == 2);
+ count = test_inproc_connect_first (1, 1);
+ assert (count == 2);
+
+ // Send hwm of 1, send before bind so total that can be queued is 1
+ count = test_inproc_connect_and_close_first (1, 0);
+ assert (count == 1);
+
+ // Send hwm of 1, send from bind side before connect so total that can be queued should be 1,
+ // however currently all messages get thrown away before the connect. BUG?
+ count = test_inproc_bind_and_close_first (1, 0);
+ //assert (count == 1);
+
+ return 0;
}
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "testutil.hpp"
+
+int main (void)
+{
+ setup_test_environment();
+ int val;
+ int rc;
+ char buffer[16];
+ // TEST 1.
+ // First we're going to attempt to send messages to two
+ // pipes, one connected, the other not. We should see
+ // the PUSH load balancing to both pipes, and hence half
+ // of the messages getting queued, as connect() creates a
+ // pipe immediately.
+
+ void *context = zmq_ctx_new();
+ assert (context);
+ void *to = zmq_socket(context, ZMQ_PULL);
+ assert (to);
+
+ // Bind the one valid receiver
+ val = 0;
+ rc = zmq_setsockopt(to, ZMQ_LINGER, &val, sizeof(val));
+ assert (rc == 0);
+ rc = zmq_bind (to, "tcp://127.0.0.1:6555");
+ assert (rc == 0);
+
+ // Create a socket pushing to two endpoints - only 1 message should arrive.
+ void *from = zmq_socket (context, ZMQ_PUSH);
+ assert(from);
+
+ val = 0;
+ zmq_setsockopt (from, ZMQ_LINGER, &val, sizeof (val));
+ // This pipe will not connect
+ rc = zmq_connect (from, "tcp://localhost:5556");
+ assert (rc == 0);
+ // This pipe will
+ rc = zmq_connect (from, "tcp://localhost:6555");
+ assert (rc == 0);
+
+ // We send 10 messages, 5 should just get stuck in the queue
+ // for the not-yet-connected pipe
+ for (int i = 0; i < 10; ++i) {
+ rc = zmq_send (from, "Hello", 5, 0);
+ assert (rc == 5);
+ }
+
+ // We now consume from the connected pipe
+ // - we should see just 5
+ int timeout = 100;
+ rc = zmq_setsockopt (to, ZMQ_RCVTIMEO, &timeout, sizeof (int));
+ assert (rc == 0);
+
+ int seen = 0;
+ while (true) {
+ rc = zmq_recv (to, &buffer, sizeof (buffer), 0);
+ if (rc == -1)
+ break; // Break when we didn't get a message
+ seen++;
+ }
+ assert (seen == 5);
+
+ rc = zmq_close (from);
+ assert (rc == 0);
+
+ rc = zmq_close (to);
+ assert (rc == 0);
+
+ rc = zmq_ctx_term (context);
+ assert (rc == 0);
+
+ // TEST 2
+ // This time we will do the same thing, connect two pipes,
+ // one of which will succeed in connecting to a bound
+ // receiver, the other of which will fail. However, we will
+ // also set the delay attach on connect flag, which should
+ // cause the pipe attachment to be delayed until the connection
+ // succeeds.
+ context = zmq_ctx_new();
+
+ // Bind the valid socket
+ to = zmq_socket (context, ZMQ_PULL);
+ assert (to);
+ rc = zmq_bind (to, "tcp://127.0.0.1:5560");
+ assert (rc == 0);
+
+ val = 0;
+ rc = zmq_setsockopt (to, ZMQ_LINGER, &val, sizeof(val));
+ assert (rc == 0);
+
+ // Create a socket pushing to two endpoints - all messages should arrive.
+ from = zmq_socket (context, ZMQ_PUSH);
+ assert (from);
+
+ val = 0;
+ rc = zmq_setsockopt (from, ZMQ_LINGER, &val, sizeof(val));
+ assert (rc == 0);
+
+ // Set the key flag
+ val = 1;
+ rc = zmq_setsockopt (from, ZMQ_IMMEDIATE, &val, sizeof(val));
+ assert (rc == 0);
+
+ // Connect to the invalid socket
+ rc = zmq_connect (from, "tcp://localhost:5561");
+ assert (rc == 0);
+ // Connect to the valid socket
+ rc = zmq_connect (from, "tcp://localhost:5560");
+ assert (rc == 0);
+
+ // Send 10 messages, all should be routed to the connected pipe
+ for (int i = 0; i < 10; ++i) {
+ rc = zmq_send (from, "Hello", 5, 0);
+ assert (rc == 5);
+ }
+ rc = zmq_setsockopt (to, ZMQ_RCVTIMEO, &timeout, sizeof (int));
+ assert (rc == 0);
+
+ seen = 0;
+ while (true) {
+ rc = zmq_recv (to, &buffer, sizeof (buffer), 0);
+ if (rc == -1)
+ break; // Break when we didn't get a message
+ seen++;
+ }
+ assert (seen == 10);
+
+ rc = zmq_close (from);
+ assert (rc == 0);
+
+ rc = zmq_close (to);
+ assert (rc == 0);
+
+ rc = zmq_ctx_term (context);
+ assert (rc == 0);
+
+ // TEST 3
+ // This time we want to validate that the same blocking behaviour
+ // occurs with an existing connection that is broken. We will send
+ // messages to a connected pipe, disconnect and verify the messages
+ // block. Then we reconnect and verify messages flow again.
+ context = zmq_ctx_new ();
+
+ void *backend = zmq_socket (context, ZMQ_DEALER);
+ assert (backend);
+ void *frontend = zmq_socket (context, ZMQ_DEALER);
+ assert (frontend);
+ int zero = 0;
+ rc = zmq_setsockopt (backend, ZMQ_LINGER, &zero, sizeof (zero));
+ assert (rc == 0);
+ rc = zmq_setsockopt (frontend, ZMQ_LINGER, &zero, sizeof (zero));
+ assert (rc == 0);
+
+ // Frontend connects to backend using IMMEDIATE
+ int on = 1;
+ rc = zmq_setsockopt (frontend, ZMQ_IMMEDIATE, &on, sizeof (on));
+ assert (rc == 0);
+ rc = zmq_bind (backend, "tcp://127.0.0.1:5560");
+ assert (rc == 0);
+ rc = zmq_connect (frontend, "tcp://localhost:5560");
+ assert (rc == 0);
+
+ // Ping backend to frontend so we know when the connection is up
+ rc = zmq_send (backend, "Hello", 5, 0);
+ assert (rc == 5);
+ rc = zmq_recv (frontend, buffer, 255, 0);
+ assert (rc == 5);
+
+ // Send message from frontend to backend
+ rc = zmq_send (frontend, "Hello", 5, ZMQ_DONTWAIT);
+ assert (rc == 5);
+
+ rc = zmq_close (backend);
+ assert (rc == 0);
+
+ // Give time to process disconnect
+ msleep (SETTLE_TIME);
+
+ // Send a message, should fail
+ rc = zmq_send (frontend, "Hello", 5, ZMQ_DONTWAIT);
+ assert (rc == -1);
+
+ // Recreate backend socket
+ backend = zmq_socket (context, ZMQ_DEALER);
+ assert (backend);
+ rc = zmq_setsockopt (backend, ZMQ_LINGER, &zero, sizeof (zero));
+ assert (rc == 0);
+ rc = zmq_bind (backend, "tcp://127.0.0.1:5560");
+ assert (rc == 0);
+
+ // Ping backend to frontend so we know when the connection is up
+ rc = zmq_send (backend, "Hello", 5, 0);
+ assert (rc == 5);
+ rc = zmq_recv (frontend, buffer, 255, 0);
+ assert (rc == 5);
+
+ // After the reconnect, should succeed
+ rc = zmq_send (frontend, "Hello", 5, ZMQ_DONTWAIT);
+ assert (rc == 5);
+
+ rc = zmq_close (backend);
+ assert (rc == 0);
+
+ rc = zmq_close (frontend);
+ assert (rc == 0);
+
+ rc = zmq_ctx_term (context);
+ assert (rc == 0);
+}
--- /dev/null
+/*
+ Copyright (c) 2007-2014 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "testutil.hpp"
+
+static void pusher (void *ctx)
+{
+ // Connect first
+ void *connectSocket = zmq_socket (ctx, ZMQ_PAIR);
+ assert (connectSocket);
+ int rc = zmq_connect (connectSocket, "inproc://a");
+ assert (rc == 0);
+
+ // Queue up some data
+ rc = zmq_send_const (connectSocket, "foobar", 6, 0);
+ assert (rc == 6);
+
+ // Cleanup
+ rc = zmq_close (connectSocket);
+ assert (rc == 0);
+}
+
+void test_bind_before_connect()
+{
+ void *ctx = zmq_ctx_new ();
+ assert (ctx);
+
+ // Bind first
+ void *bindSocket = zmq_socket (ctx, ZMQ_PAIR);
+ assert (bindSocket);
+ int rc = zmq_bind (bindSocket, "inproc://a");
+ assert (rc == 0);
+
+ // Now connect
+ void *connectSocket = zmq_socket (ctx, ZMQ_PAIR);
+ assert (connectSocket);
+ rc = zmq_connect (connectSocket, "inproc://a");
+ assert (rc == 0);
+
+ // Queue up some data
+ rc = zmq_send_const (connectSocket, "foobar", 6, 0);
+ assert (rc == 6);
+
+ // Read pending message
+ zmq_msg_t msg;
+ rc = zmq_msg_init (&msg);
+ assert (rc == 0);
+ rc = zmq_msg_recv (&msg, bindSocket, 0);
+ assert (rc == 6);
+ void *data = zmq_msg_data (&msg);
+ assert (memcmp ("foobar", data, 6) == 0);
+
+ // Cleanup
+ rc = zmq_close (connectSocket);
+ assert (rc == 0);
+
+ rc = zmq_close (bindSocket);
+ assert (rc == 0);
+
+ rc = zmq_ctx_term (ctx);
+ assert (rc == 0);
+}
+
+void test_connect_before_bind()
+{
+ void *ctx = zmq_ctx_new ();
+ assert (ctx);
+
+ // Connect first
+ void *connectSocket = zmq_socket (ctx, ZMQ_PAIR);
+ assert (connectSocket);
+ int rc = zmq_connect (connectSocket, "inproc://a");
+ assert (rc == 0);
+
+ // Queue up some data
+ rc = zmq_send_const (connectSocket, "foobar", 6, 0);
+ assert (rc == 6);
+
+ // Now bind
+ void *bindSocket = zmq_socket (ctx, ZMQ_PAIR);
+ assert (bindSocket);
+ rc = zmq_bind (bindSocket, "inproc://a");
+ assert (rc == 0);
+
+ // Read pending message
+ zmq_msg_t msg;
+ rc = zmq_msg_init (&msg);
+ assert (rc == 0);
+ rc = zmq_msg_recv (&msg, bindSocket, 0);
+ assert (rc == 6);
+ void *data = zmq_msg_data (&msg);
+ assert (memcmp ("foobar", data, 6) == 0);
+
+ // Cleanup
+ rc = zmq_close (connectSocket);
+ assert (rc == 0);
+
+ rc = zmq_close (bindSocket);
+ assert (rc == 0);
+
+ rc = zmq_ctx_term (ctx);
+ assert (rc == 0);
+}
+
+void test_connect_before_bind_pub_sub()
+{
+ void *ctx = zmq_ctx_new ();
+ assert (ctx);
+
+ // Connect first
+ void *connectSocket = zmq_socket (ctx, ZMQ_PUB);
+ assert (connectSocket);
+ int rc = zmq_connect (connectSocket, "inproc://a");
+ assert (rc == 0);
+
+ // Queue up some data, this will be dropped
+ rc = zmq_send_const (connectSocket, "before", 6, 0);
+ assert (rc == 6);
+
+ // Now bind
+ void *bindSocket = zmq_socket (ctx, ZMQ_SUB);
+ assert (bindSocket);
+ rc = zmq_setsockopt (bindSocket, ZMQ_SUBSCRIBE, "", 0);
+ assert (rc == 0);
+ rc = zmq_bind (bindSocket, "inproc://a");
+ assert (rc == 0);
+
+ // Wait for pub-sub connection to happen
+ msleep (SETTLE_TIME);
+
+ // Queue up some data, this not will be dropped
+ rc = zmq_send_const (connectSocket, "after", 6, 0);
+ assert (rc == 6);
+
+ // Read pending message
+ zmq_msg_t msg;
+ rc = zmq_msg_init (&msg);
+ assert (rc == 0);
+ rc = zmq_msg_recv (&msg, bindSocket, 0);
+ assert (rc == 6);
+ void *data = zmq_msg_data (&msg);
+ assert (memcmp ("after", data, 5) == 0);
+
+ // Cleanup
+ rc = zmq_close (connectSocket);
+ assert (rc == 0);
+
+ rc = zmq_close (bindSocket);
+ assert (rc == 0);
+
+ rc = zmq_ctx_term (ctx);
+ assert (rc == 0);
+}
+
+void test_multiple_connects()
+{
+ const unsigned int no_of_connects = 10;
+ void *ctx = zmq_ctx_new ();
+ assert (ctx);
+
+ int rc;
+ void *connectSocket[no_of_connects];
+
+ // Connect first
+ for (unsigned int i = 0; i < no_of_connects; ++i)
+ {
+ connectSocket [i] = zmq_socket (ctx, ZMQ_PUSH);
+ assert (connectSocket [i]);
+ rc = zmq_connect (connectSocket [i], "inproc://a");
+ assert (rc == 0);
+
+ // Queue up some data
+ rc = zmq_send_const (connectSocket [i], "foobar", 6, 0);
+ assert (rc == 6);
+ }
+
+ // Now bind
+ void *bindSocket = zmq_socket (ctx, ZMQ_PULL);
+ assert (bindSocket);
+ rc = zmq_bind (bindSocket, "inproc://a");
+ assert (rc == 0);
+
+ for (unsigned int i = 0; i < no_of_connects; ++i)
+ {
+ // Read pending message
+ zmq_msg_t msg;
+ rc = zmq_msg_init (&msg);
+ assert (rc == 0);
+ rc = zmq_msg_recv (&msg, bindSocket, 0);
+ assert (rc == 6);
+ void *data = zmq_msg_data (&msg);
+ assert (memcmp ("foobar", data, 6) == 0);
+ }
+
+ // Cleanup
+ for (unsigned int i = 0; i < no_of_connects; ++i)
+ {
+ rc = zmq_close (connectSocket [i]);
+ assert (rc == 0);
+ }
+
+ rc = zmq_close (bindSocket);
+ assert (rc == 0);
+
+ rc = zmq_ctx_term (ctx);
+ assert (rc == 0);
+}
+
+void test_multiple_threads()
+{
+ const unsigned int no_of_threads = 30;
+ void *ctx = zmq_ctx_new ();
+ assert (ctx);
+
+ int rc;
+ void *threads [no_of_threads];
+
+ // Connect first
+ for (unsigned int i = 0; i < no_of_threads; ++i)
+ {
+ threads [i] = zmq_threadstart (&pusher, ctx);
+ }
+
+ // Now bind
+ void *bindSocket = zmq_socket (ctx, ZMQ_PULL);
+ assert (bindSocket);
+ rc = zmq_bind (bindSocket, "inproc://a");
+ assert (rc == 0);
+
+ for (unsigned int i = 0; i < no_of_threads; ++i)
+ {
+ // Read pending message
+ zmq_msg_t msg;
+ rc = zmq_msg_init (&msg);
+ assert (rc == 0);
+ rc = zmq_msg_recv (&msg, bindSocket, 0);
+ assert (rc == 6);
+ void *data = zmq_msg_data (&msg);
+ assert (memcmp ("foobar", data, 6) == 0);
+ }
+
+ // Cleanup
+ for (unsigned int i = 0; i < no_of_threads; ++i)
+ {
+ zmq_threadclose (threads [i]);
+ }
+
+ rc = zmq_close (bindSocket);
+ assert (rc == 0);
+
+ rc = zmq_ctx_term (ctx);
+ assert (rc == 0);
+}
+
+void test_identity()
+{
+ // Create the infrastructure
+ void *ctx = zmq_ctx_new ();
+ assert (ctx);
+
+ void *sc = zmq_socket (ctx, ZMQ_DEALER);
+ assert (sc);
+
+ int rc = zmq_connect (sc, "inproc://a");
+ assert (rc == 0);
+
+ void *sb = zmq_socket (ctx, ZMQ_ROUTER);
+ assert (sb);
+
+ rc = zmq_bind (sb, "inproc://a");
+ assert (rc == 0);
+
+ // Send 2-part message.
+ rc = zmq_send (sc, "A", 1, ZMQ_SNDMORE);
+ assert (rc == 1);
+ rc = zmq_send (sc, "B", 1, 0);
+ assert (rc == 1);
+
+ // Identity comes first.
+ zmq_msg_t msg;
+ rc = zmq_msg_init (&msg);
+ assert (rc == 0);
+ rc = zmq_msg_recv (&msg, sb, 0);
+ assert (rc >= 0);
+ int more = zmq_msg_more (&msg);
+ assert (more == 1);
+
+ // Then the first part of the message body.
+ rc = zmq_msg_recv (&msg, sb, 0);
+ assert (rc == 1);
+ more = zmq_msg_more (&msg);
+ assert (more == 1);
+
+ // And finally, the second part of the message body.
+ rc = zmq_msg_recv (&msg, sb, 0);
+ assert (rc == 1);
+ more = zmq_msg_more (&msg);
+ assert (more == 0);
+
+ // Deallocate the infrastructure.
+ rc = zmq_close (sc);
+ assert (rc == 0);
+
+ rc = zmq_close (sb);
+ assert (rc == 0);
+
+ rc = zmq_ctx_term (ctx);
+ assert (rc == 0);
+}
+
+void test_connect_only ()
+{
+ void *ctx = zmq_ctx_new ();
+ assert (ctx);
+
+ void *connectSocket = zmq_socket (ctx, ZMQ_PUSH);
+ assert (connectSocket);
+ int rc = zmq_connect (connectSocket, "inproc://a");
+ assert (rc == 0);
+
+ rc = zmq_close (connectSocket);
+ assert (rc == 0);
+
+ rc = zmq_ctx_term (ctx);
+ assert (rc == 0);
+}
+
+int main (void)
+{
+ setup_test_environment();
+
+ test_bind_before_connect ();
+ test_connect_before_bind ();
+ test_connect_before_bind_pub_sub ();
+ test_multiple_connects ();
+ test_multiple_threads ();
+ test_identity ();
+ test_connect_only ();
+
+ return 0;
+}
/*
- Copyright (c) 2010-2011 250bpm s.r.o.
- Copyright (c) 2011 VMware, Inc.
- Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "../include/zmq.h"
-#include <stdio.h>
-
-#undef NDEBUG
-#include <assert.h>
+#include "testutil.hpp"
int main (void)
{
- fprintf (stderr, "test_invalid_rep running...\n");
-
+ setup_test_environment();
// Create REQ/ROUTER wiring.
- void *ctx = zmq_init (1);
+ void *ctx = zmq_ctx_new ();
assert (ctx);
+
void *router_socket = zmq_socket (ctx, ZMQ_ROUTER);
assert (router_socket);
+
void *req_socket = zmq_socket (ctx, ZMQ_REQ);
assert (req_socket);
+
int linger = 0;
int rc = zmq_setsockopt (router_socket, ZMQ_LINGER, &linger, sizeof (int));
assert (rc == 0);
// Check whether we've got the valid reply.
rc = zmq_recv (req_socket, body, sizeof (body), 0);
assert (rc == 1);
- assert (body [0] == 'b');
+ assert (body [0] == 'b');
// Tear down the wiring.
rc = zmq_close (router_socket);
assert (rc == 0);
rc = zmq_close (req_socket);
assert (rc == 0);
- rc = zmq_term (ctx);
+ rc = zmq_ctx_term (ctx);
assert (rc == 0);
return 0;
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "testutil.hpp"
+
+// XSI vector I/O
+#if defined ZMQ_HAVE_UIO
+#include <sys/uio.h>
+#else
+struct iovec {
+ void *iov_base;
+ size_t iov_len;
+};
+#endif
+
+void do_check(void* sb, void* sc, unsigned int msgsz)
+{
+ setup_test_environment();
+ int rc;
+ int sum =0;
+ for (int i = 0; i < 10; i++)
+ {
+ zmq_msg_t msg;
+ zmq_msg_init_size(&msg, msgsz);
+ void * data = zmq_msg_data(&msg);
+ memcpy(data,&i, sizeof(int));
+ rc = zmq_msg_send(&msg,sc,i==9 ? 0 :ZMQ_SNDMORE);
+ assert (rc == (int)msgsz);
+ zmq_msg_close(&msg);
+ sum += i;
+ }
+
+ struct iovec ibuffer[32] ;
+ memset(&ibuffer[0], 0, sizeof(ibuffer));
+
+ size_t count = 10;
+ rc = zmq_recviov(sb,&ibuffer[0],&count,0);
+ assert (rc == 10);
+
+ int rsum=0;
+ for(;count;--count)
+ {
+ int v;
+ memcpy(&v,ibuffer[count-1].iov_base,sizeof(int));
+ rsum += v;
+ assert(ibuffer[count-1].iov_len == msgsz);
+ // free up the memory
+ free(ibuffer[count-1].iov_base);
+ }
+
+ assert ( sum == rsum );
+
+}
+
+int main (void)
+{
+ void *ctx = zmq_ctx_new ();
+ assert (ctx);
+ int rc;
+
+ void *sb = zmq_socket (ctx, ZMQ_PULL);
+ assert (sb);
+
+ rc = zmq_bind (sb, "inproc://a");
+ assert (rc == 0);
+
+ msleep (SETTLE_TIME);
+ void *sc = zmq_socket (ctx, ZMQ_PUSH);
+
+ rc = zmq_connect (sc, "inproc://a");
+ assert (rc == 0);
+
+
+ // message bigger than vsm max
+ do_check(sb,sc,100);
+
+ // message smaller than vsm max
+ do_check(sb,sc,10);
+
+ rc = zmq_close (sc);
+ assert (rc == 0);
+
+ rc = zmq_close (sb);
+ assert (rc == 0);
+
+ rc = zmq_ctx_term (ctx);
+ assert (rc == 0);
+
+ return 0;
+}
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "testutil.hpp"
+
+// Issue 566 describes a problem in libzmq v4.0.0 where a dealer to router
+// connection would fail randomly. The test works when the two sockets are
+// on the same context, and failed when they were on separate contexts.
+// Fixed by https://github.com/zeromq/libzmq/commit/be25cf.
+
+int main (void)
+{
+ setup_test_environment();
+
+ void *ctx1 = zmq_ctx_new ();
+ assert (ctx1);
+
+ void *ctx2 = zmq_ctx_new ();
+ assert (ctx2);
+
+ void *router = zmq_socket (ctx1, ZMQ_ROUTER);
+ int on = 1;
+ int rc = zmq_setsockopt (router, ZMQ_ROUTER_MANDATORY, &on, sizeof (on));
+ assert (rc == 0);
+ rc = zmq_bind (router, "tcp://127.0.0.1:5555");
+ assert (rc != -1);
+
+ // Repeat often enough to be sure this works as it should
+ for (int cycle = 0; cycle < 100; cycle++) {
+ // Create dealer with unique explicit identity
+ // We assume the router learns this out-of-band
+ void *dealer = zmq_socket (ctx2, ZMQ_DEALER);
+ char identity [10];
+ sprintf (identity, "%09d", cycle);
+ rc = zmq_setsockopt (dealer, ZMQ_IDENTITY, identity, 10);
+ assert (rc == 0);
+ int rcvtimeo = 1000;
+ rc = zmq_setsockopt (dealer, ZMQ_RCVTIMEO, &rcvtimeo, sizeof (int));
+ assert (rc == 0);
+ rc = zmq_connect (dealer, "tcp://127.0.0.1:5555");
+ assert (rc == 0);
+
+ // Router will try to send to dealer, at short intervals.
+ // It typically takes 2-5 msec for the connection to establish
+ // on a loopback interface, but we'll allow up to one second
+ // before failing the test (e.g. for running on a debugger or
+ // a very slow system).
+ for (int attempt = 0; attempt < 500; attempt++) {
+ zmq_poll (0, 0, 2);
+ rc = zmq_send (router, identity, 10, ZMQ_SNDMORE);
+ if (rc == -1 && errno == EHOSTUNREACH)
+ continue;
+ assert (rc == 10);
+ rc = zmq_send (router, "HELLO", 5, 0);
+ assert (rc == 5);
+ break;
+ }
+ uint8_t buffer [5];
+ rc = zmq_recv (dealer, buffer, 5, 0);
+ assert (rc == 5);
+ assert (memcmp (buffer, "HELLO", 5) == 0);
+ close_zero_linger (dealer);
+ }
+ zmq_close (router);
+ zmq_ctx_destroy (ctx1);
+ zmq_ctx_destroy (ctx2);
+
+ return 0;
+}
/*
- Copyright (c) 2007-2012 iMatix Corporation
- Copyright (c) 2011 250bpm s.r.o.
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "../include/zmq.h"
-#include <string.h>
-
-#undef NDEBUG
-#include <assert.h>
+#include "testutil.hpp"
static void do_bind_and_verify (void *s, const char *endpoint)
{
int rc = zmq_bind (s, endpoint);
assert (rc == 0);
-
- char test [255];
- size_t siz = 255;
- rc = zmq_getsockopt (s, ZMQ_LAST_ENDPOINT, test, &siz);
- assert (rc == 0 && strcmp (test, endpoint) == 0);
+ char reported [255];
+ size_t size = 255;
+ rc = zmq_getsockopt (s, ZMQ_LAST_ENDPOINT, reported, &size);
+ assert (rc == 0 && strcmp (reported, endpoint) == 0);
}
int main (void)
{
+ setup_test_environment();
// Create the infrastructure
- void *ctx = zmq_init (1);
+ void *ctx = zmq_ctx_new ();
assert (ctx);
void *sb = zmq_socket (ctx, ZMQ_ROUTER);
assert (sb);
+ int val = 0;
+ int rc = zmq_setsockopt (sb, ZMQ_LINGER, &val, sizeof (val));
+ assert (rc == 0);
do_bind_and_verify (sb, "tcp://127.0.0.1:5560");
do_bind_and_verify (sb, "tcp://127.0.0.1:5561");
- do_bind_and_verify (sb, "ipc:///tmp/testep");
+
+ rc = zmq_close (sb);
+ assert (rc == 0);
+
+ rc = zmq_ctx_term (ctx);
+ assert (rc == 0);
return 0 ;
}
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "testutil.hpp"
+#include <zmq.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <vector>
+
+void test_system_max ()
+{
+ // Keep allocating sockets until we run out of system resources
+ const int no_of_sockets = 2 * 65536;
+ void *ctx = zmq_ctx_new ();
+ zmq_ctx_set (ctx, ZMQ_MAX_SOCKETS, no_of_sockets);
+ std::vector <void*> sockets;
+
+ while (true) {
+ void *socket = zmq_socket (ctx, ZMQ_PAIR);
+ if (!socket)
+ break;
+ sockets.push_back (socket);
+ }
+ assert ((int) sockets.size () < no_of_sockets);
+
+ // System is out of resources, further calls to zmq_socket should return NULL
+ for (unsigned int i = 0; i < 10; ++i) {
+ void *socket = zmq_socket (ctx, ZMQ_PAIR);
+ assert (socket == NULL);
+ }
+ // Clean up.
+ for (unsigned int i = 0; i < sockets.size (); ++i)
+ zmq_close (sockets [i]);
+
+ zmq_ctx_destroy (ctx);
+}
+
+void test_zmq_default_max ()
+{
+ // Keep allocating sockets until we hit the default limit
+ void *ctx = zmq_ctx_new ();
+ std::vector<void*> sockets;
+
+ while (true) {
+ void *socket = zmq_socket (ctx, ZMQ_PAIR);
+ if (!socket)
+ break;
+ sockets.push_back (socket);
+ }
+ // We may stop sooner if system has fewer available sockets
+ assert (sockets.size () <= ZMQ_MAX_SOCKETS_DFLT);
+
+ // Further calls to zmq_socket should return NULL
+ for (unsigned int i = 0; i < 10; ++i) {
+ void *socket = zmq_socket (ctx, ZMQ_PAIR);
+ assert (socket == NULL);
+ }
+
+ // Clean up
+ for (unsigned int i = 0; i < sockets.size (); ++i)
+ zmq_close (sockets [i]);
+
+ zmq_ctx_destroy (ctx);
+}
+
+int main (void)
+{
+ setup_test_environment ();
+
+ test_system_max ();
+ test_zmq_default_max ();
+
+ return 0;
+}
/*
- Copyright (c) 2007-2012 iMatix Corporation
- Copyright (c) 2011 250bpm s.r.o.
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "../include/zmq.h"
-#include "../include/zmq_utils.h"
-#include <pthread.h>
-#include <string.h>
#include "testutil.hpp"
// REQ socket events handled
// REP socket events handled
static int rep_socket_events;
-const char *addr;
+std::string addr ;
-extern "C"
+static bool read_msg(void* s, zmq_event_t& event, std::string& ep)
{
- // REQ socket monitor thread
- static void *req_socket_monitor (void *ctx)
- {
- zmq_event_t event;
- int rc;
-
- void *s = zmq_socket (ctx, ZMQ_PAIR);
- assert (s);
-
- rc = zmq_connect (s, "inproc://monitor.req");
- assert (rc == 0);
- while (true) {
- zmq_msg_t msg;
- zmq_msg_init (&msg);
- rc = zmq_recvmsg (s, &msg, 0);
- if (rc == -1 && zmq_errno() == ETERM) break;
- assert (rc != -1);
- memcpy (&event, zmq_msg_data (&msg), sizeof (event));
- switch (event.event) {
+ int rc ;
+ zmq_msg_t msg1; // binary part
+ zmq_msg_init (&msg1);
+ zmq_msg_t msg2; // address part
+ zmq_msg_init (&msg2);
+ rc = zmq_msg_recv (&msg1, s, 0);
+ if (rc == -1 && zmq_errno() == ETERM)
+ return true ;
+
+ assert (rc != -1);
+ assert (zmq_msg_more(&msg1) != 0);
+ rc = zmq_msg_recv (&msg2, s, 0);
+ if (rc == -1 && zmq_errno() == ETERM)
+ return true;
+
+ assert (rc != -1);
+ assert (zmq_msg_more(&msg2) == 0);
+ // copy binary data to event struct
+ const char* data = (char*)zmq_msg_data(&msg1);
+ memcpy(&event.event, data, sizeof(event.event));
+ memcpy(&event.value, data+sizeof(event.event), sizeof(event.value));
+ // copy address part
+ ep = std::string((char*)zmq_msg_data(&msg2), zmq_msg_size(&msg2));
+
+ if (event.event == ZMQ_EVENT_MONITOR_STOPPED)
+ return true;
+
+ return false;
+}
+
+
+// REQ socket monitor thread
+static void req_socket_monitor (void *ctx)
+{
+ zmq_event_t event;
+ std::string ep ;
+ int rc;
+
+ void *s = zmq_socket (ctx, ZMQ_PAIR);
+ assert (s);
+
+ rc = zmq_connect (s, "inproc://monitor.req");
+ assert (rc == 0);
+ while (!read_msg(s, event, ep)) {
+ assert (ep == addr);
+ switch (event.event) {
case ZMQ_EVENT_CONNECTED:
- assert (event.data.connected.fd > 0);
- assert (!strcmp (event.data.connected.addr, addr));
+ assert (event.value > 0);
req_socket_events |= ZMQ_EVENT_CONNECTED;
req2_socket_events |= ZMQ_EVENT_CONNECTED;
break;
case ZMQ_EVENT_CONNECT_DELAYED:
- assert (event.data.connect_delayed.err != 0);
- assert (!strcmp (event.data.connect_delayed.addr, addr));
+ assert (event.value != 0);
req_socket_events |= ZMQ_EVENT_CONNECT_DELAYED;
break;
case ZMQ_EVENT_CLOSE_FAILED:
- assert (event.data.close_failed.err != 0);
- assert (!strcmp (event.data.close_failed.addr, addr));
+ assert (event.value != 0);
req_socket_events |= ZMQ_EVENT_CLOSE_FAILED;
break;
case ZMQ_EVENT_CLOSED:
- assert (event.data.closed.fd != 0);
- assert (!strcmp (event.data.closed.addr, addr));
+ assert (event.value != 0);
req_socket_events |= ZMQ_EVENT_CLOSED;
break;
case ZMQ_EVENT_DISCONNECTED:
- assert (event.data.disconnected.fd != 0);
- assert (!strcmp (event.data.disconnected.addr, addr));
+ assert (event.value != 0);
req_socket_events |= ZMQ_EVENT_DISCONNECTED;
break;
- }
}
- zmq_close (s);
- return NULL;
}
+ zmq_close (s);
}
-extern "C"
+// 2nd REQ socket monitor thread
+static void req2_socket_monitor (void *ctx)
{
- // 2nd REQ socket monitor thread
- static void *req2_socket_monitor (void *ctx)
- {
- zmq_event_t event;
- int rc;
-
- void *s = zmq_socket (ctx, ZMQ_PAIR);
- assert (s);
-
- rc = zmq_connect (s, "inproc://monitor.req2");
- assert (rc == 0);
- while (true) {
- zmq_msg_t msg;
- zmq_msg_init (&msg);
- rc = zmq_recvmsg (s, &msg, 0);
- if (rc == -1 && zmq_errno() == ETERM) break;
- assert (rc != -1);
- memcpy (&event, zmq_msg_data (&msg), sizeof (event));
- switch (event.event) {
+ zmq_event_t event;
+ std::string ep ;
+ int rc;
+
+ void *s = zmq_socket (ctx, ZMQ_PAIR);
+ assert (s);
+
+ rc = zmq_connect (s, "inproc://monitor.req2");
+ assert (rc == 0);
+ while (!read_msg(s, event, ep)) {
+ assert (ep == addr);
+ switch (event.event) {
case ZMQ_EVENT_CONNECTED:
- assert (event.data.connected.fd > 0);
- assert (!strcmp (event.data.connected.addr, addr));
+ assert (event.value > 0);
req2_socket_events |= ZMQ_EVENT_CONNECTED;
break;
case ZMQ_EVENT_CLOSED:
- assert (event.data.closed.fd != 0);
- assert (!strcmp (event.data.closed.addr, addr));
+ assert (event.value != 0);
req2_socket_events |= ZMQ_EVENT_CLOSED;
break;
- }
}
- zmq_close (s);
- return NULL;
}
+ zmq_close (s);
}
-
-extern "C"
+// REP socket monitor thread
+static void rep_socket_monitor (void *ctx)
{
- // REP socket monitor thread
- static void *rep_socket_monitor (void *ctx)
- {
- zmq_event_t event;
- int rc;
-
- void *s = zmq_socket (ctx, ZMQ_PAIR);
- assert (s);
-
- rc = zmq_connect (s, "inproc://monitor.rep");
- assert (rc == 0);
- while (true) {
- zmq_msg_t msg;
- zmq_msg_init (&msg);
- rc = zmq_recvmsg (s, &msg, 0);
- if (rc == -1 && zmq_errno() == ETERM) break;
- assert (rc != -1);
- memcpy (&event, zmq_msg_data (&msg), sizeof (event));
- switch (event.event) {
+ zmq_event_t event;
+ std::string ep ;
+ int rc;
+
+ void *s = zmq_socket (ctx, ZMQ_PAIR);
+ assert (s);
+
+ rc = zmq_connect (s, "inproc://monitor.rep");
+ assert (rc == 0);
+ while (!read_msg(s, event, ep)) {
+ assert (ep == addr);
+ switch (event.event) {
case ZMQ_EVENT_LISTENING:
- assert (event.data.listening.fd > 0);
- assert (!strcmp (event.data.listening.addr, addr));
+ assert (event.value > 0);
rep_socket_events |= ZMQ_EVENT_LISTENING;
break;
case ZMQ_EVENT_ACCEPTED:
- assert (event.data.accepted.fd > 0);
- assert (!strcmp (event.data.accepted.addr, addr));
+ assert (event.value > 0);
rep_socket_events |= ZMQ_EVENT_ACCEPTED;
break;
case ZMQ_EVENT_CLOSE_FAILED:
- assert (event.data.close_failed.err != 0);
- assert (!strcmp (event.data.close_failed.addr, addr));
+ assert (event.value != 0);
rep_socket_events |= ZMQ_EVENT_CLOSE_FAILED;
break;
case ZMQ_EVENT_CLOSED:
- assert (event.data.closed.fd != 0);
- assert (!strcmp (event.data.closed.addr, addr));
+ assert (event.value != 0);
rep_socket_events |= ZMQ_EVENT_CLOSED;
break;
case ZMQ_EVENT_DISCONNECTED:
- assert (event.data.disconnected.fd != 0);
- assert (!strcmp (event.data.disconnected.addr, addr));
+ assert (event.value != 0);
rep_socket_events |= ZMQ_EVENT_DISCONNECTED;
break;
- }
- zmq_msg_close (&msg);
}
- zmq_close (s);
- return NULL;
}
+ zmq_close (s);
}
int main (void)
{
+ setup_test_environment();
int rc;
void *req;
void *req2;
void *rep;
- pthread_t threads [3];
+ void* threads [3];
addr = "tcp://127.0.0.1:5560";
// Create the infrastructure
- void *ctx = zmq_init (1);
+ void *ctx = zmq_ctx_new ();
assert (ctx);
// REP socket
assert (rep);
// Assert supported protocols
- rc = zmq_socket_monitor (rep, addr, 0);
+ rc = zmq_socket_monitor (rep, addr.c_str(), 0);
assert (rc == -1);
assert (zmq_errno() == EPROTONOSUPPORT);
// REP socket monitor, all events
rc = zmq_socket_monitor (rep, "inproc://monitor.rep", ZMQ_EVENT_ALL);
assert (rc == 0);
- rc = pthread_create (&threads [0], NULL, rep_socket_monitor, ctx);
- assert (rc == 0);
-
- rc = zmq_bind (rep, addr);
- assert (rc == 0);
-
+ threads [0] = zmq_threadstart(&rep_socket_monitor, ctx);
+
// REQ socket
req = zmq_socket (ctx, ZMQ_REQ);
assert (req);
// REQ socket monitor, all events
rc = zmq_socket_monitor (req, "inproc://monitor.req", ZMQ_EVENT_ALL);
assert (rc == 0);
- rc = pthread_create (&threads [1], NULL, req_socket_monitor, ctx);
+ threads [1] = zmq_threadstart(&req_socket_monitor, ctx);
+ msleep (SETTLE_TIME);
+
+ // Bind REQ and REP
+ rc = zmq_bind (rep, addr.c_str());
assert (rc == 0);
- rc = zmq_connect (req, addr);
+ rc = zmq_connect (req, addr.c_str());
assert (rc == 0);
+ bounce (rep, req);
+
// 2nd REQ socket
req2 = zmq_socket (ctx, ZMQ_REQ);
assert (req2);
// 2nd REQ socket monitor, connected event only
rc = zmq_socket_monitor (req2, "inproc://monitor.req2", ZMQ_EVENT_CONNECTED);
assert (rc == 0);
- rc = pthread_create (&threads [2], NULL, req2_socket_monitor, ctx);
- assert (rc == 0);
+ threads [2] = zmq_threadstart(&req2_socket_monitor, ctx);
- rc = zmq_connect (req2, addr);
+ rc = zmq_connect (req2, addr.c_str());
assert (rc == 0);
- bounce (rep, req);
-
- // Allow a window for socket events as connect can be async
- zmq_sleep (1);
-
// Close the REP socket
rc = zmq_close (rep);
assert (rc == 0);
- // Allow some time for detecting error states
- zmq_sleep (1);
+ // Allow enough time for detecting error states
+ msleep (250);
// Close the REQ socket
rc = zmq_close (req);
rc = zmq_close (req2);
assert (rc == 0);
- // Allow for closed or disconnected events to bubble up
- zmq_sleep (1);
-
- zmq_term (ctx);
+ zmq_ctx_term (ctx);
// Expected REP socket events
assert (rep_socket_events & ZMQ_EVENT_LISTENING);
assert (req2_socket_events & ZMQ_EVENT_CONNECTED);
assert (!(req2_socket_events & ZMQ_EVENT_CLOSED));
- pthread_exit (NULL);
+ for (unsigned int i = 0; i < 3; ++i)
+ zmq_threadclose(threads [i]);
return 0 ;
}
-
/*
- Copyright (c) 2007-2012 iMatix Corporation
- Copyright (c) 2011 250bpm s.r.o.
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "../include/zmq.h"
-#include <string.h>
-
-#undef NDEBUG
-#include <assert.h>
+#include "testutil.hpp"
int main (void)
{
+ setup_test_environment();
// Create the infrastructure
- void *ctx = zmq_init (0);
+ void *ctx = zmq_ctx_new ();
assert (ctx);
+
void *sb = zmq_socket (ctx, ZMQ_ROUTER);
assert (sb);
+
int rc = zmq_bind (sb, "inproc://a");
assert (rc == 0);
+
void *sc = zmq_socket (ctx, ZMQ_DEALER);
assert (sc);
+
rc = zmq_connect (sc, "inproc://a");
assert (rc == 0);
zmq_msg_t msg;
rc = zmq_msg_init (&msg);
assert (rc == 0);
- rc = zmq_recvmsg (sb, &msg, 0);
+ rc = zmq_msg_recv (&msg, sb, 0);
assert (rc >= 0);
- int more = zmq_msg_get (&msg, ZMQ_MORE);
+ int more = zmq_msg_more (&msg);
assert (more == 1);
// Then the first part of the message body.
- rc = zmq_recvmsg (sb, &msg, 0);
+ rc = zmq_msg_recv (&msg, sb, 0);
assert (rc == 1);
- more = zmq_msg_get (&msg, ZMQ_MORE);
+ more = zmq_msg_more (&msg);
assert (more == 1);
// And finally, the second part of the message body.
- rc = zmq_recvmsg (sb, &msg, 0);
+ rc = zmq_msg_recv (&msg, sb, 0);
assert (rc == 1);
- more = zmq_msg_get (&msg, ZMQ_MORE);
+ more = zmq_msg_more (&msg);
assert (more == 0);
// Deallocate the infrastructure.
rc = zmq_close (sc);
assert (rc == 0);
+
rc = zmq_close (sb);
assert (rc == 0);
- rc = zmq_term (ctx);
+
+ rc = zmq_ctx_term (ctx);
assert (rc == 0);
return 0 ;
}
/*
- Copyright (c) 2010-2011 250bpm s.r.o.
- Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdio.h>
#include "testutil.hpp"
int main (void)
{
- fprintf (stderr, "test_pair_inproc running...\n");
-
- void *ctx = zmq_init (0);
+ setup_test_environment();
+ void *ctx = zmq_ctx_new ();
assert (ctx);
void *sb = zmq_socket (ctx, ZMQ_PAIR);
assert (rc == 0);
bounce (sb, sc);
+
+ // Test zmq_send_const
+ rc = zmq_send_const (sb, "foo", 3, ZMQ_SNDMORE);
+ assert (rc == 3);
+ rc = zmq_send_const (sb, "foobar", 6, 0);
+ assert (rc == 6);
+
+ zmq_msg_t msg;
+ rc = zmq_msg_init (&msg);
+ assert (rc == 0);
+ rc = zmq_msg_recv (&msg, sc, 0);
+ assert (rc == 3);
+ assert (zmq_msg_size (&msg) == 3);
+ void* data = zmq_msg_data (&msg);
+ assert (memcmp ("foo", data, 3) == 0);
+ rc = zmq_msg_recv (&msg, sc, 0);
+ assert (rc == 6);
+ data = zmq_msg_data (&msg);
+ assert (memcmp ("foobar", data, 6) == 0);
+
+ // Cleanup
rc = zmq_close (sc);
assert (rc == 0);
rc = zmq_close (sb);
assert (rc == 0);
- rc = zmq_term (ctx);
+ rc = zmq_ctx_term (ctx);
assert (rc == 0);
return 0 ;
/*
- Copyright (c) 2010-2011 250bpm s.r.o.
- Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdio.h>
#include "testutil.hpp"
int main (void)
{
- fprintf (stderr, "test_pair_ipc running...\n");
-
- void *ctx = zmq_init (1);
+ setup_test_environment();
+ void *ctx = zmq_ctx_new ();
assert (ctx);
void *sb = zmq_socket (ctx, ZMQ_PAIR);
rc = zmq_close (sb);
assert (rc == 0);
- rc = zmq_term (ctx);
+ rc = zmq_ctx_term (ctx);
assert (rc == 0);
return 0 ;
/*
- Copyright (c) 2010-2011 250bpm s.r.o.
- Copyright (c) 2011 iMatix Corporation
- Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdio.h>
#include "testutil.hpp"
int main (void)
{
- fprintf (stderr, "test_pair_tcp running...\n");
-
- void *ctx = zmq_init (1);
+ setup_test_environment();
+ void *ctx = zmq_ctx_new ();
assert (ctx);
void *sb = zmq_socket (ctx, ZMQ_PAIR);
rc = zmq_close (sb);
assert (rc == 0);
- rc = zmq_term (ctx);
+ rc = zmq_ctx_term (ctx);
assert (rc == 0);
return 0 ;
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "testutil.hpp"
+
+int main (void)
+{
+ setup_test_environment();
+ void *ctx = zmq_ctx_new ();
+ assert (ctx);
+
+ // Create server and bind to endpoint
+ void *server = zmq_socket (ctx, ZMQ_ROUTER);
+ assert (server);
+ int rc = zmq_bind (server, "tcp://127.0.0.1:5560");
+ assert (rc == 0);
+
+ // Create client and connect to server, doing a probe
+ void *client = zmq_socket (ctx, ZMQ_ROUTER);
+ assert (client);
+ rc = zmq_setsockopt (client, ZMQ_IDENTITY, "X", 1);
+ assert (rc == 0);
+ int probe = 1;
+ rc = zmq_setsockopt (client, ZMQ_PROBE_ROUTER, &probe, sizeof (probe));
+ assert (rc == 0);
+ rc = zmq_connect (client, "tcp://localhost:5560");
+ assert (rc == 0);
+
+ // We expect an identity=X + empty message from client
+ unsigned char buffer [255];
+ rc = zmq_recv (server, buffer, 255, 0);
+ assert (rc == 1);
+ assert (buffer [0] == 'X');
+ rc = zmq_recv (server, buffer, 255, 0);
+ assert (rc == 0);
+
+ // Send a message to client now
+ rc = zmq_send (server, "X", 1, ZMQ_SNDMORE);
+ assert (rc == 1);
+ rc = zmq_send (server, "Hello", 5, 0);
+ assert (rc == 5);
+
+ rc = zmq_recv (client, buffer, 255, 0);
+ assert (rc == 5);
+
+ rc = zmq_close (server);
+ assert (rc == 0);
+
+ rc = zmq_close (client);
+ assert (rc == 0);
+
+ rc = zmq_ctx_term (ctx);
+ assert (rc == 0);
+
+ return 0 ;
+}
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "testutil.hpp"
+
+int main (void)
+{
+ setup_test_environment();
+ void *ctx = zmq_ctx_new ();
+ assert (ctx);
+
+ void *req = zmq_socket (ctx, ZMQ_REQ);
+ assert (req);
+
+ void *router = zmq_socket (ctx, ZMQ_ROUTER);
+ assert (router);
+
+ int enabled = 1;
+ int rc = zmq_setsockopt (req, ZMQ_REQ_CORRELATE, &enabled, sizeof (int));
+ assert (rc == 0);
+
+ int rcvtimeo = 100;
+ rc = zmq_setsockopt (req, ZMQ_RCVTIMEO, &rcvtimeo, sizeof (int));
+ assert (rc == 0);
+
+ rc = zmq_connect (req, "tcp://localhost:5555");
+ assert (rc == 0);
+
+ rc = zmq_bind (router, "tcp://127.0.0.1:5555");
+ assert (rc == 0);
+
+ // Send a multi-part request.
+ s_send_seq (req, "ABC", "DEF", SEQ_END);
+
+ zmq_msg_t msg;
+ zmq_msg_init (&msg);
+
+ // Receive peer identity
+ rc = zmq_msg_recv (&msg, router, 0);
+ assert (rc != -1);
+ assert (zmq_msg_size (&msg) > 0);
+ zmq_msg_t peer_id_msg;
+ zmq_msg_init (&peer_id_msg);
+ zmq_msg_copy (&peer_id_msg, &msg);
+
+ int more = 0;
+ size_t more_size = sizeof (more);
+ rc = zmq_getsockopt (router, ZMQ_RCVMORE, &more, &more_size);
+ assert (rc == 0);
+ assert (more);
+
+ // Receive request id 1
+ rc = zmq_msg_recv (&msg, router, 0);
+ assert (rc != -1);
+ assert (zmq_msg_size (&msg) == sizeof(uint32_t));
+ uint32_t req_id = *static_cast<uint32_t *> (zmq_msg_data (&msg));
+ zmq_msg_t req_id_msg;
+ zmq_msg_init (&req_id_msg);
+ zmq_msg_copy (&req_id_msg, &msg);
+
+ more = 0;
+ more_size = sizeof (more);
+ rc = zmq_getsockopt (router, ZMQ_RCVMORE, &more, &more_size);
+ assert (rc == 0);
+ assert (more);
+
+ // Receive the rest.
+ s_recv_seq (router, 0, "ABC", "DEF", SEQ_END);
+
+ // Send back a bad reply: correct req id
+ zmq_msg_copy (&msg, &peer_id_msg);
+ rc = zmq_msg_send (&msg, router, ZMQ_SNDMORE);
+ assert (rc != -1);
+ zmq_msg_copy (&msg, &req_id_msg);
+ rc = zmq_msg_send (&msg, router, 0);
+ assert (rc != -1);
+
+ // Send back a bad reply: wrong req id
+ zmq_msg_copy (&msg, &peer_id_msg);
+ rc = zmq_msg_send (&msg, router, ZMQ_SNDMORE);
+ assert (rc != -1);
+ uint32_t bad_req_id = req_id + 1;
+ zmq_msg_init_data (&msg, &bad_req_id, sizeof (uint32_t), NULL, NULL);
+ rc = zmq_msg_send (&msg, router, 0);
+ assert (rc != -1);
+
+ // Send back a bad reply: correct req id, 0
+ zmq_msg_copy (&msg, &peer_id_msg);
+ rc = zmq_msg_send (&msg, router, ZMQ_SNDMORE);
+ assert (rc != -1);
+ zmq_msg_copy (&msg, &req_id_msg);
+ rc = zmq_msg_send (&msg, router, ZMQ_SNDMORE);
+ assert (rc != -1);
+ s_send_seq (router, 0, SEQ_END);
+
+ // Send back a bad reply: correct req id, garbage
+ zmq_msg_copy (&msg, &peer_id_msg);
+ rc = zmq_msg_send (&msg, router, ZMQ_SNDMORE);
+ assert (rc != -1);
+ zmq_msg_copy (&msg, &req_id_msg);
+ rc = zmq_msg_send (&msg, router, ZMQ_SNDMORE);
+ assert (rc != -1);
+ s_send_seq (router, "FOO", SEQ_END);
+
+ // Send back a bad reply: wrong req id, 0
+ zmq_msg_copy (&msg, &peer_id_msg);
+ rc = zmq_msg_send (&msg, router, ZMQ_SNDMORE);
+ assert (rc != -1);
+ zmq_msg_init_data (&msg, &bad_req_id, sizeof (uint32_t), NULL, NULL);
+ rc = zmq_msg_send (&msg, router, ZMQ_SNDMORE);
+ assert (rc != -1);
+ s_send_seq (router, 0, SEQ_END);
+
+ // Send back a bad reply: correct req id, garbage, data
+ zmq_msg_copy (&msg, &peer_id_msg);
+ rc = zmq_msg_send (&msg, router, ZMQ_SNDMORE);
+ assert (rc != -1);
+ zmq_msg_copy (&msg, &req_id_msg);
+ rc = zmq_msg_send (&msg, router, ZMQ_SNDMORE);
+ assert (rc != -1);
+ s_send_seq (router, "FOO", "DATA", SEQ_END);
+
+ // Send back a bad reply: wrong req id, 0, data
+ zmq_msg_copy (&msg, &peer_id_msg);
+ rc = zmq_msg_send (&msg, router, ZMQ_SNDMORE);
+ assert (rc != -1);
+ zmq_msg_init_data (&msg, &bad_req_id, sizeof (uint32_t), NULL, NULL);
+ rc = zmq_msg_send (&msg, router, ZMQ_SNDMORE);
+ assert (rc != -1);
+ s_send_seq (router, 0, "DATA", SEQ_END);
+
+ // Send back a good reply.
+ zmq_msg_copy (&msg, &peer_id_msg);
+ rc = zmq_msg_send (&msg, router, ZMQ_SNDMORE);
+ assert (rc != -1);
+ zmq_msg_copy (&msg, &req_id_msg);
+ rc = zmq_msg_send (&msg, router, ZMQ_SNDMORE);
+ assert (rc != -1);
+ s_send_seq (router, 0, "GHI", SEQ_END);
+
+ // Receive reply. If any of the other messages got through, we wouldn't see
+ // this particular data.
+ s_recv_seq (req, "GHI", SEQ_END);
+
+ rc = zmq_msg_close (&msg);
+ assert (rc == 0);
+
+ rc = zmq_msg_close (&peer_id_msg);
+ assert (rc == 0);
+
+ rc = zmq_msg_close (&req_id_msg);
+ assert (rc == 0);
+
+ close_zero_linger (req);
+ close_zero_linger (router);
+
+ rc = zmq_ctx_term (ctx);
+ assert (rc == 0);
+
+ return 0;
+}
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "testutil.hpp"
+
+int main (void)
+{
+ setup_test_environment();
+ void *ctx = zmq_ctx_new ();
+ assert (ctx);
+
+ void *req = zmq_socket (ctx, ZMQ_REQ);
+ assert (req);
+
+ int enabled = 1;
+ int rc = zmq_setsockopt (req, ZMQ_REQ_RELAXED, &enabled, sizeof (int));
+ assert (rc == 0);
+
+ rc = zmq_setsockopt (req, ZMQ_REQ_CORRELATE, &enabled, sizeof (int));
+ assert (rc == 0);
+
+ rc = zmq_bind (req, "tcp://127.0.0.1:5555");
+ assert (rc == 0);
+
+ const size_t services = 5;
+ void *rep [services];
+ for (size_t peer = 0; peer < services; peer++) {
+ rep [peer] = zmq_socket (ctx, ZMQ_REP);
+ assert (rep [peer]);
+
+ int timeout = 100;
+ rc = zmq_setsockopt (rep [peer], ZMQ_RCVTIMEO, &timeout, sizeof (int));
+ assert (rc == 0);
+
+ rc = zmq_connect (rep [peer], "tcp://localhost:5555");
+ assert (rc == 0);
+ }
+ // We have to give the connects time to finish otherwise the requests
+ // will not properly round-robin. We could alternatively connect the
+ // REQ sockets to the REP sockets.
+ msleep (SETTLE_TIME);
+
+ // Case 1: Second send() before a reply arrives in a pipe.
+
+ // Send a request, ensure it arrives, don't send a reply
+ s_send_seq (req, "A", "B", SEQ_END);
+ s_recv_seq (rep [0], "A", "B", SEQ_END);
+
+ // Send another request on the REQ socket
+ s_send_seq (req, "C", "D", SEQ_END);
+ s_recv_seq (rep [1], "C", "D", SEQ_END);
+
+ // Send a reply to the first request - that should be discarded by the REQ
+ s_send_seq (rep [0], "WRONG", SEQ_END);
+
+ // Send the expected reply
+ s_send_seq (rep [1], "OK", SEQ_END);
+ s_recv_seq (req, "OK", SEQ_END);
+
+
+ // Another standard req-rep cycle, just to check
+ s_send_seq (req, "E", SEQ_END);
+ s_recv_seq (rep [2], "E", SEQ_END);
+ s_send_seq (rep [2], "F", "G", SEQ_END);
+ s_recv_seq (req, "F", "G", SEQ_END);
+
+
+ // Case 2: Second send() after a reply is already in a pipe on the REQ.
+
+ // Send a request, ensure it arrives, send a reply
+ s_send_seq (req, "H", SEQ_END);
+ s_recv_seq (rep [3], "H", SEQ_END);
+ s_send_seq (rep [3], "BAD", SEQ_END);
+
+ // Wait for message to be there.
+ rc = zmq_poll (0, 0, 100);
+ assert (rc == 0);
+
+ // Without receiving that reply, send another request on the REQ socket
+ s_send_seq (req, "I", SEQ_END);
+ s_recv_seq (rep [4], "I", SEQ_END);
+
+ // Send the expected reply
+ s_send_seq (rep [4], "GOOD", SEQ_END);
+ s_recv_seq (req, "GOOD", SEQ_END);
+
+
+ close_zero_linger (req);
+ for (size_t peer = 0; peer < services; peer++)
+ close_zero_linger (rep [peer]);
+
+ // Wait for disconnects.
+ rc = zmq_poll (0, 0, 100);
+ assert (rc == 0);
+
+ rc = zmq_ctx_term (ctx);
+ assert (rc == 0);
+
+ return 0 ;
+}
/*
- Copyright (c) 2010-2011 250bpm s.r.o.
- Copyright (c) 2011 VMware, Inc.
- Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "../include/zmq.h"
-#include <stdio.h>
-#include <string.h>
-
-#undef NDEBUG
-#include <assert.h>
+#include "testutil.hpp"
int main (void)
{
- fprintf (stderr, "test_reqrep_device running...\n");
-
- void *ctx = zmq_init (1);
+ setup_test_environment();
+ void *ctx = zmq_ctx_new ();
assert (ctx);
// Create a req/rep device.
zmq_msg_t msg;
rc = zmq_msg_init (&msg);
assert (rc == 0);
- rc = zmq_recvmsg (router, &msg, 0);
+ rc = zmq_msg_recv (&msg, router, 0);
assert (rc >= 0);
int rcvmore;
size_t sz = sizeof (rcvmore);
rc = zmq_getsockopt (router, ZMQ_RCVMORE, &rcvmore, &sz);
assert (rc == 0);
- rc = zmq_sendmsg (dealer, &msg, rcvmore ? ZMQ_SNDMORE : 0);
+ rc = zmq_msg_send (&msg, dealer, rcvmore? ZMQ_SNDMORE: 0);
assert (rc >= 0);
}
zmq_msg_t msg;
rc = zmq_msg_init (&msg);
assert (rc == 0);
- rc = zmq_recvmsg (dealer, &msg, 0);
+ rc = zmq_msg_recv (&msg, dealer, 0);
assert (rc >= 0);
int rcvmore;
rc = zmq_getsockopt (dealer, ZMQ_RCVMORE, &rcvmore, &sz);
assert (rc == 0);
- rc = zmq_sendmsg (router, &msg, rcvmore ? ZMQ_SNDMORE : 0);
+ rc = zmq_msg_send (&msg, router, rcvmore? ZMQ_SNDMORE: 0);
assert (rc >= 0);
}
assert (rc == 0);
rc = zmq_close (dealer);
assert (rc == 0);
- rc = zmq_term (ctx);
+ rc = zmq_ctx_term (ctx);
assert (rc == 0);
return 0 ;
/*
- Copyright (c) 2010-2011 250bpm s.r.o.
- Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdio.h>
#include "testutil.hpp"
int main (void)
{
- fprintf (stderr, "test_reqrep_inproc running...\n");
-
- void *ctx = zmq_init (0);
+ setup_test_environment();
+ void *ctx = zmq_ctx_new ();
assert (ctx);
void *sb = zmq_socket (ctx, ZMQ_REP);
rc = zmq_close (sb);
assert (rc == 0);
- rc = zmq_term (ctx);
+ rc = zmq_ctx_term (ctx);
assert (rc == 0);
return 0 ;
/*
- Copyright (c) 2010-2011 250bpm s.r.o.
- Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdio.h>
#include "testutil.hpp"
int main (void)
{
- fprintf (stderr, "test_reqrep_ipc running...\n");
-
- void *ctx = zmq_init (1);
+ setup_test_environment();
+ void *ctx = zmq_ctx_new ();
assert (ctx);
void *sb = zmq_socket (ctx, ZMQ_REP);
rc = zmq_close (sb);
assert (rc == 0);
- rc = zmq_term (ctx);
+ rc = zmq_ctx_term (ctx);
assert (rc == 0);
return 0 ;
/*
- Copyright (c) 2010-2011 250bpm s.r.o.
- Copyright (c) 2011 iMatix Corporation
- Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdio.h>
#include "testutil.hpp"
int main (void)
{
- fprintf (stderr, "test_reqrep_tcp running...\n");
-
- void *ctx = zmq_init (1);
+ setup_test_environment();
+ void *ctx = zmq_ctx_new ();
assert (ctx);
void *sb = zmq_socket (ctx, ZMQ_REP);
rc = zmq_close (sb);
assert (rc == 0);
- rc = zmq_term (ctx);
+ rc = zmq_ctx_term (ctx);
assert (rc == 0);
return 0 ;
/*
- Copyright (c) 2010-2011 250bpm s.r.o.
- Copyright (c) 2011 iMatix Corporation
- Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdio.h>
#include "testutil.hpp"
int main (void)
{
- fprintf (stderr, "test_router_mandatory running...\n");
-
- void *ctx = zmq_init (1);
+ setup_test_environment();
+ void *ctx = zmq_ctx_new ();
assert (ctx);
+ void *router = zmq_socket (ctx, ZMQ_ROUTER);
+ assert (router);
- // Creating the first socket.
- void *sa = zmq_socket (ctx, ZMQ_ROUTER);
- assert (sa);
-
- int rc = zmq_bind (sa, "tcp://127.0.0.1:15560");
+ int rc = zmq_bind (router, "tcp://127.0.0.1:5560");
assert (rc == 0);
- // Sending a message to an unknown peer with the default setting
- rc = zmq_send (sa, "UNKNOWN", 7, ZMQ_SNDMORE);
+ // Send a message to an unknown peer with the default setting
+ // This will not report any error
+ rc = zmq_send (router, "UNKNOWN", 7, ZMQ_SNDMORE);
assert (rc == 7);
- rc = zmq_send (sa, "DATA", 4, 0);
+ rc = zmq_send (router, "DATA", 4, 0);
assert (rc == 4);
+ // Send a message to an unknown peer with mandatory routing
+ // This will fail
int mandatory = 1;
+ rc = zmq_setsockopt (router, ZMQ_ROUTER_MANDATORY, &mandatory, sizeof (mandatory));
+ assert (rc == 0);
+ rc = zmq_send (router, "UNKNOWN", 7, ZMQ_SNDMORE);
+ assert (rc == -1 && errno == EHOSTUNREACH);
- // Set mandatory routing on socket
- rc = zmq_setsockopt (sa, ZMQ_ROUTER_MANDATORY, &mandatory, sizeof (mandatory));
+ // Create dealer called "X" and connect it to our router
+ void *dealer = zmq_socket (ctx, ZMQ_DEALER);
+ assert (dealer);
+ rc = zmq_setsockopt (dealer, ZMQ_IDENTITY, "X", 1);
+ assert (rc == 0);
+ rc = zmq_connect (dealer, "tcp://127.0.0.1:5560");
assert (rc == 0);
- // Send a message and check that it fails
- rc = zmq_send (sa, "UNKNOWN", 7, ZMQ_SNDMORE | ZMQ_DONTWAIT);
- assert (rc == -1 && errno == EHOSTUNREACH);
+ // Get message from dealer to know when connection is ready
+ char buffer [255];
+ rc = zmq_send (dealer, "Hello", 5, 0);
+ assert (rc == 5);
+ rc = zmq_recv (router, buffer, 255, 0);
+ assert (rc == 1);
+ assert (buffer [0] == 'X');
+
+ // Send a message to connected dealer now
+ // It should work
+ rc = zmq_send (router, "X", 1, ZMQ_SNDMORE);
+ assert (rc == 1);
+ rc = zmq_send (router, "Hello", 5, 0);
+ assert (rc == 5);
+
+ rc = zmq_close (router);
+ assert (rc == 0);
- rc = zmq_close (sa);
+ rc = zmq_close (dealer);
assert (rc == 0);
- rc = zmq_term (ctx);
+ rc = zmq_ctx_term (ctx);
assert (rc == 0);
return 0 ;
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "testutil.hpp"
+
+int main (void) {
+ setup_test_environment();
+ void *ctx = zmq_ctx_new();
+ assert(ctx);
+
+ void *router = zmq_socket(ctx, ZMQ_ROUTER);
+ assert(router);
+ void *dealer = zmq_socket(ctx, ZMQ_DEALER);
+ assert(dealer);
+
+ int one=1;
+ int rc = zmq_setsockopt(router, ZMQ_ROUTER_RAW, &one, sizeof(int));
+ assert(rc >= 0);
+ rc = zmq_setsockopt(router, ZMQ_ROUTER_MANDATORY, &one, sizeof(int));
+ assert(rc >= 0);
+
+ rc = zmq_bind(router, "tcp://127.0.0.1:5555");
+ rc = zmq_connect(dealer, "tcp://127.0.0.1:5555");
+ zmq_send(dealer, "", 0, 0);
+
+
+ zmq_msg_t ident, empty;
+ zmq_msg_init(&ident);
+ rc = zmq_msg_recv(&ident, router, 0);
+ assert(rc >= 0);
+ rc = zmq_msg_init_data(&empty, (void*)"", 0, NULL, NULL);
+ assert(rc >= 0);
+
+ rc = zmq_msg_send(&ident, router, ZMQ_SNDMORE);
+ assert(rc >= 0);
+ rc = zmq_msg_close(&ident);
+ assert(rc >= 0);
+
+ rc = zmq_msg_send(&empty, router, 0);
+ assert(rc >= 0);
+
+ // This close used to fail with Bad Address
+ rc = zmq_msg_close(&empty);
+ assert(rc >= 0);
+
+ close_zero_linger(dealer);
+ close_zero_linger(router);
+ zmq_ctx_term(ctx);
+}
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "testutil.hpp"
+
+// We'll generate random test keys at startup
+static char client_public [41];
+static char client_secret [41];
+static char server_public [41];
+static char server_secret [41];
+
+// --------------------------------------------------------------------------
+// Encode a binary frame as a string; destination string MUST be at least
+// size * 5 / 4 bytes long plus 1 byte for the null terminator. Returns
+// dest. Size must be a multiple of 4.
+
+static void zap_handler (void *handler)
+{
+ // Process ZAP requests forever
+ while (true) {
+ char *version = s_recv (handler);
+ if (!version)
+ break; // Terminating
+
+ char *sequence = s_recv (handler);
+ char *domain = s_recv (handler);
+ char *address = s_recv (handler);
+ char *identity = s_recv (handler);
+ char *mechanism = s_recv (handler);
+ uint8_t client_key [32];
+ int size = zmq_recv (handler, client_key, 32, 0);
+ assert (size == 32);
+
+ char client_key_text [41];
+ zmq_z85_encode (client_key_text, client_key, 32);
+
+ assert (streq (version, "1.0"));
+ assert (streq (mechanism, "CURVE"));
+ assert (streq (identity, "IDENT"));
+
+ s_sendmore (handler, version);
+ s_sendmore (handler, sequence);
+
+ if (streq (client_key_text, client_public)) {
+ s_sendmore (handler, "200");
+ s_sendmore (handler, "OK");
+ s_sendmore (handler, "anonymous");
+ s_send (handler, "");
+ }
+ else {
+ s_sendmore (handler, "400");
+ s_sendmore (handler, "Invalid client public key");
+ s_sendmore (handler, "");
+ s_send (handler, "");
+ }
+ free (version);
+ free (sequence);
+ free (domain);
+ free (address);
+ free (identity);
+ free (mechanism);
+ }
+ zmq_close (handler);
+}
+
+
+int main (void)
+{
+#ifndef HAVE_LIBSODIUM
+ printf ("libsodium not installed, skipping CURVE test\n");
+ return 0;
+#endif
+
+ // Generate new keypairs for this test
+ int rc = zmq_curve_keypair (client_public, client_secret);
+ assert (rc == 0);
+ rc = zmq_curve_keypair (server_public, server_secret);
+ assert (rc == 0);
+
+ setup_test_environment ();
+ void *ctx = zmq_ctx_new ();
+ assert (ctx);
+
+ // Spawn ZAP handler
+ // We create and bind ZAP socket in main thread to avoid case
+ // where child thread does not start up fast enough.
+ void *handler = zmq_socket (ctx, ZMQ_REP);
+ assert (handler);
+ rc = zmq_bind (handler, "inproc://zeromq.zap.01");
+ assert (rc == 0);
+ void *zap_thread = zmq_threadstart (&zap_handler, handler);
+
+ // Server socket will accept connections
+ void *server = zmq_socket (ctx, ZMQ_DEALER);
+ assert (server);
+ int as_server = 1;
+ rc = zmq_setsockopt (server, ZMQ_CURVE_SERVER, &as_server, sizeof (int));
+ assert (rc == 0);
+ rc = zmq_setsockopt (server, ZMQ_CURVE_SECRETKEY, server_secret, 40);
+ assert (rc == 0);
+ rc = zmq_setsockopt (server, ZMQ_IDENTITY, "IDENT", 6);
+ assert (rc == 0);
+ rc = zmq_bind (server, "tcp://127.0.0.1:9998");
+ assert (rc == 0);
+
+ // Check CURVE security with valid credentials
+ void *client = zmq_socket (ctx, ZMQ_DEALER);
+ assert (client);
+ rc = zmq_setsockopt (client, ZMQ_CURVE_SERVERKEY, server_public, 40);
+ assert (rc == 0);
+ rc = zmq_setsockopt (client, ZMQ_CURVE_PUBLICKEY, client_public, 40);
+ assert (rc == 0);
+ rc = zmq_setsockopt (client, ZMQ_CURVE_SECRETKEY, client_secret, 40);
+ assert (rc == 0);
+ rc = zmq_connect (client, "tcp://localhost:9998");
+ assert (rc == 0);
+ bounce (server, client);
+ rc = zmq_close (client);
+ assert (rc == 0);
+
+ // Check CURVE security with a garbage server key
+ // This will be caught by the curve_server class, not passed to ZAP
+ char garbage_key [] = "0000111122223333444455556666777788889999";
+ client = zmq_socket (ctx, ZMQ_DEALER);
+ assert (client);
+ rc = zmq_setsockopt (client, ZMQ_CURVE_SERVERKEY, garbage_key, 40);
+ assert (rc == 0);
+ rc = zmq_setsockopt (client, ZMQ_CURVE_PUBLICKEY, client_public, 40);
+ assert (rc == 0);
+ rc = zmq_setsockopt (client, ZMQ_CURVE_SECRETKEY, client_secret, 40);
+ assert (rc == 0);
+ rc = zmq_connect (client, "tcp://localhost:9998");
+ assert (rc == 0);
+ expect_bounce_fail (server, client);
+ close_zero_linger (client);
+
+ // Check CURVE security with a garbage client public key
+ // This will be caught by the curve_server class, not passed to ZAP
+ client = zmq_socket (ctx, ZMQ_DEALER);
+ assert (client);
+ rc = zmq_setsockopt (client, ZMQ_CURVE_SERVERKEY, server_public, 40);
+ assert (rc == 0);
+ rc = zmq_setsockopt (client, ZMQ_CURVE_PUBLICKEY, garbage_key, 40);
+ assert (rc == 0);
+ rc = zmq_setsockopt (client, ZMQ_CURVE_SECRETKEY, client_secret, 40);
+ assert (rc == 0);
+ rc = zmq_connect (client, "tcp://localhost:9998");
+ assert (rc == 0);
+ expect_bounce_fail (server, client);
+ close_zero_linger (client);
+
+ // Check CURVE security with a garbage client secret key
+ // This will be caught by the curve_server class, not passed to ZAP
+ client = zmq_socket (ctx, ZMQ_DEALER);
+ assert (client);
+ rc = zmq_setsockopt (client, ZMQ_CURVE_SERVERKEY, server_public, 40);
+ assert (rc == 0);
+ rc = zmq_setsockopt (client, ZMQ_CURVE_PUBLICKEY, client_public, 40);
+ assert (rc == 0);
+ rc = zmq_setsockopt (client, ZMQ_CURVE_SECRETKEY, garbage_key, 40);
+ assert (rc == 0);
+ rc = zmq_connect (client, "tcp://localhost:9998");
+ assert (rc == 0);
+ expect_bounce_fail (server, client);
+ close_zero_linger (client);
+
+ // Check CURVE security with bogus client credentials
+ // This must be caught by the ZAP handler
+ char bogus_public [41];
+ char bogus_secret [41];
+ zmq_curve_keypair (bogus_public, bogus_secret);
+
+ client = zmq_socket (ctx, ZMQ_DEALER);
+ assert (client);
+ rc = zmq_setsockopt (client, ZMQ_CURVE_SERVERKEY, server_public, 40);
+ assert (rc == 0);
+ rc = zmq_setsockopt (client, ZMQ_CURVE_PUBLICKEY, bogus_public, 40);
+ assert (rc == 0);
+ rc = zmq_setsockopt (client, ZMQ_CURVE_SECRETKEY, bogus_secret, 40);
+ assert (rc == 0);
+ rc = zmq_connect (client, "tcp://localhost:9998");
+ assert (rc == 0);
+ expect_bounce_fail (server, client);
+ close_zero_linger (client);
+
+ // Shutdown
+ rc = zmq_close (server);
+ assert (rc == 0);
+ rc = zmq_ctx_term (ctx);
+ assert (rc == 0);
+
+ // Wait until ZAP handler terminates
+ zmq_threadclose (zap_thread);
+
+ return 0;
+}
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "testutil.hpp"
+
+static void
+zap_handler (void *handler)
+{
+ // Process ZAP requests forever
+ while (true) {
+ char *version = s_recv (handler);
+ if (!version)
+ break; // Terminating
+ char *sequence = s_recv (handler);
+ char *domain = s_recv (handler);
+ char *address = s_recv (handler);
+ char *identity = s_recv (handler);
+ char *mechanism = s_recv (handler);
+
+ assert (streq (version, "1.0"));
+ assert (streq (mechanism, "NULL"));
+
+ s_sendmore (handler, version);
+ s_sendmore (handler, sequence);
+ if (streq (domain, "TEST")) {
+ s_sendmore (handler, "200");
+ s_sendmore (handler, "OK");
+ s_sendmore (handler, "anonymous");
+ s_send (handler, "");
+ }
+ else {
+ s_sendmore (handler, "400");
+ s_sendmore (handler, "BAD DOMAIN");
+ s_sendmore (handler, "");
+ s_send (handler, "");
+ }
+ free (version);
+ free (sequence);
+ free (domain);
+ free (address);
+ free (identity);
+ free (mechanism);
+ }
+ zmq_close (handler);
+}
+
+int main (void)
+{
+ setup_test_environment();
+ void *ctx = zmq_ctx_new ();
+ assert (ctx);
+
+ // Spawn ZAP handler
+ // We create and bind ZAP socket in main thread to avoid case
+ // where child thread does not start up fast enough.
+ void *handler = zmq_socket (ctx, ZMQ_REP);
+ assert (handler);
+ int rc = zmq_bind (handler, "inproc://zeromq.zap.01");
+ assert (rc == 0);
+ void *zap_thread = zmq_threadstart (&zap_handler, handler);
+
+ // We bounce between a binding server and a connecting client
+ void *server = zmq_socket (ctx, ZMQ_DEALER);
+ assert (server);
+ void *client = zmq_socket (ctx, ZMQ_DEALER);
+ assert (client);
+
+ // We first test client/server with no ZAP domain
+ // Libzmq does not call our ZAP handler, the connect must succeed
+ rc = zmq_bind (server, "tcp://127.0.0.1:9000");
+ assert (rc == 0);
+ rc = zmq_connect (client, "tcp://localhost:9000");
+ assert (rc == 0);
+ bounce (server, client);
+ zmq_unbind (server, "tcp://127.0.0.1:9000");
+ zmq_disconnect (client, "tcp://localhost:9000");
+
+ // Now define a ZAP domain for the server; this enables
+ // authentication. We're using the wrong domain so this test
+ // must fail.
+ // **************************************************************
+ // PH: the following causes libzmq to get confused, so that the
+ // next step fails. To reproduce, uncomment this block. Note that
+ // even creating a new client/server socket pair, the behaviour
+ // does not change.
+ // **************************************************************
+ // Destroying the old sockets and creating new ones isn't needed,
+ // but it shows that the problem isn't related to specific sockets.
+ //close_zero_linger (client);
+ //close_zero_linger (server);
+ //server = zmq_socket (ctx, ZMQ_DEALER);
+ //assert (server);
+ //client = zmq_socket (ctx, ZMQ_DEALER);
+ //assert (client);
+ //// The above code should not be required
+ //rc = zmq_setsockopt (server, ZMQ_ZAP_DOMAIN, "WRONG", 5);
+ //assert (rc == 0);
+ //rc = zmq_bind (server, "tcp://127.0.0.1:9001");
+ //assert (rc == 0);
+ //rc = zmq_connect (client, "tcp://localhost:9001");
+ //assert (rc == 0);
+ //expect_bounce_fail (server, client);
+ //zmq_unbind (server, "tcp://127.0.0.1:9001");
+ //zmq_disconnect (client, "tcp://localhost:9001");
+
+ // Now use the right domain, the test must pass
+ rc = zmq_setsockopt (server, ZMQ_ZAP_DOMAIN, "TEST", 4);
+ assert (rc == 0);
+ rc = zmq_bind (server, "tcp://127.0.0.1:9002");
+ assert (rc == 0);
+ rc = zmq_connect (client, "tcp://localhost:9002");
+ assert (rc == 0);
+ // **************************************************************
+ // PH: it fails here; though the ZAP reply is 200 OK, and
+ // null_mechanism.cpp correctly parses that, the connection
+ // never succeeds and the test hangs.
+ // **************************************************************
+ bounce (server, client);
+ zmq_unbind (server, "tcp://127.0.0.1:9002");
+ zmq_disconnect (client, "tcp://localhost:9002");
+
+ // Shutdown
+ close_zero_linger (client);
+ close_zero_linger (server);
+ rc = zmq_ctx_term (ctx);
+ assert (rc == 0);
+
+ // Wait until ZAP handler terminates.
+ zmq_threadclose (zap_thread);
+
+ return 0;
+}
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "testutil.hpp"
+
+static void
+zap_handler (void *ctx)
+{
+ // Create and bind ZAP socket
+ void *zap = zmq_socket (ctx, ZMQ_REP);
+ assert (zap);
+ int rc = zmq_bind (zap, "inproc://zeromq.zap.01");
+ assert (rc == 0);
+
+ // Process ZAP requests forever
+ while (true) {
+ char *version = s_recv (zap);
+ if (!version)
+ break; // Terminating
+ char *sequence = s_recv (zap);
+ char *domain = s_recv (zap);
+ char *address = s_recv (zap);
+ char *identity = s_recv (zap);
+ char *mechanism = s_recv (zap);
+ char *username = s_recv (zap);
+ char *password = s_recv (zap);
+
+ assert (streq (version, "1.0"));
+ assert (streq (mechanism, "PLAIN"));
+ assert (streq (identity, "IDENT"));
+
+ s_sendmore (zap, version);
+ s_sendmore (zap, sequence);
+ if (streq (username, "admin")
+ && streq (password, "password")) {
+ s_sendmore (zap, "200");
+ s_sendmore (zap, "OK");
+ s_sendmore (zap, "anonymous");
+ s_send (zap, "");
+ }
+ else {
+ s_sendmore (zap, "400");
+ s_sendmore (zap, "Invalid username or password");
+ s_sendmore (zap, "");
+ s_send (zap, "");
+ }
+ free (version);
+ free (sequence);
+ free (domain);
+ free (address);
+ free (identity);
+ free (mechanism);
+ free (username);
+ free (password);
+ }
+ rc = zmq_close (zap);
+ assert (rc == 0);
+}
+
+int main (void)
+{
+ setup_test_environment();
+ void *ctx = zmq_ctx_new ();
+ assert (ctx);
+
+ // Spawn ZAP handler
+ void *zap_thread = zmq_threadstart (&zap_handler, ctx);
+
+ // Server socket will accept connections
+ void *server = zmq_socket (ctx, ZMQ_DEALER);
+ assert (server);
+ int rc = zmq_setsockopt (server, ZMQ_IDENTITY, "IDENT", 6);
+ assert (rc == 0);
+ int as_server = 1;
+ rc = zmq_setsockopt (server, ZMQ_PLAIN_SERVER, &as_server, sizeof (int));
+ assert (rc == 0);
+ rc = zmq_bind (server, "tcp://127.0.0.1:9998");
+ assert (rc == 0);
+
+ char username [256];
+ char password [256];
+
+ // Check PLAIN security with correct username/password
+ void *client = zmq_socket (ctx, ZMQ_DEALER);
+ assert (client);
+ strcpy (username, "admin");
+ rc = zmq_setsockopt (client, ZMQ_PLAIN_USERNAME, username, strlen (username));
+ assert (rc == 0);
+ strcpy (password, "password");
+ rc = zmq_setsockopt (client, ZMQ_PLAIN_PASSWORD, password, strlen (password));
+ assert (rc == 0);
+ rc = zmq_connect (client, "tcp://localhost:9998");
+ assert (rc == 0);
+ bounce (server, client);
+ rc = zmq_close (client);
+ assert (rc == 0);
+
+ // Check PLAIN security with badly configured client (as_server)
+ // This will be caught by the plain_server class, not passed to ZAP
+ client = zmq_socket (ctx, ZMQ_DEALER);
+ assert (client);
+ as_server = 1;
+ rc = zmq_setsockopt (client, ZMQ_PLAIN_SERVER, &as_server, sizeof (int));
+ assert (rc == 0);
+ rc = zmq_connect (client, "tcp://localhost:9998");
+ assert (rc == 0);
+ expect_bounce_fail (server, client);
+ close_zero_linger (client);
+
+ // Check PLAIN security -- failed authentication
+ client = zmq_socket (ctx, ZMQ_DEALER);
+ assert (client);
+ strcpy (username, "wronguser");
+ strcpy (password, "wrongpass");
+ rc = zmq_setsockopt (client, ZMQ_PLAIN_USERNAME, username, strlen (username));
+ assert (rc == 0);
+ rc = zmq_setsockopt (client, ZMQ_PLAIN_PASSWORD, password, strlen (password));
+ assert (rc == 0);
+ rc = zmq_connect (client, "tcp://localhost:9998");
+ assert (rc == 0);
+ expect_bounce_fail (server, client);
+ close_zero_linger (client);
+
+ // Shutdown
+ rc = zmq_close (server);
+ assert (rc == 0);
+ rc = zmq_ctx_term (ctx);
+ assert (rc == 0);
+
+ // Wait until ZAP handler terminates
+ zmq_threadclose (zap_thread);
+
+ return 0;
+}
/*
- Copyright (c) 2010-2011 250bpm s.r.o.
- Copyright (c) 2011 iMatix Corporation
- Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "../include/zmq.h"
-#include <pthread.h>
-#include <stddef.h>
-#include <stdio.h>
-
-#undef NDEBUG
-#include <assert.h>
+#include "testutil.hpp"
#define THREAD_COUNT 100
extern "C"
{
- static void *worker (void *s)
+ static void worker (void *s)
{
int rc;
// Start closing the socket while the connecting process is underway.
rc = zmq_close (s);
assert (rc == 0);
-
- return NULL;
}
}
int main (void)
{
- void *ctx;
+ setup_test_environment();
void *s1;
void *s2;
int i;
int j;
int rc;
- pthread_t threads [THREAD_COUNT];
-
- fprintf (stderr, "test_shutdown_stress running...\n");
+ void* threads [THREAD_COUNT];
for (j = 0; j != 10; j++) {
// Check the shutdown with many parallel I/O threads.
- ctx = zmq_init (7);
+ void *ctx = zmq_ctx_new ();
assert (ctx);
+ zmq_ctx_set (ctx, ZMQ_IO_THREADS, 7);
s1 = zmq_socket (ctx, ZMQ_PUB);
assert (s1);
for (i = 0; i != THREAD_COUNT; i++) {
s2 = zmq_socket (ctx, ZMQ_SUB);
assert (s2);
- rc = pthread_create (&threads [i], NULL, worker, s2);
- assert (rc == 0);
+ threads [i] = zmq_threadstart(&worker, s2);
}
for (i = 0; i != THREAD_COUNT; i++) {
- rc = pthread_join (threads [i], NULL);
- assert (rc == 0);
+ zmq_threadclose(threads [i]);
}
rc = zmq_close (s1);
assert (rc == 0);
- rc = zmq_term (ctx);
+ rc = zmq_ctx_term (ctx);
assert (rc == 0);
}
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "testutil.hpp"
+
+const char *bind_address = 0;
+const char *connect_address = 0;
+
+void test_round_robin_out (void *ctx)
+{
+ void *dealer = zmq_socket (ctx, ZMQ_DEALER);
+ assert (dealer);
+
+ int rc = zmq_bind (dealer, bind_address);
+ assert (rc == 0);
+
+ const size_t services = 5;
+ void *rep [services];
+ for (size_t peer = 0; peer < services; ++peer) {
+ rep [peer] = zmq_socket (ctx, ZMQ_REP);
+ assert (rep [peer]);
+
+ int timeout = 100;
+ rc = zmq_setsockopt (rep [peer], ZMQ_RCVTIMEO, &timeout, sizeof (int));
+ assert (rc == 0);
+
+ rc = zmq_connect (rep [peer], connect_address);
+ assert (rc == 0);
+ }
+
+ // Wait for connections.
+ rc = zmq_poll (0, 0, 100);
+ assert (rc == 0);
+
+ // Send all requests
+ for (size_t i = 0; i < services; ++i)
+ s_send_seq (dealer, 0, "ABC", SEQ_END);
+
+ // Expect every REP got one message
+ zmq_msg_t msg;
+ zmq_msg_init (&msg);
+
+ for (size_t peer = 0; peer < services; ++peer)
+ s_recv_seq (rep [peer], "ABC", SEQ_END);
+
+ rc = zmq_msg_close (&msg);
+ assert (rc == 0);
+
+ close_zero_linger (dealer);
+
+ for (size_t peer = 0; peer < services; ++peer)
+ close_zero_linger (rep [peer]);
+
+ // Wait for disconnects.
+ rc = zmq_poll (0, 0, 100);
+ assert (rc == 0);
+}
+
+void test_fair_queue_in (void *ctx)
+{
+ void *receiver = zmq_socket (ctx, ZMQ_DEALER);
+ assert (receiver);
+
+ int timeout = 100;
+ int rc = zmq_setsockopt (receiver, ZMQ_RCVTIMEO, &timeout, sizeof (int));
+ assert (rc == 0);
+
+ rc = zmq_bind (receiver, bind_address);
+ assert (rc == 0);
+
+ const size_t services = 5;
+ void *senders [services];
+ for (size_t peer = 0; peer < services; ++peer) {
+ senders [peer] = zmq_socket (ctx, ZMQ_DEALER);
+ assert (senders [peer]);
+
+ rc = zmq_setsockopt (senders [peer], ZMQ_RCVTIMEO, &timeout, sizeof (int));
+ assert (rc == 0);
+
+ rc = zmq_connect (senders [peer], connect_address);
+ assert (rc == 0);
+ }
+
+ zmq_msg_t msg;
+ rc = zmq_msg_init (&msg);
+ assert (rc == 0);
+
+ s_send_seq (senders [0], "A", SEQ_END);
+ s_recv_seq (receiver, "A", SEQ_END);
+
+ s_send_seq (senders [0], "A", SEQ_END);
+ s_recv_seq (receiver, "A", SEQ_END);
+
+ // send our requests
+ for (size_t peer = 0; peer < services; ++peer)
+ s_send_seq (senders [peer], "B", SEQ_END);
+
+ // Wait for data.
+ rc = zmq_poll (0, 0, 50);
+ assert (rc == 0);
+
+ // handle the requests
+ for (size_t peer = 0; peer < services; ++peer)
+ s_recv_seq (receiver, "B", SEQ_END);
+
+ rc = zmq_msg_close (&msg);
+ assert (rc == 0);
+
+ close_zero_linger (receiver);
+
+ for (size_t peer = 0; peer < services; ++peer)
+ close_zero_linger (senders [peer]);
+
+ // Wait for disconnects.
+ rc = zmq_poll (0, 0, 100);
+ assert (rc == 0);
+}
+
+void test_destroy_queue_on_disconnect (void *ctx)
+{
+ void *A = zmq_socket (ctx, ZMQ_DEALER);
+ assert (A);
+
+ int rc = zmq_bind (A, bind_address);
+ assert (rc == 0);
+
+ void *B = zmq_socket (ctx, ZMQ_DEALER);
+ assert (B);
+
+ rc = zmq_connect (B, connect_address);
+ assert (rc == 0);
+
+ // Send a message in both directions
+ s_send_seq (A, "ABC", SEQ_END);
+ s_send_seq (B, "DEF", SEQ_END);
+
+ rc = zmq_disconnect (B, connect_address);
+ assert (rc == 0);
+
+ // Disconnect may take time and need command processing.
+ zmq_pollitem_t poller [2] = { { A, 0, 0, 0 }, { B, 0, 0, 0 } };
+ rc = zmq_poll (poller, 2, 100);
+ assert (rc == 0);
+ rc = zmq_poll (poller, 2, 100);
+ assert (rc == 0);
+
+ // No messages should be available, sending should fail.
+ zmq_msg_t msg;
+ zmq_msg_init (&msg);
+
+ rc = zmq_send (A, 0, 0, ZMQ_DONTWAIT);
+ assert (rc == -1);
+ assert (errno == EAGAIN);
+
+ rc = zmq_msg_recv (&msg, A, ZMQ_DONTWAIT);
+ assert (rc == -1);
+ assert (errno == EAGAIN);
+
+ // After a reconnect of B, the messages should still be gone
+ rc = zmq_connect (B, connect_address);
+ assert (rc == 0);
+
+ rc = zmq_msg_recv (&msg, A, ZMQ_DONTWAIT);
+ assert (rc == -1);
+ assert (errno == EAGAIN);
+
+ rc = zmq_msg_recv (&msg, B, ZMQ_DONTWAIT);
+ assert (rc == -1);
+ assert (errno == EAGAIN);
+
+ rc = zmq_msg_close (&msg);
+ assert (rc == 0);
+
+ close_zero_linger (A);
+ close_zero_linger (B);
+
+ // Wait for disconnects.
+ rc = zmq_poll (0, 0, 100);
+ assert (rc == 0);
+}
+
+void test_block_on_send_no_peers (void *ctx)
+{
+ void *sc = zmq_socket (ctx, ZMQ_DEALER);
+ assert (sc);
+
+ int timeout = 100;
+ int rc = zmq_setsockopt (sc, ZMQ_SNDTIMEO, &timeout, sizeof (timeout));
+ assert (rc == 0);
+
+ rc = zmq_send (sc, 0, 0, ZMQ_DONTWAIT);
+ assert (rc == -1);
+ assert (errno == EAGAIN);
+
+ rc = zmq_send (sc, 0, 0, 0);
+ assert (rc == -1);
+ assert (errno == EAGAIN);
+
+ rc = zmq_close (sc);
+ assert (rc == 0);
+}
+
+int main (void)
+{
+ setup_test_environment();
+ void *ctx = zmq_ctx_new ();
+ assert (ctx);
+
+ const char *binds [] = { "inproc://a", "tcp://127.0.0.1:5555" };
+ const char *connects [] = { "inproc://a", "tcp://localhost:5555" };
+
+ for (int transports = 0; transports < 2; ++transports) {
+ bind_address = binds [transports];
+ connect_address = connects [transports];
+
+ // SHALL route outgoing messages to available peers using a round-robin
+ // strategy.
+ test_round_robin_out (ctx);
+
+ // SHALL receive incoming messages from its peers using a fair-queuing
+ // strategy.
+ test_fair_queue_in (ctx);
+
+ // SHALL block on sending, or return a suitable error, when it has no connected peers.
+ test_block_on_send_no_peers (ctx);
+
+ // SHALL create a double queue when a peer connects to it. If this peer
+ // disconnects, the DEALER socket SHALL destroy its double queue and SHALL
+ // discard any messages it contains.
+ // *** Test disabled until libzmq does this properly ***
+ // test_destroy_queue_on_disconnect (ctx);
+ }
+
+ int rc = zmq_ctx_term (ctx);
+ assert (rc == 0);
+
+ return 0 ;
+}
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "testutil.hpp"
+
+const char *bind_address = 0;
+const char *connect_address = 0;
+
+void test_push_round_robin_out (void *ctx)
+{
+ void *push = zmq_socket (ctx, ZMQ_PUSH);
+ assert (push);
+
+ int rc = zmq_bind (push, bind_address);
+ assert (rc == 0);
+
+ const size_t services = 5;
+ void *pulls [services];
+ for (size_t peer = 0; peer < services; ++peer) {
+ pulls [peer] = zmq_socket (ctx, ZMQ_PULL);
+ assert (pulls [peer]);
+
+ int timeout = 100;
+ rc = zmq_setsockopt (pulls [peer], ZMQ_RCVTIMEO, &timeout, sizeof (int));
+ assert (rc == 0);
+
+ rc = zmq_connect (pulls [peer], connect_address);
+ assert (rc == 0);
+ }
+
+ // Wait for connections.
+ rc = zmq_poll (0, 0, 100);
+ assert (rc == 0);
+
+ // Send 2N messages
+ for (size_t peer = 0; peer < services; ++peer)
+ s_send_seq (push, "ABC", SEQ_END);
+ for (size_t peer = 0; peer < services; ++peer)
+ s_send_seq (push, "DEF", SEQ_END);
+
+ // Expect every PULL got one of each
+ for (size_t peer = 0; peer < services; ++peer) {
+ s_recv_seq (pulls [peer], "ABC", SEQ_END);
+ s_recv_seq (pulls [peer], "DEF", SEQ_END);
+ }
+
+ close_zero_linger (push);
+
+ for (size_t peer = 0; peer < services; ++peer)
+ close_zero_linger (pulls [peer]);
+
+ // Wait for disconnects.
+ rc = zmq_poll (0, 0, 100);
+ assert (rc == 0);
+}
+
+void test_pull_fair_queue_in (void *ctx)
+{
+ void *pull = zmq_socket (ctx, ZMQ_PULL);
+ assert (pull);
+
+ int rc = zmq_bind (pull, bind_address);
+ assert (rc == 0);
+
+ const size_t services = 5;
+ void *pushs [services];
+ for (size_t peer = 0; peer < services; ++peer)
+ {
+ pushs [peer] = zmq_socket (ctx, ZMQ_PUSH);
+ assert (pushs [peer]);
+
+ rc = zmq_connect (pushs [peer], connect_address);
+ assert (rc == 0);
+ }
+
+ // Wait for connections.
+ rc = zmq_poll (0, 0, 100);
+ assert (rc == 0);
+
+ int first_half = 0;
+ int second_half = 0;
+
+ // Send 2N messages
+ for (size_t peer = 0; peer < services; ++peer) {
+ char *str = strdup("A");
+
+ str [0] += peer;
+ s_send_seq (pushs [peer], str, SEQ_END);
+ first_half += str [0];
+
+ str [0] += services;
+ s_send_seq (pushs [peer], str, SEQ_END);
+ second_half += str [0];
+
+ free (str);
+ }
+
+ // Wait for data.
+ rc = zmq_poll (0, 0, 100);
+ assert (rc == 0);
+
+ zmq_msg_t msg;
+ rc = zmq_msg_init (&msg);
+ assert (rc == 0);
+
+ // Expect to pull one from each first
+ for (size_t peer = 0; peer < services; ++peer) {
+ rc = zmq_msg_recv (&msg, pull, 0);
+ assert (rc == 2);
+ const char *str = (const char *)zmq_msg_data (&msg);
+ first_half -= str [0];
+ }
+ assert (first_half == 0);
+
+ // And then get the second batch
+ for (size_t peer = 0; peer < services; ++peer) {
+ rc = zmq_msg_recv (&msg, pull, 0);
+ assert (rc == 2);
+ const char *str = (const char *)zmq_msg_data (&msg);
+ second_half -= str [0];
+ }
+ assert (second_half == 0);
+
+ rc = zmq_msg_close (&msg);
+ assert (rc == 0);
+
+ close_zero_linger (pull);
+
+ for (size_t peer = 0; peer < services; ++peer)
+ close_zero_linger (pushs [peer]);
+
+ // Wait for disconnects.
+ rc = zmq_poll (0, 0, 100);
+ assert (rc == 0);
+}
+
+void test_push_block_on_send_no_peers (void *ctx)
+{
+ void *sc = zmq_socket (ctx, ZMQ_PUSH);
+ assert (sc);
+
+ int timeout = 100;
+ int rc = zmq_setsockopt (sc, ZMQ_SNDTIMEO, &timeout, sizeof (timeout));
+ assert (rc == 0);
+
+ rc = zmq_send (sc, 0, 0, ZMQ_DONTWAIT);
+ assert (rc == -1);
+ assert (errno == EAGAIN);
+
+ rc = zmq_send (sc, 0, 0, 0);
+ assert (rc == -1);
+ assert (errno == EAGAIN);
+
+ rc = zmq_close (sc);
+ assert (rc == 0);
+}
+
+void test_destroy_queue_on_disconnect (void *ctx)
+{
+ void *A = zmq_socket (ctx, ZMQ_PUSH);
+ assert (A);
+
+ int hwm = 1;
+ int rc = zmq_setsockopt (A, ZMQ_SNDHWM, &hwm, sizeof (hwm));
+ assert (rc == 0);
+
+ rc = zmq_bind (A, bind_address);
+ assert (rc == 0);
+
+ void *B = zmq_socket (ctx, ZMQ_PULL);
+ assert (B);
+
+ rc = zmq_setsockopt (B, ZMQ_RCVHWM, &hwm, sizeof (hwm));
+ assert (rc == 0);
+
+ rc = zmq_connect (B, connect_address);
+ assert (rc == 0);
+
+ // Send two messages, one should be stuck in A's outgoing queue, the other
+ // arrives at B.
+ s_send_seq (A, "ABC", SEQ_END);
+ s_send_seq (A, "DEF", SEQ_END);
+
+ // Both queues should now be full, indicated by A blocking on send.
+ rc = zmq_send (A, 0, 0, ZMQ_DONTWAIT);
+ assert (rc == -1);
+ assert (errno == EAGAIN);
+
+ rc = zmq_disconnect (B, connect_address);
+ assert (rc == 0);
+
+ // Disconnect may take time and need command processing.
+ zmq_pollitem_t poller [2] = { { A, 0, 0, 0 }, { B, 0, 0, 0 } };
+ rc = zmq_poll (poller, 2, 100);
+ assert (rc == 0);
+ rc = zmq_poll (poller, 2, 100);
+ assert (rc == 0);
+
+ zmq_msg_t msg;
+ rc = zmq_msg_init (&msg);
+ assert (rc == 0);
+
+ // Can't receive old data on B.
+ rc = zmq_msg_recv (&msg, B, ZMQ_DONTWAIT);
+ assert (rc == -1);
+ assert (errno == EAGAIN);
+
+ // Sending fails.
+ rc = zmq_send (A, 0, 0, ZMQ_DONTWAIT);
+ assert (rc == -1);
+ assert (errno == EAGAIN);
+
+ // Reconnect B
+ rc = zmq_connect (B, connect_address);
+ assert (rc == 0);
+
+ // Still can't receive old data on B.
+ rc = zmq_msg_recv (&msg, B, ZMQ_DONTWAIT);
+ assert (rc == -1);
+ assert (errno == EAGAIN);
+
+ // two messages should be sendable before the queues are filled up.
+ s_send_seq (A, "ABC", SEQ_END);
+ s_send_seq (A, "DEF", SEQ_END);
+
+ rc = zmq_send (A, 0, 0, ZMQ_DONTWAIT);
+ assert (rc == -1);
+ assert (errno == EAGAIN);
+
+ rc = zmq_msg_close (&msg);
+ assert (rc == 0);
+
+ close_zero_linger (A);
+ close_zero_linger (B);
+
+ // Wait for disconnects.
+ rc = zmq_poll (0, 0, 100);
+ assert (rc == 0);
+}
+
+int main (void)
+{
+ setup_test_environment();
+ void *ctx = zmq_ctx_new ();
+ assert (ctx);
+
+ const char *binds [] = { "inproc://a", "tcp://127.0.0.1:5555" };
+ const char *connects [] = { "inproc://a", "tcp://localhost:5555" };
+
+ for (int transport = 0; transport < 2; ++transport) {
+ bind_address = binds [transport];
+ connect_address = connects [transport];
+
+ // PUSH: SHALL route outgoing messages to connected peers using a
+ // round-robin strategy.
+ test_push_round_robin_out (ctx);
+
+ // PULL: SHALL receive incoming messages from its peers using a fair-queuing
+ // strategy.
+ test_pull_fair_queue_in (ctx);
+
+ // PUSH: SHALL block on sending, or return a suitable error, when it has no
+ // available peers.
+ test_push_block_on_send_no_peers (ctx);
+
+ // PUSH and PULL: SHALL create this queue when a peer connects to it. If
+ // this peer disconnects, the socket SHALL destroy its queue and SHALL
+ // discard any messages it contains.
+ // *** Test disabled until libzmq does this properly ***
+ // test_destroy_queue_on_disconnect (ctx);
+ }
+
+ int rc = zmq_ctx_term (ctx);
+ assert (rc == 0);
+
+ return 0 ;
+}
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "testutil.hpp"
+
+const char *bind_address = 0;
+const char *connect_address = 0;
+
+void test_fair_queue_in (void *ctx)
+{
+ void *rep = zmq_socket (ctx, ZMQ_REP);
+ assert (rep);
+
+ int timeout = 100;
+ int rc = zmq_setsockopt (rep, ZMQ_RCVTIMEO, &timeout, sizeof (int));
+ assert (rc == 0);
+
+ rc = zmq_bind (rep, bind_address);
+ assert (rc == 0);
+
+ const size_t services = 5;
+ void *reqs [services];
+ for (size_t peer = 0; peer < services; ++peer) {
+ reqs [peer] = zmq_socket (ctx, ZMQ_REQ);
+ assert (reqs [peer]);
+
+ rc = zmq_setsockopt (reqs [peer], ZMQ_RCVTIMEO, &timeout, sizeof (int));
+ assert (rc == 0);
+
+ rc = zmq_connect (reqs [peer], connect_address);
+ assert (rc == 0);
+ }
+
+ s_send_seq (reqs [0], "A", SEQ_END);
+ s_recv_seq (rep, "A", SEQ_END);
+ s_send_seq (rep, "A", SEQ_END);
+ s_recv_seq (reqs [0], "A", SEQ_END);
+
+ s_send_seq (reqs [0], "A", SEQ_END);
+ s_recv_seq (rep, "A", SEQ_END);
+ s_send_seq (rep, "A", SEQ_END);
+ s_recv_seq (reqs [0], "A", SEQ_END);
+
+ // TODO: following test fails randomly on some boxes
+#ifdef SOMEONE_FIXES_THIS
+ // send N requests
+ for (size_t peer = 0; peer < services; ++peer) {
+ char * str = strdup("A");
+ str [0] += peer;
+ s_send_seq (reqs [peer], str, SEQ_END);
+ free (str);
+ }
+
+ // handle N requests
+ for (size_t peer = 0; peer < services; ++peer) {
+ char * str = strdup("A");
+ str [0] += peer;
+ // Test fails here
+ s_recv_seq (rep, str, SEQ_END);
+ s_send_seq (rep, str, SEQ_END);
+ s_recv_seq (reqs [peer], str, SEQ_END);
+ free (str);
+ }
+#endif
+ close_zero_linger (rep);
+
+ for (size_t peer = 0; peer < services; ++peer)
+ close_zero_linger (reqs [peer]);
+
+ // Wait for disconnects.
+ rc = zmq_poll (0, 0, 100);
+ assert (rc == 0);
+}
+
+void test_envelope (void *ctx)
+{
+ void *rep = zmq_socket (ctx, ZMQ_REP);
+ assert (rep);
+
+ int rc = zmq_bind (rep, bind_address);
+ assert (rc == 0);
+
+ void *dealer = zmq_socket (ctx, ZMQ_DEALER);
+ assert (dealer);
+
+ rc = zmq_connect (dealer, connect_address);
+ assert (rc == 0);
+
+ // minimal envelope
+ s_send_seq (dealer, 0, "A", SEQ_END);
+ s_recv_seq (rep, "A", SEQ_END);
+ s_send_seq (rep, "A", SEQ_END);
+ s_recv_seq (dealer, 0, "A", SEQ_END);
+
+ // big envelope
+ s_send_seq (dealer, "X", "Y", 0, "A", SEQ_END);
+ s_recv_seq (rep, "A", SEQ_END);
+ s_send_seq (rep, "A", SEQ_END);
+ s_recv_seq (dealer, "X", "Y", 0, "A", SEQ_END);
+
+ close_zero_linger (rep);
+ close_zero_linger (dealer);
+
+ // Wait for disconnects.
+ rc = zmq_poll (0, 0, 100);
+ assert (rc == 0);
+}
+
+int main (void)
+{
+ setup_test_environment();
+ void *ctx = zmq_ctx_new ();
+ assert (ctx);
+
+ const char *binds [] = { "inproc://a", "tcp://127.0.0.1:5555" };
+ const char *connects [] = { "inproc://a", "tcp://localhost:5555" };
+
+ for (int transport = 0; transport < 2; ++transport) {
+ bind_address = binds [transport];
+ connect_address = connects [transport];
+
+ // SHALL receive incoming messages from its peers using a fair-queuing
+ // strategy.
+ test_fair_queue_in (ctx);
+
+ // For an incoming message:
+ // SHALL remove and store the address envelope, including the delimiter.
+ // SHALL pass the remaining data frames to its calling application.
+ // SHALL wait for a single reply message from its calling application.
+ // SHALL prepend the address envelope and delimiter.
+ // SHALL deliver this message back to the originating peer.
+ test_envelope (ctx);
+ }
+
+ int rc = zmq_ctx_term (ctx);
+ assert (rc == 0);
+
+ return 0 ;
+}
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "testutil.hpp"
+
+const char *bind_address = 0;
+const char *connect_address = 0;
+
+void test_round_robin_out (void *ctx)
+{
+ void *req = zmq_socket (ctx, ZMQ_REQ);
+ assert (req);
+
+ int rc = zmq_bind (req, bind_address);
+ assert (rc == 0);
+
+ const size_t services = 5;
+ void *rep [services];
+ for (size_t peer = 0; peer < services; peer++) {
+ rep [peer] = zmq_socket (ctx, ZMQ_REP);
+ assert (rep [peer]);
+
+ int timeout = 100;
+ rc = zmq_setsockopt (rep [peer], ZMQ_RCVTIMEO, &timeout, sizeof (int));
+ assert (rc == 0);
+
+ rc = zmq_connect (rep [peer], connect_address);
+ assert (rc == 0);
+ }
+ // We have to give the connects time to finish otherwise the requests
+ // will not properly round-robin. We could alternatively connect the
+ // REQ sockets to the REP sockets.
+ msleep (SETTLE_TIME);
+
+ // Send our peer-replies, and expect every REP it used once in order
+ for (size_t peer = 0; peer < services; peer++) {
+ s_send_seq (req, "ABC", SEQ_END);
+ s_recv_seq (rep [peer], "ABC", SEQ_END);
+ s_send_seq (rep [peer], "DEF", SEQ_END);
+ s_recv_seq (req, "DEF", SEQ_END);
+ }
+
+ close_zero_linger (req);
+ for (size_t peer = 0; peer < services; peer++)
+ close_zero_linger (rep [peer]);
+
+ // Wait for disconnects.
+ rc = zmq_poll (0, 0, 100);
+ assert (rc == 0);
+}
+
+void test_req_only_listens_to_current_peer (void *ctx)
+{
+ void *req = zmq_socket (ctx, ZMQ_REQ);
+ assert (req);
+
+ int rc = zmq_setsockopt(req, ZMQ_IDENTITY, "A", 2);
+ assert (rc == 0);
+
+ rc = zmq_bind (req, bind_address);
+ assert (rc == 0);
+
+ const size_t services = 3;
+ void *router [services];
+
+ for (size_t i = 0; i < services; ++i) {
+ router [i] = zmq_socket (ctx, ZMQ_ROUTER);
+ assert (router [i]);
+
+ int timeout = 100;
+ rc = zmq_setsockopt (router [i], ZMQ_RCVTIMEO, &timeout, sizeof (timeout));
+ assert (rc == 0);
+
+ int enabled = 1;
+ rc = zmq_setsockopt (router [i], ZMQ_ROUTER_MANDATORY, &enabled, sizeof (enabled));
+ assert (rc == 0);
+
+ rc = zmq_connect (router [i], connect_address);
+ assert (rc == 0);
+ }
+
+ // Wait for connects to finish.
+ rc = zmq_poll (0, 0, 100);
+ assert (rc == 0);
+
+ for (size_t i = 0; i < services; ++i) {
+ // There still is a race condition when a stale peer's message
+ // arrives at the REQ just after a request was sent to that peer.
+ // To avoid that happening in the test, sleep for a bit.
+ rc = zmq_poll (0, 0, 10);
+ assert (rc == 0);
+
+ s_send_seq (req, "ABC", SEQ_END);
+
+ // Receive on router i
+ s_recv_seq (router [i], "A", 0, "ABC", SEQ_END);
+
+ // Send back replies on all routers
+ for (size_t j = 0; j < services; ++j) {
+ const char *replies [] = { "WRONG", "GOOD" };
+ const char *reply = replies [i == j ? 1 : 0];
+ s_send_seq (router [j], "A", 0, reply, SEQ_END);
+ }
+
+ // Receive only the good reply
+ s_recv_seq (req, "GOOD", SEQ_END);
+ }
+
+ close_zero_linger (req);
+ for (size_t i = 0; i < services; ++i)
+ close_zero_linger (router [i]);
+
+ // Wait for disconnects.
+ rc = zmq_poll (0, 0, 100);
+ assert (rc == 0);
+}
+
+void test_req_message_format (void *ctx)
+{
+ void *req = zmq_socket (ctx, ZMQ_REQ);
+ assert (req);
+
+ void *router = zmq_socket (ctx, ZMQ_ROUTER);
+ assert (router);
+
+ int rc = zmq_bind (req, bind_address);
+ assert (rc == 0);
+
+ rc = zmq_connect (router, connect_address);
+ assert (rc == 0);
+
+ // Send a multi-part request.
+ s_send_seq (req, "ABC", "DEF", SEQ_END);
+
+ zmq_msg_t msg;
+ zmq_msg_init (&msg);
+
+ // Receive peer identity
+ rc = zmq_msg_recv (&msg, router, 0);
+ assert (rc != -1);
+ assert (zmq_msg_size (&msg) > 0);
+ zmq_msg_t peer_id_msg;
+ zmq_msg_init (&peer_id_msg);
+ zmq_msg_copy (&peer_id_msg, &msg);
+
+ int more = 0;
+ size_t more_size = sizeof (more);
+ rc = zmq_getsockopt (router, ZMQ_RCVMORE, &more, &more_size);
+ assert (rc == 0);
+ assert (more);
+
+ // Receive the rest.
+ s_recv_seq (router, 0, "ABC", "DEF", SEQ_END);
+
+ // Send back a single-part reply.
+ rc = zmq_msg_send (&peer_id_msg, router, ZMQ_SNDMORE);
+ assert (rc != -1);
+ s_send_seq (router, 0, "GHI", SEQ_END);
+
+ // Receive reply.
+ s_recv_seq (req, "GHI", SEQ_END);
+
+ rc = zmq_msg_close (&msg);
+ assert (rc == 0);
+
+ rc = zmq_msg_close (&peer_id_msg);
+ assert (rc == 0);
+
+ close_zero_linger (req);
+ close_zero_linger (router);
+
+ // Wait for disconnects.
+ rc = zmq_poll (0, 0, 100);
+ assert (rc == 0);
+}
+
+void test_block_on_send_no_peers (void *ctx)
+{
+ void *sc = zmq_socket (ctx, ZMQ_REQ);
+ assert (sc);
+
+ int timeout = 100;
+ int rc = zmq_setsockopt (sc, ZMQ_SNDTIMEO, &timeout, sizeof (timeout));
+ assert (rc == 0);
+
+ rc = zmq_send (sc, 0, 0, ZMQ_DONTWAIT);
+ assert (rc == -1);
+ assert (errno == EAGAIN);
+
+ rc = zmq_send (sc, 0, 0, 0);
+ assert (rc == -1);
+ assert (errno == EAGAIN);
+
+ rc = zmq_close (sc);
+ assert (rc == 0);
+}
+
+int main (void)
+{
+ setup_test_environment();
+ void *ctx = zmq_ctx_new ();
+ assert (ctx);
+
+ const char *binds [] = { "inproc://a", "tcp://127.0.0.1:5555" };
+ const char *connects [] = { "inproc://a", "tcp://localhost:5555" };
+
+ for (int transport = 0; transport < 2; transport++) {
+ bind_address = binds [transport];
+ connect_address = connects [transport];
+
+ // SHALL route outgoing messages to connected peers using a round-robin
+ // strategy.
+ test_round_robin_out (ctx);
+
+ // The request and reply messages SHALL have this format on the wire:
+ // * A delimiter, consisting of an empty frame, added by the REQ socket.
+ // * One or more data frames, comprising the message visible to the
+ // application.
+ test_req_message_format (ctx);
+
+ // SHALL block on sending, or return a suitable error, when it has no
+ // connected peers.
+ test_block_on_send_no_peers (ctx);
+
+ // SHALL accept an incoming message only from the last peer that it sent a
+ // request to.
+ // SHALL discard silently any messages received from other peers.
+ // PH: this test is still failing; disabled for now to allow build to
+ // complete.
+ // test_req_only_listens_to_current_peer (ctx);
+ }
+
+ int rc = zmq_ctx_term (ctx);
+ assert (rc == 0);
+
+ return 0 ;
+}
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "testutil.hpp"
+
+const char *bind_address = 0;
+const char *connect_address = 0;
+
+void test_fair_queue_in (void *ctx)
+{
+ void *receiver = zmq_socket (ctx, ZMQ_ROUTER);
+ assert (receiver);
+
+ int timeout = 100;
+ int rc = zmq_setsockopt (receiver, ZMQ_RCVTIMEO, &timeout, sizeof (int));
+ assert (rc == 0);
+
+ rc = zmq_bind (receiver, bind_address);
+ assert (rc == 0);
+
+ const size_t services = 5;
+ void *senders [services];
+ for (size_t peer = 0; peer < services; ++peer) {
+ senders [peer] = zmq_socket (ctx, ZMQ_DEALER);
+ assert (senders [peer]);
+
+ rc = zmq_setsockopt (senders [peer], ZMQ_RCVTIMEO, &timeout, sizeof (int));
+ assert (rc == 0);
+
+ char *str = strdup("A");
+ str [0] += peer;
+ rc = zmq_setsockopt (senders [peer], ZMQ_IDENTITY, str, 2);
+ assert (rc == 0);
+ free (str);
+
+ rc = zmq_connect (senders [peer], connect_address);
+ assert (rc == 0);
+ }
+
+ zmq_msg_t msg;
+ rc = zmq_msg_init (&msg);
+ assert (rc == 0);
+
+ s_send_seq (senders [0], "M", SEQ_END);
+ s_recv_seq (receiver, "A", "M", SEQ_END);
+
+ s_send_seq (senders [0], "M", SEQ_END);
+ s_recv_seq (receiver, "A", "M", SEQ_END);
+
+ int sum = 0;
+
+ // send N requests
+ for (size_t peer = 0; peer < services; ++peer) {
+ s_send_seq (senders [peer], "M", SEQ_END);
+ sum += 'A' + peer;
+ }
+
+ assert (sum == services * 'A' + services * (services - 1) / 2);
+
+ // handle N requests
+ for (size_t peer = 0; peer < services; ++peer) {
+ rc = zmq_msg_recv (&msg, receiver, 0);
+ assert (rc == 2);
+ const char *id = (const char *)zmq_msg_data (&msg);
+ sum -= id [0];
+
+ s_recv_seq (receiver, "M", SEQ_END);
+ }
+
+ assert (sum == 0);
+
+ rc = zmq_msg_close (&msg);
+ assert (rc == 0);
+
+ close_zero_linger (receiver);
+
+ for (size_t peer = 0; peer < services; ++peer)
+ close_zero_linger (senders [peer]);
+
+ // Wait for disconnects.
+ rc = zmq_poll (0, 0, 100);
+ assert (rc == 0);
+}
+
+void test_destroy_queue_on_disconnect (void *ctx)
+{
+ void *A = zmq_socket (ctx, ZMQ_ROUTER);
+ assert (A);
+
+ int enabled = 1;
+ int rc = zmq_setsockopt (A, ZMQ_ROUTER_MANDATORY, &enabled, sizeof (enabled));
+ assert (rc == 0);
+
+ rc = zmq_bind (A, bind_address);
+ assert (rc == 0);
+
+ void *B = zmq_socket (ctx, ZMQ_DEALER);
+ assert (B);
+
+ rc = zmq_setsockopt (B, ZMQ_IDENTITY, "B", 2);
+ assert (rc == 0);
+
+ rc = zmq_connect (B, connect_address);
+ assert (rc == 0);
+
+ // Wait for connection.
+ rc = zmq_poll (0, 0, 100);
+ assert (rc == 0);
+
+ // Send a message in both directions
+ s_send_seq (A, "B", "ABC", SEQ_END);
+ s_send_seq (B, "DEF", SEQ_END);
+
+ rc = zmq_disconnect (B, connect_address);
+ assert (rc == 0);
+
+ // Disconnect may take time and need command processing.
+ zmq_pollitem_t poller [2] = { { A, 0, 0, 0 }, { B, 0, 0, 0 } };
+ rc = zmq_poll (poller, 2, 100);
+ assert (rc == 0);
+ rc = zmq_poll (poller, 2, 100);
+ assert (rc == 0);
+
+ // No messages should be available, sending should fail.
+ zmq_msg_t msg;
+ zmq_msg_init (&msg);
+
+ rc = zmq_send (A, "B", 2, ZMQ_SNDMORE | ZMQ_DONTWAIT);
+ assert (rc == -1);
+ assert (errno == EHOSTUNREACH);
+
+ rc = zmq_msg_recv (&msg, A, ZMQ_DONTWAIT);
+ assert (rc == -1);
+ assert (errno == EAGAIN);
+
+ // After a reconnect of B, the messages should still be gone
+ rc = zmq_connect (B, connect_address);
+ assert (rc == 0);
+
+ rc = zmq_msg_recv (&msg, A, ZMQ_DONTWAIT);
+ assert (rc == -1);
+ assert (errno == EAGAIN);
+
+ rc = zmq_msg_recv (&msg, B, ZMQ_DONTWAIT);
+ assert (rc == -1);
+ assert (errno == EAGAIN);
+
+ rc = zmq_msg_close (&msg);
+ assert (rc == 0);
+
+ close_zero_linger (A);
+ close_zero_linger (B);
+
+ // Wait for disconnects.
+ rc = zmq_poll (0, 0, 100);
+ assert (rc == 0);
+}
+
+
+int main (void)
+{
+ setup_test_environment();
+ void *ctx = zmq_ctx_new ();
+ assert (ctx);
+
+ const char *binds [] = { "inproc://a", "tcp://127.0.0.1:5555" };
+ const char *connects [] = { "inproc://a", "tcp://localhost:5555" };
+
+ for (int transport = 0; transport < 2; ++transport) {
+ bind_address = binds [transport];
+ connect_address = connects [transport];
+
+ // SHALL receive incoming messages from its peers using a fair-queuing
+ // strategy.
+ test_fair_queue_in (ctx);
+
+ // SHALL create a double queue when a peer connects to it. If this peer
+ // disconnects, the ROUTER socket SHALL destroy its double queue and SHALL
+ // discard any messages it contains.
+ // *** Test disabled until libzmq does this properly ***
+ // test_destroy_queue_on_disconnect (ctx);
+ }
+
+ int rc = zmq_ctx_term (ctx);
+ assert (rc == 0);
+
+ return 0 ;
+}
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "testutil.hpp"
+
+// ZMTP protocol greeting structure
+
+typedef unsigned char byte;
+typedef struct {
+ byte signature [10]; // 0xFF 8*0x00 0x7F
+ byte version [2]; // 0x03 0x00 for ZMTP/3.0
+ byte mechanism [20]; // "NULL"
+ byte as_server;
+ byte filler [31];
+} zmtp_greeting_t;
+
+#define ZMTP_DEALER 5 // Socket type constants
+
+// This is a greeting matching what 0MQ will send us; note the
+// 8-byte size is set to 1 for backwards compatibility
+
+static zmtp_greeting_t greeting
+ = { { 0xFF, 0, 0, 0, 0, 0, 0, 0, 1, 0x7F }, { 3, 0 }, { 'N', 'U', 'L', 'L'} };
+
+static void
+test_stream_to_dealer (void)
+{
+ int rc;
+
+ // Set up our context and sockets
+ void *ctx = zmq_ctx_new ();
+ assert (ctx);
+
+ // We'll be using this socket in raw mode
+ void *stream = zmq_socket (ctx, ZMQ_STREAM);
+ assert (stream);
+
+ int zero = 0;
+ rc = zmq_setsockopt (stream, ZMQ_LINGER, &zero, sizeof (zero));
+ assert (rc == 0);
+ rc = zmq_bind (stream, "tcp://127.0.0.1:5556");
+ assert (rc == 0);
+
+ // We'll be using this socket as the other peer
+ void *dealer = zmq_socket (ctx, ZMQ_DEALER);
+ assert (dealer);
+ rc = zmq_setsockopt (dealer, ZMQ_LINGER, &zero, sizeof (zero));
+ assert (rc == 0);
+ rc = zmq_connect (dealer, "tcp://localhost:5556");
+
+ // Send a message on the dealer socket
+ rc = zmq_send (dealer, "Hello", 5, 0);
+ assert (rc == 5);
+
+ // First frame is identity
+ zmq_msg_t identity;
+ rc = zmq_msg_init (&identity);
+ assert (rc == 0);
+ rc = zmq_msg_recv (&identity, stream, 0);
+ assert (rc > 0);
+ assert (zmq_msg_more (&identity));
+
+ // Second frame is greeting signature
+ byte buffer [255];
+ rc = zmq_recv (stream, buffer, 255, 0);
+ assert (rc == 10);
+ assert (memcmp (buffer, greeting.signature, 10) == 0);
+
+ // Send our own protocol greeting
+ rc = zmq_msg_send (&identity, stream, ZMQ_SNDMORE);
+ assert (rc > 0);
+ rc = zmq_send (stream, &greeting, sizeof (greeting), 0);
+ assert (rc == sizeof (greeting));
+
+ // Now we expect the data from the DEALER socket
+ // We want the rest of greeting along with the Ready command
+ int bytes_read = 0;
+ while (bytes_read < 97) {
+ // First frame is the identity of the connection (each time)
+ rc = zmq_msg_recv (&identity, stream, 0);
+ assert (rc > 0);
+ assert (zmq_msg_more (&identity));
+ // Second frame contains the next chunk of data
+ rc = zmq_recv (stream, buffer + bytes_read, 255 - bytes_read, 0);
+ assert (rc >= 0);
+ bytes_read += rc;
+ }
+
+ // First two bytes are major and minor version numbers.
+ assert (buffer [0] == 3); // ZMTP/3.0
+ assert (buffer [1] == 0);
+
+ // Mechanism is "NULL"
+ assert (memcmp (buffer + 2, "NULL\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 20) == 0);
+ assert (memcmp (buffer + 54, "\4\51\5READY", 8) == 0);
+ assert (memcmp (buffer + 62, "\13Socket-Type\0\0\0\6DEALER", 22) == 0);
+ assert (memcmp (buffer + 84, "\10Identity\0\0\0\0", 13) == 0);
+
+ // Announce we are ready
+ memcpy (buffer, "\4\51\5READY", 8);
+ memcpy (buffer + 8, "\13Socket-Type\0\0\0\6ROUTER", 22);
+ memcpy (buffer + 30, "\10Identity\0\0\0\0", 13);
+
+ // Send Ready command
+ rc = zmq_msg_send (&identity, stream, ZMQ_SNDMORE);
+ assert (rc > 0);
+ rc = zmq_send (stream, buffer, 43, 0);
+ assert (rc == 43);
+
+ // Now we expect the data from the DEALER socket
+ // First frame is, again, the identity of the connection
+ rc = zmq_msg_recv (&identity, stream, 0);
+ assert (rc > 0);
+ assert (zmq_msg_more (&identity));
+
+ // Third frame contains Hello message from DEALER
+ rc = zmq_recv (stream, buffer, sizeof buffer, 0);
+ assert (rc == 7);
+
+ // Then we have a 5-byte message "Hello"
+ assert (buffer [0] == 0); // Flags = 0
+ assert (buffer [1] == 5); // Size = 5
+ assert (memcmp (buffer + 2, "Hello", 5) == 0);
+
+ // Send "World" back to DEALER
+ rc = zmq_msg_send (&identity, stream, ZMQ_SNDMORE);
+ assert (rc > 0);
+ byte world [] = { 0, 5, 'W', 'o', 'r', 'l', 'd' };
+ rc = zmq_send (stream, world, sizeof (world), 0);
+ assert (rc == sizeof (world));
+
+ // Expect response on DEALER socket
+ rc = zmq_recv (dealer, buffer, 255, 0);
+ assert (rc == 5);
+ assert (memcmp (buffer, "World", 5) == 0);
+
+ rc = zmq_close (dealer);
+ assert (rc == 0);
+
+ rc = zmq_close (stream);
+ assert (rc == 0);
+
+ rc = zmq_ctx_term (ctx);
+ assert (rc == 0);
+}
+
+
+static void
+test_stream_to_stream (void)
+{
+ int rc;
+ // Set-up our context and sockets
+ void *ctx = zmq_ctx_new ();
+ assert (ctx);
+
+ void *server = zmq_socket (ctx, ZMQ_STREAM);
+ assert (server);
+ rc = zmq_bind (server, "tcp://127.0.0.1:9080");
+ assert (rc == 0);
+
+ void *client = zmq_socket (ctx, ZMQ_STREAM);
+ assert (client);
+ rc = zmq_connect (client, "tcp://localhost:9080");
+ assert (rc == 0);
+ // It would be less surprising to get an empty message instead
+ // of having to fetch the identity like this [PH 2013/06/27]
+ uint8_t id [256];
+ size_t id_size = 256;
+ rc = zmq_getsockopt (client, ZMQ_IDENTITY, id, &id_size);
+ assert (rc == 0);
+
+ // Sent HTTP request on client socket
+ // First frame is server identity
+ rc = zmq_send (client, id, id_size, ZMQ_SNDMORE);
+ assert (rc == (int) id_size);
+ // Second frame is HTTP GET request
+ rc = zmq_send (client, "GET /\n\n", 7, 0);
+ assert (rc == 7);
+
+ // Get HTTP request; ID frame and then request
+ id_size = zmq_recv (server, id, 256, 0);
+ assert (id_size > 0);
+ uint8_t buffer [256];
+ rc = zmq_recv (server, buffer, 256, 0);
+ assert (rc > 0);
+ assert (memcmp (buffer, "GET /\n\n", 7) == 0);
+
+ // Send reply back to client
+ char http_response [] =
+ "HTTP/1.0 200 OK\r\n"
+ "Content-Type: text/plain\r\n"
+ "\r\n"
+ "Hello, World!";
+ zmq_send (server, id, id_size, ZMQ_SNDMORE);
+ zmq_send (server, http_response, sizeof (http_response), 0);
+
+ // Get reply at client and check that it's complete
+ id_size = zmq_recv (client, id, 256, 0);
+ assert (id_size > 0);
+ rc = zmq_recv (client, buffer, 256, 0);
+ assert (rc == sizeof (http_response));
+ assert (memcmp (buffer, http_response, sizeof (http_response)) == 0);
+}
+
+
+int main (void)
+{
+ setup_test_environment();
+ test_stream_to_dealer ();
+ test_stream_to_stream ();
+}
/*
- Copyright (c) 2010-2011 250bpm s.r.o.
- Copyright (c) 2011 iMatix Corporation
- Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "../include/zmq.h"
-#include "../include/zmq_utils.h"
-#include <stdio.h>
-
-#undef NDEBUG
-#include <assert.h>
+#include "testutil.hpp"
int main (void)
{
- fprintf (stderr, "test_sub_forward running...\n");
-
- void *ctx = zmq_init (1);
+ setup_test_environment();
+ void *ctx = zmq_ctx_new ();
assert (ctx);
- // First, create an intermediate device.
+ // First, create an intermediate device
void *xpub = zmq_socket (ctx, ZMQ_XPUB);
assert (xpub);
int rc = zmq_bind (xpub, "tcp://127.0.0.1:5560");
rc = zmq_bind (xsub, "tcp://127.0.0.1:5561");
assert (rc == 0);
- // Create a publisher.
+ // Create a publisher
void *pub = zmq_socket (ctx, ZMQ_PUB);
assert (pub);
rc = zmq_connect (pub, "tcp://127.0.0.1:5561");
assert (rc == 0);
- // Create a subscriber.
+ // Create a subscriber
void *sub = zmq_socket (ctx, ZMQ_SUB);
assert (sub);
rc = zmq_connect (sub, "tcp://127.0.0.1:5560");
rc = zmq_setsockopt (sub, ZMQ_SUBSCRIBE, "", 0);
assert (rc == 0);
- // Pass the subscription upstream through the device.
+ // Pass the subscription upstream through the device
char buff [32];
rc = zmq_recv (xpub, buff, sizeof (buff), 0);
assert (rc >= 0);
rc = zmq_send (xsub, buff, rc, 0);
assert (rc >= 0);
- // Wait a bit till the subscription gets to the publisher.
- zmq_sleep (1);
+ // Wait a bit till the subscription gets to the publisher
+ msleep (SETTLE_TIME);
- // Send an empty message.
+ // Send an empty message
rc = zmq_send (pub, NULL, 0, 0);
assert (rc == 0);
- // Pass the message downstream through the device.
+ // Pass the message downstream through the device
rc = zmq_recv (xsub, buff, sizeof (buff), 0);
assert (rc >= 0);
rc = zmq_send (xpub, buff, rc, 0);
assert (rc >= 0);
- // Receive the message in the subscriber.
+ // Receive the message in the subscriber
rc = zmq_recv (sub, buff, sizeof (buff), 0);
assert (rc == 0);
assert (rc == 0);
rc = zmq_close (sub);
assert (rc == 0);
- rc = zmq_term (ctx);
+ rc = zmq_ctx_term (ctx);
assert (rc == 0);
return 0 ;
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "testutil.hpp"
+
+#if defined (ZMQ_HAVE_WINDOWS)
+# include <winsock2.h>
+# include <stdexcept>
+#else
+# include <sys/socket.h>
+# include <netinet/in.h>
+# include <unistd.h>
+#endif
+
+#if defined (ZMQ_HAVE_WINDOWS)
+
+void initialise_network()
+{
+ WSADATA info;
+ if (WSAStartup(MAKEWORD(2,0), &info) != 0)
+ {
+ throw std::runtime_error("Could not start WSA");
+ }
+}
+
+int close(int fd)
+{
+ return closesocket(fd);
+}
+
+#else
+
+void initialise_network()
+{
+}
+
+#endif
+
+// This test case stresses the system to shake out known configuration
+// problems. We're not using libzmq here but direct system calls. Note
+// that code may need wrapping to be properly portable.
+
+int main (void)
+{
+ initialise_network();
+
+ // Check that we can create 1,000 sockets
+ int handle [1000];
+ int count;
+ for (count = 0; count < 1000; count++) {
+ handle [count] = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP);
+ if (handle [count] == -1) {
+ printf ("W: Only able to create %d sockets on this box\n", count);
+ printf ("I: Tune your system to increase maximum allowed file handles\n");
+#if defined (ZMQ_HAVE_OSX)
+ printf ("I: On OS/X, run 'ulimit -n 1200' in bash");
+#elif defined (ZMQ_HAVE_LINUX)
+ printf ("I: On Linux, run 'ulimit -n 1200' in bash");
+#endif
+ return -1;
+ }
+ }
+ // Release the socket handles
+ while (count)
+ close (handle [count--]);
+}
/*
- Copyright (c) 2010-2011 250bpm s.r.o.
- Copyright (c) 2011 iMatix Corporation
- Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "../include/zmq.h"
-#include "../include/zmq_utils.h"
-#include <string.h>
-#include <unistd.h>
-
-#undef NDEBUG
-#include <assert.h>
+#include "testutil.hpp"
int main (void)
{
+ setup_test_environment();
int rc;
char buf[32];
const char *ep = "tcp://127.0.0.1:5560";
- fprintf (stderr, "unbind endpoint test running...\n");
-
// Create infrastructure.
- void *ctx = zmq_init (1);
+ void *ctx = zmq_ctx_new ();
assert (ctx);
void *push = zmq_socket (ctx, ZMQ_PUSH);
assert (push);
rc = zmq_connect (pull, ep);
assert (rc == 0);
- // Pass one message through to ensure the connection is established.
+ // Pass one message through to ensure the connection is established
rc = zmq_send (push, "ABC", 3, 0);
assert (rc == 3);
rc = zmq_recv (pull, buf, sizeof (buf), 0);
assert (rc == 3);
- // Unbind the lisnening endpoint
+ // Unbind the listening endpoint
rc = zmq_unbind (push, ep);
assert (rc == 0);
- // Let events some time
- zmq_sleep (1);
+ // Allow unbind to settle
+ msleep (SETTLE_TIME);
- // Check that sending would block (there's no outbound connection).
+ // Check that sending would block (there's no outbound connection)
rc = zmq_send (push, "ABC", 3, ZMQ_DONTWAIT);
assert (rc == -1 && zmq_errno () == EAGAIN);
- // Clean up.
+ // Clean up
rc = zmq_close (pull);
assert (rc == 0);
rc = zmq_close (push);
assert (rc == 0);
- rc = zmq_term (ctx);
+ rc = zmq_ctx_term (ctx);
assert (rc == 0);
-
- // Now the other way round.
- fprintf (stderr, "disconnect endpoint test running...\n");
-
-
- // Create infrastructure.
- ctx = zmq_init (1);
+ // Create infrastructure
+ ctx = zmq_ctx_new ();
assert (ctx);
push = zmq_socket (ctx, ZMQ_PUSH);
assert (push);
rc = zmq_recv (pull, buf, sizeof (buf), 0);
assert (rc == 3);
- // Disconnect the bound endpoint
+ // Disconnect the bound endpoint
rc = zmq_disconnect (push, ep);
assert (rc == 0);
- // Let events some time
- zmq_sleep (1);
+ // Allow disconnect to settle
+ msleep (SETTLE_TIME);
// Check that sending would block (there's no inbound connections).
rc = zmq_send (push, "ABC", 3, ZMQ_DONTWAIT);
assert (rc == 0);
rc = zmq_close (push);
assert (rc == 0);
- rc = zmq_term (ctx);
+ rc = zmq_ctx_term (ctx);
assert (rc == 0);
return 0;
/*
- Copyright (c) 2010-2011 250bpm s.r.o.
- Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "../include/zmq.h"
-#include "../include/zmq_utils.h"
-#include <pthread.h>
-#include <stdio.h>
-#include <string.h>
-
-#undef NDEBUG
-#include <assert.h>
-
-extern "C"
-{
- void *worker(void *ctx)
- {
- // Worker thread connects after delay of 1 second. Then it waits
- // for 1 more second, so that async connect has time to succeed.
- zmq_sleep (1);
- void *sc = zmq_socket (ctx, ZMQ_PUSH);
- assert (sc);
- int rc = zmq_connect (sc, "inproc://timeout_test");
- assert (rc == 0);
- zmq_sleep (1);
- rc = zmq_close (sc);
- assert (rc == 0);
- return NULL;
- }
-}
+#include "testutil.hpp"
int main (void)
{
- fprintf (stderr, "test_timeo running...\n");
-
- void *ctx = zmq_init (1);
+ setup_test_environment();
+ void *ctx = zmq_ctx_new ();
assert (ctx);
- // Create a disconnected socket.
- void *sb = zmq_socket (ctx, ZMQ_PULL);
- assert (sb);
- int rc = zmq_bind (sb, "inproc://timeout_test");
+ void *frontend = zmq_socket (ctx, ZMQ_DEALER);
+ assert (frontend);
+ int rc = zmq_bind (frontend, "inproc://timeout_test");
assert (rc == 0);
- // Check whether non-blocking recv returns immediately.
- char buf [] = "12345678ABCDEFGH12345678abcdefgh";
- rc = zmq_recv (sb, buf, 32, ZMQ_DONTWAIT);
+ // Receive on disconnected socket returns immediately
+ char buffer [32];
+ rc = zmq_recv (frontend, buffer, 32, ZMQ_DONTWAIT);
assert (rc == -1);
assert (zmq_errno() == EAGAIN);
+
+ // Check whether receive timeout is honored
+ int timeout = 250;
+ rc = zmq_setsockopt (frontend, ZMQ_RCVTIMEO, &timeout, sizeof (int));
+ assert (rc == 0);
- // Check whether recv timeout is honoured.
- int timeout = 500;
- size_t timeout_size = sizeof timeout;
- rc = zmq_setsockopt(sb, ZMQ_RCVTIMEO, &timeout, timeout_size);
- assert (rc == 0);
- void *watch = zmq_stopwatch_start ();
- rc = zmq_recv (sb, buf, 32, 0);
+ void* stopwatch = zmq_stopwatch_start();
+ rc = zmq_recv (frontend, buffer, 32, 0);
assert (rc == -1);
assert (zmq_errno () == EAGAIN);
- unsigned long elapsed = zmq_stopwatch_stop (watch);
- assert (elapsed > 440000 && elapsed < 550000);
+ unsigned int elapsed = zmq_stopwatch_stop(stopwatch) / 1000;
+ assert (elapsed > 200 && elapsed < 300);
- // Check whether connection during the wait doesn't distort the timeout.
- timeout = 2000;
- rc = zmq_setsockopt(sb, ZMQ_RCVTIMEO, &timeout, timeout_size);
+ // Check that normal message flow works as expected
+ void *backend = zmq_socket (ctx, ZMQ_DEALER);
+ assert (backend);
+ rc = zmq_connect (backend, "inproc://timeout_test");
assert (rc == 0);
- pthread_t thread;
- rc = pthread_create (&thread, NULL, worker, ctx);
- assert (rc == 0);
- watch = zmq_stopwatch_start ();
- rc = zmq_recv (sb, buf, 32, 0);
- assert (rc == -1);
- assert (zmq_errno () == EAGAIN);
- elapsed = zmq_stopwatch_stop (watch);
- assert (elapsed > 1900000 && elapsed < 2100000);
- rc = pthread_join (thread, NULL);
+ rc = zmq_setsockopt (backend, ZMQ_SNDTIMEO, &timeout, sizeof (int));
assert (rc == 0);
- // Check that timeouts don't break normal message transfer.
- void *sc = zmq_socket (ctx, ZMQ_PUSH);
- assert (sc);
- rc = zmq_setsockopt(sb, ZMQ_RCVTIMEO, &timeout, timeout_size);
- assert (rc == 0);
- rc = zmq_setsockopt(sb, ZMQ_SNDTIMEO, &timeout, timeout_size);
- assert (rc == 0);
- rc = zmq_connect (sc, "inproc://timeout_test");
- assert (rc == 0);
- rc = zmq_send (sc, buf, 32, 0);
- assert (rc == 32);
- rc = zmq_recv (sb, buf, 32, 0);
- assert (rc == 32);
+ rc = zmq_send (backend, "Hello", 5, 0);
+ assert (rc == 5);
+ rc = zmq_recv (frontend, buffer, 32, 0);
+ assert (rc == 5);
- // Clean-up.
- rc = zmq_close (sc);
+ // Clean-up
+ rc = zmq_close (backend);
assert (rc == 0);
- rc = zmq_close (sb);
+
+ rc = zmq_close (frontend);
assert (rc == 0);
- rc = zmq_term (ctx);
+
+ rc = zmq_ctx_term (ctx);
assert (rc == 0);
return 0 ;
}
-
/*
- Copyright (c) 2009-2011 250bpm s.r.o.
- Copyright (c) 2007-2011 iMatix Corporation
- Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef __ZMQ_TEST_TESTUTIL_HPP_INCLUDED__
-#define __ZMQ_TEST_TESTUTIL_HPP_INCLUDED__
+#ifndef __TESTUTIL_HPP_INCLUDED__
+#define __TESTUTIL_HPP_INCLUDED__
#include "../include/zmq.h"
-#include <string.h>
+#include "../include/zmq_utils.h"
+#include "platform.hpp"
+
+// This defines the settle time used in tests; raise this if we
+// get test failures on slower systems due to binds/connects not
+// settled. Tested to work reliably at 1 msec on a fast PC.
+#define SETTLE_TIME 10 // In msec
#undef NDEBUG
+#include <time.h>
#include <assert.h>
+#include <stdarg.h>
+#include <string>
+
+#if defined _WIN32
+# if defined _MSC_VER
+# include <crtdbg.h>
+# pragma warning(disable:4996)
+# endif
+#else
+# include <unistd.h>
+# include <signal.h>
+# include <stdlib.h>
+# include <sys/wait.h>
+#endif
+
+// Bounce a message from client to server and back
+// For REQ/REP or DEALER/DEALER pairs only
-inline void bounce (void *sb, void *sc)
+void
+bounce (void *server, void *client)
{
const char *content = "12345678ABCDEFGH12345678abcdefgh";
- // Send the message.
- int rc = zmq_send (sc, content, 32, ZMQ_SNDMORE);
+ // Send message from client to server
+ int rc = zmq_send (client, content, 32, ZMQ_SNDMORE);
assert (rc == 32);
- rc = zmq_send (sc, content, 32, 0);
+ rc = zmq_send (client, content, 32, 0);
assert (rc == 32);
- // Bounce the message back.
- char buf1 [32];
- rc = zmq_recv (sb, buf1, 32, 0);
+ // Receive message at server side
+ char buffer [32];
+ rc = zmq_recv (server, buffer, 32, 0);
assert (rc == 32);
+ // Check that message is still the same
+ assert (memcmp (buffer, content, 32) == 0);
int rcvmore;
size_t sz = sizeof (rcvmore);
- rc = zmq_getsockopt (sb, ZMQ_RCVMORE, &rcvmore, &sz);
+ rc = zmq_getsockopt (server, ZMQ_RCVMORE, &rcvmore, &sz);
assert (rc == 0);
assert (rcvmore);
- rc = zmq_recv (sb, buf1, 32, 0);
+ rc = zmq_recv (server, buffer, 32, 0);
assert (rc == 32);
- rc = zmq_getsockopt (sb, ZMQ_RCVMORE, &rcvmore, &sz);
+ // Check that message is still the same
+ assert (memcmp (buffer, content, 32) == 0);
+ rc = zmq_getsockopt (server, ZMQ_RCVMORE, &rcvmore, &sz);
assert (rc == 0);
assert (!rcvmore);
- rc = zmq_send (sb, buf1, 32, ZMQ_SNDMORE);
+
+ // Send two parts back to client
+ rc = zmq_send (server, buffer, 32, ZMQ_SNDMORE);
assert (rc == 32);
- rc = zmq_send (sb, buf1, 32, 0);
+ rc = zmq_send (server, buffer, 32, 0);
assert (rc == 32);
- // Receive the bounced message.
- char buf2 [32];
- rc = zmq_recv (sc, buf2, 32, 0);
+ // Receive the two parts at the client side
+ rc = zmq_recv (client, buffer, 32, 0);
assert (rc == 32);
- rc = zmq_getsockopt (sc, ZMQ_RCVMORE, &rcvmore, &sz);
+ // Check that message is still the same
+ assert (memcmp (buffer, content, 32) == 0);
+ rc = zmq_getsockopt (client, ZMQ_RCVMORE, &rcvmore, &sz);
assert (rc == 0);
assert (rcvmore);
- rc = zmq_recv (sc, buf2, 32, 0);
+ rc = zmq_recv (client, buffer, 32, 0);
assert (rc == 32);
- rc = zmq_getsockopt (sc, ZMQ_RCVMORE, &rcvmore, &sz);
+ // Check that message is still the same
+ assert (memcmp (buffer, content, 32) == 0);
+ rc = zmq_getsockopt (client, ZMQ_RCVMORE, &rcvmore, &sz);
assert (rc == 0);
assert (!rcvmore);
+}
+
+// Same as bounce, but expect messages to never arrive
+// for security or subscriber reasons.
+
+void
+expect_bounce_fail (void *server, void *client)
+{
+ const char *content = "12345678ABCDEFGH12345678abcdefgh";
+ char buffer [32];
+
+ // Send message from client to server
+ int rc = zmq_send (client, content, 32, ZMQ_SNDMORE);
+ assert (rc == 32);
+ rc = zmq_send (client, content, 32, 0);
+ assert (rc == 32);
+
+ // Receive message at server side (should not succeed)
+ int timeout = 150;
+ rc = zmq_setsockopt (server, ZMQ_RCVTIMEO, &timeout, sizeof (int));
+ assert (rc == 0);
+ rc = zmq_recv (server, buffer, 32, 0);
+ assert (rc == -1);
+ assert (zmq_errno () == EAGAIN);
+
+ // Send message from server to client to test other direction
+ rc = zmq_send (server, content, 32, ZMQ_SNDMORE);
+ assert (rc == 32);
+ rc = zmq_send (server, content, 32, 0);
+ assert (rc == 32);
+
+ // Receive message at client side (should not succeed)
+ rc = zmq_setsockopt (client, ZMQ_RCVTIMEO, &timeout, sizeof (int));
+ assert (rc == 0);
+ rc = zmq_recv (client, buffer, 32, 0);
+ assert (rc == -1);
+ assert (zmq_errno () == EAGAIN);
+}
+
+// Receive 0MQ string from socket and convert into C string
+// Caller must free returned string. Returns NULL if the context
+// is being terminated.
+char *
+s_recv (void *socket) {
+ char buffer [256];
+ int size = zmq_recv (socket, buffer, 255, 0);
+ if (size == -1)
+ return NULL;
+ if (size > 255)
+ size = 255;
+ buffer [size] = 0;
+ return strdup (buffer);
+}
+
+// Convert C string to 0MQ string and send to socket
+int
+s_send (void *socket, const char *string) {
+ int size = zmq_send (socket, string, strlen (string), 0);
+ return size;
+}
+
+// Sends string as 0MQ string, as multipart non-terminal
+int
+s_sendmore (void *socket, const char *string) {
+ int size = zmq_send (socket, string, strlen (string), ZMQ_SNDMORE);
+ return size;
+}
+
+#define streq(s1,s2) (!strcmp ((s1), (s2)))
+#define strneq(s1,s2) (strcmp ((s1), (s2)))
- // Check whether the message is still the same.
- assert (memcmp (buf2, content, 32) == 0);
+const char *SEQ_END = (const char *) 1;
+
+// Sends a message composed of frames that are C strings or null frames.
+// The list must be terminated by SEQ_END.
+// Example: s_send_seq (req, "ABC", 0, "DEF", SEQ_END);
+void s_send_seq (void *socket, ...)
+{
+ va_list ap;
+ va_start (ap, socket);
+ const char * data = va_arg (ap, const char *);
+ while (true)
+ {
+ const char * prev = data;
+ data = va_arg (ap, const char *);
+ bool end = data == SEQ_END;
+
+ if (!prev) {
+ int rc = zmq_send (socket, 0, 0, end ? 0 : ZMQ_SNDMORE);
+ assert (rc != -1);
+ }
+ else {
+ int rc = zmq_send (socket, prev, strlen (prev)+1, end ? 0 : ZMQ_SNDMORE);
+ assert (rc != -1);
+ }
+ if (end)
+ break;
+ }
+ va_end (ap);
+}
+
+// Receives message a number of frames long and checks that the frames have
+// the given data which can be either C strings or 0 for a null frame.
+// The list must be terminated by SEQ_END.
+// Example: s_recv_seq (rep, "ABC", 0, "DEF", SEQ_END);
+void s_recv_seq (void *socket, ...)
+{
+ zmq_msg_t msg;
+ zmq_msg_init (&msg);
+
+ int more;
+ size_t more_size = sizeof(more);
+
+ va_list ap;
+ va_start (ap, socket);
+ const char * data = va_arg (ap, const char *);
+
+ while (true) {
+ int rc = zmq_msg_recv (&msg, socket, 0);
+ assert (rc != -1);
+
+ if (!data)
+ assert (zmq_msg_size (&msg) == 0);
+ else
+ assert (strcmp (data, (const char *)zmq_msg_data (&msg)) == 0);
+
+ data = va_arg (ap, const char *);
+ bool end = data == SEQ_END;
+
+ rc = zmq_getsockopt (socket, ZMQ_RCVMORE, &more, &more_size);
+ assert (rc == 0);
+
+ assert (!more == end);
+ if (end)
+ break;
+ }
+ va_end (ap);
+
+ zmq_msg_close (&msg);
}
+
+// Sets a zero linger period on a socket and closes it.
+void close_zero_linger (void *socket)
+{
+ int linger = 0;
+ int rc = zmq_setsockopt (socket, ZMQ_LINGER, &linger, sizeof(linger));
+ assert (rc == 0 || errno == ETERM);
+ rc = zmq_close (socket);
+ assert (rc == 0);
+}
+
+void setup_test_environment()
+{
+#if defined _WIN32
+# if defined _MSC_VER
+ _set_abort_behavior( 0, _WRITE_ABORT_MSG);
+ _CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_FILE );
+ _CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDERR );
+# endif
+#endif
+}
+
+// Provide portable millisecond sleep
+// http://www.cplusplus.com/forum/unices/60161/ http://en.cppreference.com/w/cpp/thread/sleep_for
+void msleep (int milliseconds)
+{
+#ifdef ZMQ_HAVE_WINDOWS
+ Sleep (milliseconds);
+#else
+ usleep (static_cast <useconds_t> (milliseconds) * 1000);
+#endif
+}
+
+
#endif
--- /dev/null
+EXTRA_DIST = curve_keygen.c
+
+INCLUDES = -I$(top_srcdir)/include
+
+bin_PROGRAMS = curve_keygen
+
+curve_keygen_LDADD = $(top_builddir)/src/libzmq.la
+curve_keygen_SOURCES = curve_keygen.c
+
--- /dev/null
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+bin_PROGRAMS = curve_keygen$(EXEEXT)
+subdir = tools
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+ $(top_srcdir)/config/ltoptions.m4 \
+ $(top_srcdir)/config/ltsugar.m4 \
+ $(top_srcdir)/config/ltversion.m4 \
+ $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/src/platform.hpp
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+PROGRAMS = $(bin_PROGRAMS)
+am_curve_keygen_OBJECTS = curve_keygen.$(OBJEXT)
+curve_keygen_OBJECTS = $(am_curve_keygen_OBJECTS)
+curve_keygen_DEPENDENCIES = $(top_builddir)/src/libzmq.la
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+SOURCES = $(curve_keygen_SOURCES)
+DIST_SOURCES = $(curve_keygen_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AS = @AS@
+ASCIIDOC = @ASCIIDOC@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBZMQ_EXTRA_CFLAGS = @LIBZMQ_EXTRA_CFLAGS@
+LIBZMQ_EXTRA_CXXFLAGS = @LIBZMQ_EXTRA_CXXFLAGS@
+LIBZMQ_EXTRA_LDFLAGS = @LIBZMQ_EXTRA_LDFLAGS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LTVER = @LTVER@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+OpenPGM_CFLAGS = @OpenPGM_CFLAGS@
+OpenPGM_LIBS = @OpenPGM_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+XMLTO = @XMLTO@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+libzmq_have_asciidoc = @libzmq_have_asciidoc@
+libzmq_have_xmlto = @libzmq_have_xmlto@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pgm_basename = @pgm_basename@
+pgm_srcdir = @pgm_srcdir@
+pgm_subdir = @pgm_subdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+subdirs = @subdirs@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+EXTRA_DIST = curve_keygen.c
+INCLUDES = -I$(top_srcdir)/include
+curve_keygen_LDADD = $(top_builddir)/src/libzmq.la
+curve_keygen_SOURCES = curve_keygen.c
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign tools/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p || test -f $$p1; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+curve_keygen$(EXEEXT): $(curve_keygen_OBJECTS) $(curve_keygen_DEPENDENCIES) $(EXTRA_curve_keygen_DEPENDENCIES)
+ @rm -f curve_keygen$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(curve_keygen_OBJECTS) $(curve_keygen_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/curve_keygen.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+ clean-generic clean-libtool ctags distclean distclean-compile \
+ distclean-generic distclean-libtool distclean-tags distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-binPROGRAMS install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am tags uninstall uninstall-am \
+ uninstall-binPROGRAMS
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
--- /dev/null
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ This tool generates a CurveZMQ keypair, as two printable strings you can
+ use in configuration files or source code. The encoding uses Z85, which
+ is a base-85 format that is described in 0MQ RFC 32, and which has an
+ implementation in the z85_codec.h source used by this tool. The keypair
+ always works with the secret key held by one party and the public key
+ distributed (securely!) to peers wishing to connect to it.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <assert.h>
+#include <platform.hpp>
+#include <zmq.h>
+#include <zmq_utils.h>
+
+int main (void)
+{
+ puts ("This tool generates a CurveZMQ keypair, as two printable strings you can");
+ puts ("use in configuration files or source code. The encoding uses Z85, which");
+ puts ("is a base-85 format that is described in 0MQ RFC 32, and which has an");
+ puts ("implementation in the z85_codec.h source used by this tool. The keypair");
+ puts ("always works with the secret key held by one party and the public key");
+ puts ("distributed (securely!) to peers wishing to connect to it.");
+
+ char public_key [41];
+ char secret_key [41];
+ int rc = zmq_curve_keypair (public_key, secret_key);
+ if (rc != 0) {
+ if (zmq_errno () == ENOTSUP) {
+ puts ("To use curve_keygen, please install libsodium and then rebuild libzmq.");
+ }
+ exit (1);
+ }
+
+ puts ("\n== CURVE PUBLIC KEY ==");
+ puts (public_key);
+
+ puts ("\n== CURVE SECRET KEY ==");
+ puts (secret_key);
+
+ exit (0);
+}
Name: zeromq
-Version: 3.2.2
+Version: 4.0.4
Release: 1%{?dist}
Summary: The ZeroMQ messaging library
Group: Applications/Internet
BuildRequires: gcc, make, gcc-c++, libstdc++-devel
Requires: libstdc++
-%if %{?rhel}%{!?rhel:0} >= 6
+%if 0%{?rhel}
+%if 0%{?rhel} == 6
BuildRequires: libuuid-devel
Requires: libuuid
-%elseif %{?rhel}%{!?rhel:0} >= 5
+%endif
+%if 0%{?rhel} == 5
BuildRequires: e2fsprogs-devel
Requires: e2fsprogs
+%endif
%else
BuildRequires: uuid-devel
Requires: uuid
%build
%ifarch pentium3 pentium4 athlon i386 i486 i586 i686 x86_64
- %configure --with-pgm
+ %configure --with-pgm --with-pic --with-gnu-ld
%else
%configure
%endif
%doc AUTHORS ChangeLog COPYING COPYING.LESSER NEWS README
# libraries
-%{_libdir}/libzmq.so.1
-%{_libdir}/libzmq.so.1.0.0
-
-%attr(0755,root,root) %{_bindir}/zmq_forwarder
-%attr(0755,root,root) %{_bindir}/zmq_queue
-%attr(0755,root,root) %{_bindir}/zmq_streamer
+%{_libdir}/libzmq.so.3
+%{_libdir}/libzmq.so.3.0.0
%{_mandir}/man7/zmq.7.gz
-%{_mandir}/man1/zmq_forwarder.1.gz
-%{_mandir}/man1/zmq_queue.1.gz
-%{_mandir}/man1/zmq_streamer.1.gz
%files devel
%defattr(-,root,root,-)
%{_mandir}/man3/zmq_bind.3.gz
%{_mandir}/man3/zmq_close.3.gz
%{_mandir}/man3/zmq_connect.3.gz
+%{_mandir}/man3/zmq_disconnect.3.gz
+%{_mandir}/man3/zmq_ctx_destroy.3.gz
+%{_mandir}/man3/zmq_ctx_get.3.gz
+%{_mandir}/man3/zmq_ctx_new.3.gz
+%{_mandir}/man3/zmq_ctx_set.3.gz
+%{_mandir}/man3/zmq_ctx_term.3.gz
+%{_mandir}/man3/zmq_msg_recv.3.gz
%{_mandir}/man3/zmq_errno.3.gz
%{_mandir}/man3/zmq_getsockopt.3.gz
%{_mandir}/man3/zmq_init.3.gz
%{_mandir}/man3/zmq_msg_init_size.3.gz
%{_mandir}/man3/zmq_msg_move.3.gz
%{_mandir}/man3/zmq_msg_size.3.gz
+%{_mandir}/man3/zmq_msg_get.3.gz
+%{_mandir}/man3/zmq_msg_more.3.gz
+%{_mandir}/man3/zmq_msg_recv.3.gz
+%{_mandir}/man3/zmq_msg_send.3.gz
+%{_mandir}/man3/zmq_msg_set.3.gz
%{_mandir}/man3/zmq_poll.3.gz
+%{_mandir}/man3/zmq_proxy.3.gz
%{_mandir}/man3/zmq_recv.3.gz
%{_mandir}/man3/zmq_recvmsg.3.gz
%{_mandir}/man3/zmq_send.3.gz
%{_mandir}/man3/zmq_sendmsg.3.gz
%{_mandir}/man3/zmq_setsockopt.3.gz
%{_mandir}/man3/zmq_socket.3.gz
+%{_mandir}/man3/zmq_socket_monitor.3.gz
%{_mandir}/man3/zmq_strerror.3.gz
%{_mandir}/man3/zmq_term.3.gz
%{_mandir}/man3/zmq_version.3.gz
+%{_mandir}/man3/zmq_unbind.3.gz
%{_mandir}/man7/zmq_epgm.7.gz
%{_mandir}/man7/zmq_inproc.7.gz
%{_mandir}/man7/zmq_ipc.7.gz
%{_mandir}/man7/zmq_tcp.7.gz
%changelog
+* Mon Nov 26 2012 Justin Cook <jhcook@gmail.com> 3.2.2
+- Update packaged files
+
* Fri Apr 8 2011 Mikko Koppanen <mikko@kuut.io> 3.0.0-1
- Update dependencies and packaged files