libzmq 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/LICENSE +703 -0
- data/README.md +31 -0
- data/lib/libzmq.rb +17 -0
- data/lib/libzmq/ffi-rzmq.rb +3 -0
- data/libzmq/Makefile +5 -0
- data/libzmq/extconf.rb +24 -0
- data/libzmq/zeromq-2.1.7/AUTHORS +92 -0
- data/libzmq/zeromq-2.1.7/COPYING +674 -0
- data/libzmq/zeromq-2.1.7/COPYING.LESSER +206 -0
- data/libzmq/zeromq-2.1.7/ChangeLog +15620 -0
- data/libzmq/zeromq-2.1.7/INSTALL +237 -0
- data/libzmq/zeromq-2.1.7/MAINTAINERS +56 -0
- data/libzmq/zeromq-2.1.7/Makefile.am +42 -0
- data/libzmq/zeromq-2.1.7/Makefile.in +779 -0
- data/libzmq/zeromq-2.1.7/NEWS +275 -0
- data/libzmq/zeromq-2.1.7/README +39 -0
- data/libzmq/zeromq-2.1.7/acinclude.m4 +582 -0
- data/libzmq/zeromq-2.1.7/aclocal.m4 +1206 -0
- data/libzmq/zeromq-2.1.7/autogen.sh +45 -0
- data/libzmq/zeromq-2.1.7/builds/msvc/Makefile.am +8 -0
- data/libzmq/zeromq-2.1.7/builds/msvc/Makefile.in +390 -0
- data/libzmq/zeromq-2.1.7/builds/msvc/c_local_lat/c_local_lat.vcproj +176 -0
- data/libzmq/zeromq-2.1.7/builds/msvc/c_local_thr/c_local_thr.vcproj +176 -0
- data/libzmq/zeromq-2.1.7/builds/msvc/c_remote_lat/c_remote_lat.vcproj +176 -0
- data/libzmq/zeromq-2.1.7/builds/msvc/c_remote_thr/c_remote_thr.vcproj +176 -0
- data/libzmq/zeromq-2.1.7/builds/msvc/libzmq/libzmq.vcproj +783 -0
- data/libzmq/zeromq-2.1.7/builds/msvc/msvc.sln +89 -0
- data/libzmq/zeromq-2.1.7/builds/msvc/platform.hpp +32 -0
- data/libzmq/zeromq-2.1.7/builds/redhat/zeromq.spec.in +139 -0
- data/libzmq/zeromq-2.1.7/config/compile +143 -0
- data/libzmq/zeromq-2.1.7/config/config.guess +1502 -0
- data/libzmq/zeromq-2.1.7/config/config.sub +1714 -0
- data/libzmq/zeromq-2.1.7/config/depcomp +630 -0
- data/libzmq/zeromq-2.1.7/config/install-sh +520 -0
- data/libzmq/zeromq-2.1.7/config/libtool.m4 +7377 -0
- data/libzmq/zeromq-2.1.7/config/ltmain.sh +8413 -0
- data/libzmq/zeromq-2.1.7/config/ltoptions.m4 +368 -0
- data/libzmq/zeromq-2.1.7/config/ltsugar.m4 +123 -0
- data/libzmq/zeromq-2.1.7/config/ltversion.m4 +23 -0
- data/libzmq/zeromq-2.1.7/config/lt~obsolete.m4 +92 -0
- data/libzmq/zeromq-2.1.7/config/missing +376 -0
- data/libzmq/zeromq-2.1.7/configure +21645 -0
- data/libzmq/zeromq-2.1.7/configure.in +380 -0
- data/libzmq/zeromq-2.1.7/doc/Makefile.am +46 -0
- data/libzmq/zeromq-2.1.7/doc/Makefile.in +546 -0
- data/libzmq/zeromq-2.1.7/doc/asciidoc.conf +56 -0
- data/libzmq/zeromq-2.1.7/doc/zmq.7 +242 -0
- data/libzmq/zeromq-2.1.7/doc/zmq.html +846 -0
- data/libzmq/zeromq-2.1.7/doc/zmq.txt +218 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_bind.3 +166 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_bind.html +746 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_bind.txt +91 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_close.3 +81 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_close.html +645 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_close.txt +52 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_connect.3 +161 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_connect.html +732 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_connect.txt +89 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_cpp.7 +410 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_cpp.html +765 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_cpp.txt +212 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_device.3 +140 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_device.html +736 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_device.txt +138 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_epgm.7 +209 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_epgm.html +749 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_epgm.txt +162 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_errno.3 +78 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_errno.html +634 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_errno.txt +50 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_getsockopt.3 +944 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_getsockopt.html +1713 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_getsockopt.txt +407 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_init.3 +71 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_init.html +635 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_init.txt +51 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_inproc.7 +115 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_inproc.html +669 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_inproc.txt +89 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_ipc.7 +109 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_ipc.html +662 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_ipc.txt +80 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_msg_close.3 +81 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_msg_close.html +647 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_msg_close.txt +55 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_msg_copy.3 +95 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_msg_copy.html +656 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_msg_copy.txt +57 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_msg_data.3 +76 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_msg_data.html +633 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_msg_data.txt +48 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_msg_init.3 +110 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_msg_init.html +656 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_msg_init.txt +65 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_msg_init_data.3 +138 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_msg_init_data.html +678 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_msg_init_data.txt +83 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_msg_init_size.3 +97 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_msg_init_size.html +656 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_msg_init_size.txt +58 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_msg_move.3 +79 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_msg_move.html +645 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_msg_move.txt +52 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_msg_size.3 +76 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_msg_size.html +633 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_msg_size.txt +48 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_pgm.7 +209 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_pgm.html +749 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_pgm.txt +162 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_poll.3 +204 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_poll.html +755 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_poll.txt +132 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_recv.3 +172 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_recv.html +746 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_recv.txt +121 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_send.3 +185 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_send.html +755 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_send.txt +120 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_setsockopt.3 +878 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_setsockopt.html +1603 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_setsockopt.txt +382 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_socket.3 +779 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_socket.html +1424 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_socket.txt +342 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_strerror.3 +78 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_strerror.html +634 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_strerror.txt +55 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_tcp.7 +244 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_tcp.html +755 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_tcp.txt +162 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_term.3 +135 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_term.html +672 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_term.txt +65 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_version.3 +78 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_version.html +632 -0
- data/libzmq/zeromq-2.1.7/doc/zmq_version.txt +53 -0
- data/libzmq/zeromq-2.1.7/foreign/openpgm/Makefile.am +8 -0
- data/libzmq/zeromq-2.1.7/foreign/openpgm/Makefile.in +588 -0
- data/libzmq/zeromq-2.1.7/foreign/openpgm/libpgm-5.1.115~dfsg.tar.gz +0 -0
- data/libzmq/zeromq-2.1.7/foreign/xmlParser/xmlParser.cpp +2923 -0
- data/libzmq/zeromq-2.1.7/foreign/xmlParser/xmlParser.hpp +762 -0
- data/libzmq/zeromq-2.1.7/include/zmq.h +269 -0
- data/libzmq/zeromq-2.1.7/include/zmq.hpp +301 -0
- data/libzmq/zeromq-2.1.7/include/zmq_utils.h +64 -0
- data/libzmq/zeromq-2.1.7/perf/Makefile.am +21 -0
- data/libzmq/zeromq-2.1.7/perf/Makefile.in +566 -0
- data/libzmq/zeromq-2.1.7/perf/inproc_lat.cpp +232 -0
- data/libzmq/zeromq-2.1.7/perf/inproc_thr.cpp +246 -0
- data/libzmq/zeromq-2.1.7/perf/local_lat.cpp +108 -0
- data/libzmq/zeromq-2.1.7/perf/local_thr.cpp +138 -0
- data/libzmq/zeromq-2.1.7/perf/remote_lat.cpp +121 -0
- data/libzmq/zeromq-2.1.7/perf/remote_thr.cpp +104 -0
- data/libzmq/zeromq-2.1.7/src/Makefile.am +155 -0
- data/libzmq/zeromq-2.1.7/src/Makefile.in +1320 -0
- data/libzmq/zeromq-2.1.7/src/array.hpp +147 -0
- data/libzmq/zeromq-2.1.7/src/atomic_counter.hpp +164 -0
- data/libzmq/zeromq-2.1.7/src/atomic_ptr.hpp +159 -0
- data/libzmq/zeromq-2.1.7/src/blob.hpp +34 -0
- data/libzmq/zeromq-2.1.7/src/clock.cpp +118 -0
- data/libzmq/zeromq-2.1.7/src/clock.hpp +60 -0
- data/libzmq/zeromq-2.1.7/src/command.cpp +39 -0
- data/libzmq/zeromq-2.1.7/src/command.hpp +147 -0
- data/libzmq/zeromq-2.1.7/src/config.hpp +88 -0
- data/libzmq/zeromq-2.1.7/src/connect_session.cpp +119 -0
- data/libzmq/zeromq-2.1.7/src/connect_session.hpp +65 -0
- data/libzmq/zeromq-2.1.7/src/ctx.cpp +322 -0
- data/libzmq/zeromq-2.1.7/src/ctx.hpp +159 -0
- data/libzmq/zeromq-2.1.7/src/decoder.cpp +129 -0
- data/libzmq/zeromq-2.1.7/src/decoder.hpp +207 -0
- data/libzmq/zeromq-2.1.7/src/device.cpp +120 -0
- data/libzmq/zeromq-2.1.7/src/device.hpp +32 -0
- data/libzmq/zeromq-2.1.7/src/devpoll.cpp +190 -0
- data/libzmq/zeromq-2.1.7/src/devpoll.hpp +100 -0
- data/libzmq/zeromq-2.1.7/src/dist.cpp +200 -0
- data/libzmq/zeromq-2.1.7/src/dist.hpp +90 -0
- data/libzmq/zeromq-2.1.7/src/encoder.cpp +90 -0
- data/libzmq/zeromq-2.1.7/src/encoder.hpp +184 -0
- data/libzmq/zeromq-2.1.7/src/epoll.cpp +177 -0
- data/libzmq/zeromq-2.1.7/src/epoll.hpp +96 -0
- data/libzmq/zeromq-2.1.7/src/err.cpp +238 -0
- data/libzmq/zeromq-2.1.7/src/err.hpp +145 -0
- data/libzmq/zeromq-2.1.7/src/fd.hpp +45 -0
- data/libzmq/zeromq-2.1.7/src/fq.cpp +164 -0
- data/libzmq/zeromq-2.1.7/src/fq.hpp +80 -0
- data/libzmq/zeromq-2.1.7/src/i_engine.hpp +53 -0
- data/libzmq/zeromq-2.1.7/src/i_inout.hpp +50 -0
- data/libzmq/zeromq-2.1.7/src/i_poll_events.hpp +46 -0
- data/libzmq/zeromq-2.1.7/src/io_object.cpp +107 -0
- data/libzmq/zeromq-2.1.7/src/io_object.hpp +78 -0
- data/libzmq/zeromq-2.1.7/src/io_thread.cpp +109 -0
- data/libzmq/zeromq-2.1.7/src/io_thread.hpp +88 -0
- data/libzmq/zeromq-2.1.7/src/ip.cpp +339 -0
- data/libzmq/zeromq-2.1.7/src/ip.hpp +68 -0
- data/libzmq/zeromq-2.1.7/src/kqueue.cpp +194 -0
- data/libzmq/zeromq-2.1.7/src/kqueue.hpp +103 -0
- data/libzmq/zeromq-2.1.7/src/lb.cpp +174 -0
- data/libzmq/zeromq-2.1.7/src/lb.hpp +79 -0
- data/libzmq/zeromq-2.1.7/src/libzmq.pc.in +10 -0
- data/libzmq/zeromq-2.1.7/src/likely.hpp +33 -0
- data/libzmq/zeromq-2.1.7/src/mailbox.cpp +382 -0
- data/libzmq/zeromq-2.1.7/src/mailbox.hpp +62 -0
- data/libzmq/zeromq-2.1.7/src/msg_content.hpp +52 -0
- data/libzmq/zeromq-2.1.7/src/mutex.hpp +121 -0
- data/libzmq/zeromq-2.1.7/src/named_session.cpp +85 -0
- data/libzmq/zeromq-2.1.7/src/named_session.hpp +57 -0
- data/libzmq/zeromq-2.1.7/src/object.cpp +467 -0
- data/libzmq/zeromq-2.1.7/src/object.hpp +127 -0
- data/libzmq/zeromq-2.1.7/src/options.cpp +336 -0
- data/libzmq/zeromq-2.1.7/src/options.hpp +87 -0
- data/libzmq/zeromq-2.1.7/src/own.cpp +214 -0
- data/libzmq/zeromq-2.1.7/src/own.hpp +140 -0
- data/libzmq/zeromq-2.1.7/src/pair.cpp +180 -0
- data/libzmq/zeromq-2.1.7/src/pair.hpp +76 -0
- data/libzmq/zeromq-2.1.7/src/pgm_receiver.cpp +259 -0
- data/libzmq/zeromq-2.1.7/src/pgm_receiver.hpp +129 -0
- data/libzmq/zeromq-2.1.7/src/pgm_sender.cpp +215 -0
- data/libzmq/zeromq-2.1.7/src/pgm_sender.hpp +105 -0
- data/libzmq/zeromq-2.1.7/src/pgm_socket.cpp +705 -0
- data/libzmq/zeromq-2.1.7/src/pgm_socket.hpp +118 -0
- data/libzmq/zeromq-2.1.7/src/pipe.cpp +409 -0
- data/libzmq/zeromq-2.1.7/src/pipe.hpp +214 -0
- data/libzmq/zeromq-2.1.7/src/platform.hpp.in +228 -0
- data/libzmq/zeromq-2.1.7/src/poll.cpp +180 -0
- data/libzmq/zeromq-2.1.7/src/poll.hpp +104 -0
- data/libzmq/zeromq-2.1.7/src/poller.hpp +73 -0
- data/libzmq/zeromq-2.1.7/src/poller_base.cpp +99 -0
- data/libzmq/zeromq-2.1.7/src/poller_base.hpp +84 -0
- data/libzmq/zeromq-2.1.7/src/pub.cpp +31 -0
- data/libzmq/zeromq-2.1.7/src/pub.hpp +44 -0
- data/libzmq/zeromq-2.1.7/src/pull.cpp +61 -0
- data/libzmq/zeromq-2.1.7/src/pull.hpp +60 -0
- data/libzmq/zeromq-2.1.7/src/push.cpp +62 -0
- data/libzmq/zeromq-2.1.7/src/push.hpp +59 -0
- data/libzmq/zeromq-2.1.7/src/reaper.cpp +121 -0
- data/libzmq/zeromq-2.1.7/src/reaper.hpp +77 -0
- data/libzmq/zeromq-2.1.7/src/rep.cpp +131 -0
- data/libzmq/zeromq-2.1.7/src/rep.hpp +59 -0
- data/libzmq/zeromq-2.1.7/src/req.cpp +121 -0
- data/libzmq/zeromq-2.1.7/src/req.hpp +58 -0
- data/libzmq/zeromq-2.1.7/src/select.cpp +211 -0
- data/libzmq/zeromq-2.1.7/src/select.hpp +116 -0
- data/libzmq/zeromq-2.1.7/src/semaphore.hpp +189 -0
- data/libzmq/zeromq-2.1.7/src/session.cpp +347 -0
- data/libzmq/zeromq-2.1.7/src/session.hpp +150 -0
- data/libzmq/zeromq-2.1.7/src/socket_base.cpp +811 -0
- data/libzmq/zeromq-2.1.7/src/socket_base.hpp +207 -0
- data/libzmq/zeromq-2.1.7/src/stdint.hpp +63 -0
- data/libzmq/zeromq-2.1.7/src/sub.cpp +75 -0
- data/libzmq/zeromq-2.1.7/src/sub.hpp +50 -0
- data/libzmq/zeromq-2.1.7/src/swap.cpp +325 -0
- data/libzmq/zeromq-2.1.7/src/swap.hpp +123 -0
- data/libzmq/zeromq-2.1.7/src/tcp_connecter.cpp +310 -0
- data/libzmq/zeromq-2.1.7/src/tcp_connecter.hpp +81 -0
- data/libzmq/zeromq-2.1.7/src/tcp_listener.cpp +371 -0
- data/libzmq/zeromq-2.1.7/src/tcp_listener.hpp +73 -0
- data/libzmq/zeromq-2.1.7/src/tcp_socket.cpp +228 -0
- data/libzmq/zeromq-2.1.7/src/tcp_socket.hpp +72 -0
- data/libzmq/zeromq-2.1.7/src/thread.cpp +97 -0
- data/libzmq/zeromq-2.1.7/src/thread.hpp +78 -0
- data/libzmq/zeromq-2.1.7/src/transient_session.cpp +41 -0
- data/libzmq/zeromq-2.1.7/src/transient_session.hpp +52 -0
- data/libzmq/zeromq-2.1.7/src/trie.cpp +181 -0
- data/libzmq/zeromq-2.1.7/src/trie.hpp +59 -0
- data/libzmq/zeromq-2.1.7/src/uuid.cpp +233 -0
- data/libzmq/zeromq-2.1.7/src/uuid.hpp +111 -0
- data/libzmq/zeromq-2.1.7/src/windows.hpp +79 -0
- data/libzmq/zeromq-2.1.7/src/wire.hpp +99 -0
- data/libzmq/zeromq-2.1.7/src/xpub.cpp +76 -0
- data/libzmq/zeromq-2.1.7/src/xpub.hpp +61 -0
- data/libzmq/zeromq-2.1.7/src/xrep.cpp +337 -0
- data/libzmq/zeromq-2.1.7/src/xrep.hpp +116 -0
- data/libzmq/zeromq-2.1.7/src/xreq.cpp +74 -0
- data/libzmq/zeromq-2.1.7/src/xreq.hpp +65 -0
- data/libzmq/zeromq-2.1.7/src/xsub.cpp +172 -0
- data/libzmq/zeromq-2.1.7/src/xsub.hpp +80 -0
- data/libzmq/zeromq-2.1.7/src/ypipe.hpp +209 -0
- data/libzmq/zeromq-2.1.7/src/yqueue.hpp +198 -0
- data/libzmq/zeromq-2.1.7/src/zmq.cpp +798 -0
- data/libzmq/zeromq-2.1.7/src/zmq_connecter.cpp +166 -0
- data/libzmq/zeromq-2.1.7/src/zmq_connecter.hpp +92 -0
- data/libzmq/zeromq-2.1.7/src/zmq_engine.cpp +220 -0
- data/libzmq/zeromq-2.1.7/src/zmq_engine.hpp +87 -0
- data/libzmq/zeromq-2.1.7/src/zmq_init.cpp +216 -0
- data/libzmq/zeromq-2.1.7/src/zmq_init.hpp +93 -0
- data/libzmq/zeromq-2.1.7/src/zmq_listener.cpp +78 -0
- data/libzmq/zeromq-2.1.7/src/zmq_listener.hpp +67 -0
- data/libzmq/zeromq-2.1.7/tests/Makefile.am +30 -0
- data/libzmq/zeromq-2.1.7/tests/Makefile.in +713 -0
- data/libzmq/zeromq-2.1.7/tests/test_hwm.cpp +68 -0
- data/libzmq/zeromq-2.1.7/tests/test_pair_inproc.cpp +31 -0
- data/libzmq/zeromq-2.1.7/tests/test_pair_ipc.cpp +31 -0
- data/libzmq/zeromq-2.1.7/tests/test_pair_tcp.cpp +31 -0
- data/libzmq/zeromq-2.1.7/tests/test_reqrep_inproc.cpp +31 -0
- data/libzmq/zeromq-2.1.7/tests/test_reqrep_ipc.cpp +31 -0
- data/libzmq/zeromq-2.1.7/tests/test_reqrep_tcp.cpp +31 -0
- data/libzmq/zeromq-2.1.7/tests/test_shutdown_stress.cpp +87 -0
- data/libzmq/zeromq-2.1.7/tests/testutil.hpp +130 -0
- data/libzmq/zeromq-2.1.7/version.sh +21 -0
- data/libzmq/zeromq-2.1.7/zeromq.spec +139 -0
- metadata +348 -0
@@ -0,0 +1,87 @@
|
|
1
|
+
/*
|
2
|
+
Copyright (c) 2007-2011 iMatix Corporation
|
3
|
+
Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
|
4
|
+
|
5
|
+
This file is part of 0MQ.
|
6
|
+
|
7
|
+
0MQ is free software; you can redistribute it and/or modify it under
|
8
|
+
the terms of the GNU Lesser General Public License as published by
|
9
|
+
the Free Software Foundation; either version 3 of the License, or
|
10
|
+
(at your option) any later version.
|
11
|
+
|
12
|
+
0MQ is distributed in the hope that it will be useful,
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
GNU Lesser General Public License for more details.
|
16
|
+
|
17
|
+
You should have received a copy of the GNU Lesser General Public License
|
18
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
19
|
+
*/
|
20
|
+
|
21
|
+
#ifndef __ZMQ_OPTIONS_HPP_INCLUDED__
|
22
|
+
#define __ZMQ_OPTIONS_HPP_INCLUDED__
|
23
|
+
|
24
|
+
#include "stddef.h"
|
25
|
+
#include "stdint.hpp"
|
26
|
+
#include "blob.hpp"
|
27
|
+
|
28
|
+
namespace zmq
|
29
|
+
{
|
30
|
+
|
31
|
+
struct options_t
|
32
|
+
{
|
33
|
+
options_t ();
|
34
|
+
|
35
|
+
int setsockopt (int option_, const void *optval_, size_t optvallen_);
|
36
|
+
int getsockopt (int option_, void *optval_, size_t *optvallen_);
|
37
|
+
|
38
|
+
uint64_t hwm;
|
39
|
+
int64_t swap;
|
40
|
+
uint64_t affinity;
|
41
|
+
blob_t identity;
|
42
|
+
|
43
|
+
// Maximum tranfer rate [kb/s]. Default 100kb/s.
|
44
|
+
uint32_t rate;
|
45
|
+
|
46
|
+
// Reliability time interval [s]. Default 10s.
|
47
|
+
uint32_t recovery_ivl;
|
48
|
+
// Reliability time interval [ms]. Default -1 = not used.
|
49
|
+
int32_t recovery_ivl_msec;
|
50
|
+
|
51
|
+
// Enable multicast loopback. Default disabled (false).
|
52
|
+
bool use_multicast_loop;
|
53
|
+
|
54
|
+
uint64_t sndbuf;
|
55
|
+
uint64_t rcvbuf;
|
56
|
+
|
57
|
+
// Socket type.
|
58
|
+
int type;
|
59
|
+
|
60
|
+
// Linger time, in milliseconds.
|
61
|
+
int linger;
|
62
|
+
|
63
|
+
// Minimum interval between attempts to reconnect, in milliseconds.
|
64
|
+
// Default 100ms
|
65
|
+
int reconnect_ivl;
|
66
|
+
// Maximum interval between attempts to reconnect, in milliseconds.
|
67
|
+
// Default 0 (unused)
|
68
|
+
int reconnect_ivl_max;
|
69
|
+
|
70
|
+
// Maximum backlog for pending connections.
|
71
|
+
int backlog;
|
72
|
+
|
73
|
+
// These options are never set by the user directly. Instead they are
|
74
|
+
// provided by the specific socket type.
|
75
|
+
bool requires_in;
|
76
|
+
bool requires_out;
|
77
|
+
|
78
|
+
// If true, when connecting, pipes are created immediately without
|
79
|
+
// waiting for the connection to be established. That way the socket
|
80
|
+
// is not aware of the peer's identity, however, it is able to send
|
81
|
+
// messages straight away.
|
82
|
+
bool immediate_connect;
|
83
|
+
};
|
84
|
+
|
85
|
+
}
|
86
|
+
|
87
|
+
#endif
|
@@ -0,0 +1,214 @@
|
|
1
|
+
/*
|
2
|
+
Copyright (c) 2007-2011 iMatix Corporation
|
3
|
+
Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
|
4
|
+
|
5
|
+
This file is part of 0MQ.
|
6
|
+
|
7
|
+
0MQ is free software; you can redistribute it and/or modify it under
|
8
|
+
the terms of the GNU Lesser General Public License as published by
|
9
|
+
the Free Software Foundation; either version 3 of the License, or
|
10
|
+
(at your option) any later version.
|
11
|
+
|
12
|
+
0MQ is distributed in the hope that it will be useful,
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
GNU Lesser General Public License for more details.
|
16
|
+
|
17
|
+
You should have received a copy of the GNU Lesser General Public License
|
18
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
19
|
+
*/
|
20
|
+
|
21
|
+
#include "own.hpp"
|
22
|
+
#include "err.hpp"
|
23
|
+
#include "io_thread.hpp"
|
24
|
+
|
25
|
+
zmq::own_t::own_t (class ctx_t *parent_, uint32_t tid_) :
|
26
|
+
object_t (parent_, tid_),
|
27
|
+
terminating (false),
|
28
|
+
sent_seqnum (0),
|
29
|
+
processed_seqnum (0),
|
30
|
+
owner (NULL),
|
31
|
+
term_acks (0)
|
32
|
+
{
|
33
|
+
}
|
34
|
+
|
35
|
+
zmq::own_t::own_t (io_thread_t *io_thread_, const options_t &options_) :
|
36
|
+
object_t (io_thread_),
|
37
|
+
options (options_),
|
38
|
+
terminating (false),
|
39
|
+
sent_seqnum (0),
|
40
|
+
processed_seqnum (0),
|
41
|
+
owner (NULL),
|
42
|
+
term_acks (0)
|
43
|
+
{
|
44
|
+
}
|
45
|
+
|
46
|
+
zmq::own_t::~own_t ()
|
47
|
+
{
|
48
|
+
}
|
49
|
+
|
50
|
+
void zmq::own_t::set_owner (own_t *owner_)
|
51
|
+
{
|
52
|
+
zmq_assert (!owner);
|
53
|
+
owner = owner_;
|
54
|
+
}
|
55
|
+
|
56
|
+
void zmq::own_t::inc_seqnum ()
|
57
|
+
{
|
58
|
+
// This function may be called from a different thread!
|
59
|
+
sent_seqnum.add (1);
|
60
|
+
}
|
61
|
+
|
62
|
+
void zmq::own_t::process_seqnum ()
|
63
|
+
{
|
64
|
+
// Catch up with counter of processed commands.
|
65
|
+
processed_seqnum++;
|
66
|
+
|
67
|
+
// We may have catched up and still have pending terms acks.
|
68
|
+
check_term_acks ();
|
69
|
+
}
|
70
|
+
|
71
|
+
void zmq::own_t::launch_child (own_t *object_)
|
72
|
+
{
|
73
|
+
// Specify the owner of the object.
|
74
|
+
object_->set_owner (this);
|
75
|
+
|
76
|
+
// Plug the object into the I/O thread.
|
77
|
+
send_plug (object_);
|
78
|
+
|
79
|
+
// Take ownership of the object.
|
80
|
+
send_own (this, object_);
|
81
|
+
}
|
82
|
+
|
83
|
+
void zmq::own_t::launch_sibling (own_t *object_)
|
84
|
+
{
|
85
|
+
// At this point it is important that object is plugged in before its
|
86
|
+
// owner has a chance to terminate it. Thus, 'plug' command is sent before
|
87
|
+
// the 'own' command. Given that the mailbox preserves ordering of
|
88
|
+
// commands, 'term' command from the owner cannot make it to the object
|
89
|
+
// before the already written 'plug' command.
|
90
|
+
|
91
|
+
// Specify the owner of the object.
|
92
|
+
object_->set_owner (owner);
|
93
|
+
|
94
|
+
// Plug the object into its I/O thread.
|
95
|
+
send_plug (object_);
|
96
|
+
|
97
|
+
// Make parent own the object.
|
98
|
+
send_own (owner, object_);
|
99
|
+
}
|
100
|
+
|
101
|
+
void zmq::own_t::process_term_req (own_t *object_)
|
102
|
+
{
|
103
|
+
// When shutting down we can ignore termination requests from owned
|
104
|
+
// objects. The termination request was already sent to the object.
|
105
|
+
if (terminating)
|
106
|
+
return;
|
107
|
+
|
108
|
+
// If I/O object is well and alive let's ask it to terminate.
|
109
|
+
owned_t::iterator it = std::find (owned.begin (), owned.end (), object_);
|
110
|
+
|
111
|
+
// If not found, we assume that termination request was already sent to
|
112
|
+
// the object so we can safely ignore the request.
|
113
|
+
if (it == owned.end ())
|
114
|
+
return;
|
115
|
+
|
116
|
+
owned.erase (it);
|
117
|
+
register_term_acks (1);
|
118
|
+
|
119
|
+
// Note that this object is the root of the (partial shutdown) thus, its
|
120
|
+
// value of linger is used, rather than the value stored by the children.
|
121
|
+
send_term (object_, options.linger);
|
122
|
+
}
|
123
|
+
|
124
|
+
void zmq::own_t::process_own (own_t *object_)
|
125
|
+
{
|
126
|
+
// If the object is already being shut down, new owned objects are
|
127
|
+
// immediately asked to terminate. Note that linger is set to zero.
|
128
|
+
if (terminating) {
|
129
|
+
register_term_acks (1);
|
130
|
+
send_term (object_, 0);
|
131
|
+
return;
|
132
|
+
}
|
133
|
+
|
134
|
+
// Store the reference to the owned object.
|
135
|
+
owned.insert (object_);
|
136
|
+
}
|
137
|
+
|
138
|
+
void zmq::own_t::terminate ()
|
139
|
+
{
|
140
|
+
// If termination is already underway, there's no point
|
141
|
+
// in starting it anew.
|
142
|
+
if (terminating)
|
143
|
+
return;
|
144
|
+
|
145
|
+
// As for the root of the ownership tree, there's noone to terminate it,
|
146
|
+
// so it has to terminate itself.
|
147
|
+
if (!owner) {
|
148
|
+
process_term (options.linger);
|
149
|
+
return;
|
150
|
+
}
|
151
|
+
|
152
|
+
// If I am an owned object, I'll ask my owner to terminate me.
|
153
|
+
send_term_req (owner, this);
|
154
|
+
}
|
155
|
+
|
156
|
+
void zmq::own_t::process_term (int linger_)
|
157
|
+
{
|
158
|
+
// Double termination should never happen.
|
159
|
+
zmq_assert (!terminating);
|
160
|
+
|
161
|
+
// Send termination request to all owned objects.
|
162
|
+
for (owned_t::iterator it = owned.begin (); it != owned.end (); ++it)
|
163
|
+
send_term (*it, linger_);
|
164
|
+
register_term_acks (owned.size ());
|
165
|
+
owned.clear ();
|
166
|
+
|
167
|
+
// Start termination process and check whether by chance we cannot
|
168
|
+
// terminate immediately.
|
169
|
+
terminating = true;
|
170
|
+
check_term_acks ();
|
171
|
+
}
|
172
|
+
|
173
|
+
void zmq::own_t::register_term_acks (int count_)
|
174
|
+
{
|
175
|
+
term_acks += count_;
|
176
|
+
}
|
177
|
+
|
178
|
+
void zmq::own_t::unregister_term_ack ()
|
179
|
+
{
|
180
|
+
zmq_assert (term_acks > 0);
|
181
|
+
term_acks--;
|
182
|
+
|
183
|
+
// This may be a last ack we are waiting for before termination...
|
184
|
+
check_term_acks ();
|
185
|
+
}
|
186
|
+
|
187
|
+
void zmq::own_t::process_term_ack ()
|
188
|
+
{
|
189
|
+
unregister_term_ack ();
|
190
|
+
}
|
191
|
+
|
192
|
+
void zmq::own_t::check_term_acks ()
|
193
|
+
{
|
194
|
+
if (terminating && processed_seqnum == sent_seqnum.get () &&
|
195
|
+
term_acks == 0) {
|
196
|
+
|
197
|
+
// Sanity check. There should be no active children at this point.
|
198
|
+
zmq_assert (owned.empty ());
|
199
|
+
|
200
|
+
// The root object has nobody to confirm the termination to.
|
201
|
+
// Other nodes will confirm the termination to the owner.
|
202
|
+
if (owner)
|
203
|
+
send_term_ack (owner);
|
204
|
+
|
205
|
+
// Deallocate the resources.
|
206
|
+
process_destroy ();
|
207
|
+
}
|
208
|
+
}
|
209
|
+
|
210
|
+
void zmq::own_t::process_destroy ()
|
211
|
+
{
|
212
|
+
delete this;
|
213
|
+
}
|
214
|
+
|
@@ -0,0 +1,140 @@
|
|
1
|
+
/*
|
2
|
+
Copyright (c) 2007-2011 iMatix Corporation
|
3
|
+
Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
|
4
|
+
|
5
|
+
This file is part of 0MQ.
|
6
|
+
|
7
|
+
0MQ is free software; you can redistribute it and/or modify it under
|
8
|
+
the terms of the GNU Lesser General Public License as published by
|
9
|
+
the Free Software Foundation; either version 3 of the License, or
|
10
|
+
(at your option) any later version.
|
11
|
+
|
12
|
+
0MQ is distributed in the hope that it will be useful,
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
GNU Lesser General Public License for more details.
|
16
|
+
|
17
|
+
You should have received a copy of the GNU Lesser General Public License
|
18
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
19
|
+
*/
|
20
|
+
|
21
|
+
#ifndef __ZMQ_OWN_HPP_INCLUDED__
|
22
|
+
#define __ZMQ_OWN_HPP_INCLUDED__
|
23
|
+
|
24
|
+
#include <set>
|
25
|
+
#include <algorithm>
|
26
|
+
|
27
|
+
#include "object.hpp"
|
28
|
+
#include "options.hpp"
|
29
|
+
#include "atomic_counter.hpp"
|
30
|
+
#include "stdint.hpp"
|
31
|
+
|
32
|
+
namespace zmq
|
33
|
+
{
|
34
|
+
|
35
|
+
// Base class for objects forming a part of ownership hierarchy.
|
36
|
+
// It handles initialisation and destruction of such objects.
|
37
|
+
|
38
|
+
class own_t : public object_t
|
39
|
+
{
|
40
|
+
public:
|
41
|
+
|
42
|
+
// Note that the owner is unspecified in the constructor.
|
43
|
+
// It'll be supplied later on when the object is plugged in.
|
44
|
+
|
45
|
+
// The object is not living within an I/O thread. It has it's own
|
46
|
+
// thread outside of 0MQ infrastructure.
|
47
|
+
own_t (class ctx_t *parent_, uint32_t tid_);
|
48
|
+
|
49
|
+
// The object is living within I/O thread.
|
50
|
+
own_t (class io_thread_t *io_thread_, const options_t &options_);
|
51
|
+
|
52
|
+
// When another owned object wants to send command to this object
|
53
|
+
// it calls this function to let it know it should not shut down
|
54
|
+
// before the command is delivered.
|
55
|
+
void inc_seqnum ();
|
56
|
+
|
57
|
+
// Use following two functions to wait for arbitrary events before
|
58
|
+
// terminating. Just add number of events to wait for using
|
59
|
+
// register_tem_acks functions. When event occurs, call
|
60
|
+
// remove_term_ack. When number of pending acks reaches zero
|
61
|
+
// object will be deallocated.
|
62
|
+
void register_term_acks (int count_);
|
63
|
+
void unregister_term_ack ();
|
64
|
+
|
65
|
+
protected:
|
66
|
+
|
67
|
+
// Launch the supplied object and become its owner.
|
68
|
+
void launch_child (own_t *object_);
|
69
|
+
|
70
|
+
// Launch the supplied object and make it your sibling (make your
|
71
|
+
// owner become its owner as well).
|
72
|
+
void launch_sibling (own_t *object_);
|
73
|
+
|
74
|
+
// Ask owner object to terminate this object. It may take a while
|
75
|
+
// while actual termination is started. This function should not be
|
76
|
+
// called more than once.
|
77
|
+
void terminate ();
|
78
|
+
|
79
|
+
// Derived object destroys own_t. There's no point in allowing
|
80
|
+
// others to invoke the destructor. At the same time, it has to be
|
81
|
+
// virtual so that generic own_t deallocation mechanism destroys
|
82
|
+
// specific type of the owned object correctly.
|
83
|
+
virtual ~own_t ();
|
84
|
+
|
85
|
+
// Term handler is protocted rather than private so that it can
|
86
|
+
// be intercepted by the derived class. This is useful to add custom
|
87
|
+
// steps to the beginning of the termination process.
|
88
|
+
void process_term (int linger_);
|
89
|
+
|
90
|
+
// A place to hook in when phyicallal destruction of the object
|
91
|
+
// is to be delayed.
|
92
|
+
virtual void process_destroy ();
|
93
|
+
|
94
|
+
// Socket options associated with this object.
|
95
|
+
options_t options;
|
96
|
+
|
97
|
+
private:
|
98
|
+
|
99
|
+
// Set owner of the object
|
100
|
+
void set_owner (own_t *owner_);
|
101
|
+
|
102
|
+
// Handlers for incoming commands.
|
103
|
+
void process_own (own_t *object_);
|
104
|
+
void process_term_req (own_t *object_);
|
105
|
+
void process_term_ack ();
|
106
|
+
void process_seqnum ();
|
107
|
+
|
108
|
+
// Check whether all the peding term acks were delivered.
|
109
|
+
// If so, deallocate this object.
|
110
|
+
void check_term_acks ();
|
111
|
+
|
112
|
+
// True if termination was already initiated. If so, we can destroy
|
113
|
+
// the object if there are no more child objects or pending term acks.
|
114
|
+
bool terminating;
|
115
|
+
|
116
|
+
// Sequence number of the last command sent to this object.
|
117
|
+
atomic_counter_t sent_seqnum;
|
118
|
+
|
119
|
+
// Sequence number of the last command processed by this object.
|
120
|
+
uint64_t processed_seqnum;
|
121
|
+
|
122
|
+
// Socket owning this object. It's responsible for shutting down
|
123
|
+
// this object.
|
124
|
+
own_t *owner;
|
125
|
+
|
126
|
+
// List of all objects owned by this socket. We are responsible
|
127
|
+
// for deallocating them before we quit.
|
128
|
+
typedef std::set <own_t*> owned_t;
|
129
|
+
owned_t owned;
|
130
|
+
|
131
|
+
// Number of events we have to get before we can destroy the object.
|
132
|
+
int term_acks;
|
133
|
+
|
134
|
+
own_t (const own_t&);
|
135
|
+
const own_t &operator = (const own_t&);
|
136
|
+
};
|
137
|
+
|
138
|
+
}
|
139
|
+
|
140
|
+
#endif
|
@@ -0,0 +1,180 @@
|
|
1
|
+
/*
|
2
|
+
Copyright (c) 2007-2011 iMatix Corporation
|
3
|
+
Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
|
4
|
+
|
5
|
+
This file is part of 0MQ.
|
6
|
+
|
7
|
+
0MQ is free software; you can redistribute it and/or modify it under
|
8
|
+
the terms of the GNU Lesser General Public License as published by
|
9
|
+
the Free Software Foundation; either version 3 of the License, or
|
10
|
+
(at your option) any later version.
|
11
|
+
|
12
|
+
0MQ is distributed in the hope that it will be useful,
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
GNU Lesser General Public License for more details.
|
16
|
+
|
17
|
+
You should have received a copy of the GNU Lesser General Public License
|
18
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
19
|
+
*/
|
20
|
+
|
21
|
+
#include "../include/zmq.h"
|
22
|
+
|
23
|
+
#include "pair.hpp"
|
24
|
+
#include "err.hpp"
|
25
|
+
#include "pipe.hpp"
|
26
|
+
|
27
|
+
zmq::pair_t::pair_t (class ctx_t *parent_, uint32_t tid_) :
|
28
|
+
socket_base_t (parent_, tid_),
|
29
|
+
inpipe (NULL),
|
30
|
+
outpipe (NULL),
|
31
|
+
inpipe_alive (false),
|
32
|
+
outpipe_alive (false),
|
33
|
+
terminating (false)
|
34
|
+
{
|
35
|
+
options.type = ZMQ_PAIR;
|
36
|
+
options.requires_in = true;
|
37
|
+
options.requires_out = true;
|
38
|
+
}
|
39
|
+
|
40
|
+
zmq::pair_t::~pair_t ()
|
41
|
+
{
|
42
|
+
zmq_assert (!inpipe);
|
43
|
+
zmq_assert (!outpipe);
|
44
|
+
}
|
45
|
+
|
46
|
+
void zmq::pair_t::xattach_pipes (reader_t *inpipe_, writer_t *outpipe_,
|
47
|
+
const blob_t &peer_identity_)
|
48
|
+
{
|
49
|
+
zmq_assert (!inpipe && !outpipe);
|
50
|
+
|
51
|
+
inpipe = inpipe_;
|
52
|
+
inpipe_alive = true;
|
53
|
+
inpipe->set_event_sink (this);
|
54
|
+
|
55
|
+
outpipe = outpipe_;
|
56
|
+
outpipe_alive = true;
|
57
|
+
outpipe->set_event_sink (this);
|
58
|
+
|
59
|
+
if (terminating) {
|
60
|
+
register_term_acks (2);
|
61
|
+
inpipe_->terminate ();
|
62
|
+
outpipe_->terminate ();
|
63
|
+
}
|
64
|
+
}
|
65
|
+
|
66
|
+
void zmq::pair_t::terminated (reader_t *pipe_)
|
67
|
+
{
|
68
|
+
zmq_assert (pipe_ == inpipe);
|
69
|
+
inpipe = NULL;
|
70
|
+
inpipe_alive = false;
|
71
|
+
|
72
|
+
if (terminating)
|
73
|
+
unregister_term_ack ();
|
74
|
+
}
|
75
|
+
|
76
|
+
void zmq::pair_t::terminated (writer_t *pipe_)
|
77
|
+
{
|
78
|
+
zmq_assert (pipe_ == outpipe);
|
79
|
+
outpipe = NULL;
|
80
|
+
outpipe_alive = false;
|
81
|
+
|
82
|
+
if (terminating)
|
83
|
+
unregister_term_ack ();
|
84
|
+
}
|
85
|
+
|
86
|
+
void zmq::pair_t::delimited (reader_t *pipe_)
|
87
|
+
{
|
88
|
+
}
|
89
|
+
|
90
|
+
void zmq::pair_t::process_term (int linger_)
|
91
|
+
{
|
92
|
+
terminating = true;
|
93
|
+
|
94
|
+
if (inpipe) {
|
95
|
+
register_term_acks (1);
|
96
|
+
inpipe->terminate ();
|
97
|
+
}
|
98
|
+
|
99
|
+
if (outpipe) {
|
100
|
+
register_term_acks (1);
|
101
|
+
outpipe->terminate ();
|
102
|
+
}
|
103
|
+
|
104
|
+
socket_base_t::process_term (linger_);
|
105
|
+
}
|
106
|
+
|
107
|
+
void zmq::pair_t::activated (class reader_t *pipe_)
|
108
|
+
{
|
109
|
+
zmq_assert (!inpipe_alive);
|
110
|
+
inpipe_alive = true;
|
111
|
+
}
|
112
|
+
|
113
|
+
void zmq::pair_t::activated (class writer_t *pipe_)
|
114
|
+
{
|
115
|
+
zmq_assert (!outpipe_alive);
|
116
|
+
outpipe_alive = true;
|
117
|
+
}
|
118
|
+
|
119
|
+
int zmq::pair_t::xsend (zmq_msg_t *msg_, int flags_)
|
120
|
+
{
|
121
|
+
if (outpipe == NULL || !outpipe_alive) {
|
122
|
+
errno = EAGAIN;
|
123
|
+
return -1;
|
124
|
+
}
|
125
|
+
|
126
|
+
if (!outpipe->write (msg_)) {
|
127
|
+
outpipe_alive = false;
|
128
|
+
errno = EAGAIN;
|
129
|
+
return -1;
|
130
|
+
}
|
131
|
+
|
132
|
+
if (!(flags_ & ZMQ_SNDMORE))
|
133
|
+
outpipe->flush ();
|
134
|
+
|
135
|
+
// Detach the original message from the data buffer.
|
136
|
+
int rc = zmq_msg_init (msg_);
|
137
|
+
zmq_assert (rc == 0);
|
138
|
+
|
139
|
+
return 0;
|
140
|
+
}
|
141
|
+
|
142
|
+
int zmq::pair_t::xrecv (zmq_msg_t *msg_, int flags_)
|
143
|
+
{
|
144
|
+
// Deallocate old content of the message.
|
145
|
+
zmq_msg_close (msg_);
|
146
|
+
|
147
|
+
if (!inpipe_alive || !inpipe || !inpipe->read (msg_)) {
|
148
|
+
|
149
|
+
// No message is available.
|
150
|
+
inpipe_alive = false;
|
151
|
+
|
152
|
+
// Initialise the output parameter to be a 0-byte message.
|
153
|
+
zmq_msg_init (msg_);
|
154
|
+
errno = EAGAIN;
|
155
|
+
return -1;
|
156
|
+
}
|
157
|
+
return 0;
|
158
|
+
}
|
159
|
+
|
160
|
+
bool zmq::pair_t::xhas_in ()
|
161
|
+
{
|
162
|
+
if (!inpipe || !inpipe_alive)
|
163
|
+
return false;
|
164
|
+
|
165
|
+
inpipe_alive = inpipe->check_read ();
|
166
|
+
return inpipe_alive;
|
167
|
+
}
|
168
|
+
|
169
|
+
bool zmq::pair_t::xhas_out ()
|
170
|
+
{
|
171
|
+
if (!outpipe || !outpipe_alive)
|
172
|
+
return false;
|
173
|
+
|
174
|
+
zmq_msg_t msg;
|
175
|
+
zmq_msg_init (&msg);
|
176
|
+
outpipe_alive = outpipe->check_write (&msg);
|
177
|
+
zmq_msg_close (&msg);
|
178
|
+
return outpipe_alive;
|
179
|
+
}
|
180
|
+
|