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.
Files changed (300) hide show
  1. data/LICENSE +703 -0
  2. data/README.md +31 -0
  3. data/lib/libzmq.rb +17 -0
  4. data/lib/libzmq/ffi-rzmq.rb +3 -0
  5. data/libzmq/Makefile +5 -0
  6. data/libzmq/extconf.rb +24 -0
  7. data/libzmq/zeromq-2.1.7/AUTHORS +92 -0
  8. data/libzmq/zeromq-2.1.7/COPYING +674 -0
  9. data/libzmq/zeromq-2.1.7/COPYING.LESSER +206 -0
  10. data/libzmq/zeromq-2.1.7/ChangeLog +15620 -0
  11. data/libzmq/zeromq-2.1.7/INSTALL +237 -0
  12. data/libzmq/zeromq-2.1.7/MAINTAINERS +56 -0
  13. data/libzmq/zeromq-2.1.7/Makefile.am +42 -0
  14. data/libzmq/zeromq-2.1.7/Makefile.in +779 -0
  15. data/libzmq/zeromq-2.1.7/NEWS +275 -0
  16. data/libzmq/zeromq-2.1.7/README +39 -0
  17. data/libzmq/zeromq-2.1.7/acinclude.m4 +582 -0
  18. data/libzmq/zeromq-2.1.7/aclocal.m4 +1206 -0
  19. data/libzmq/zeromq-2.1.7/autogen.sh +45 -0
  20. data/libzmq/zeromq-2.1.7/builds/msvc/Makefile.am +8 -0
  21. data/libzmq/zeromq-2.1.7/builds/msvc/Makefile.in +390 -0
  22. data/libzmq/zeromq-2.1.7/builds/msvc/c_local_lat/c_local_lat.vcproj +176 -0
  23. data/libzmq/zeromq-2.1.7/builds/msvc/c_local_thr/c_local_thr.vcproj +176 -0
  24. data/libzmq/zeromq-2.1.7/builds/msvc/c_remote_lat/c_remote_lat.vcproj +176 -0
  25. data/libzmq/zeromq-2.1.7/builds/msvc/c_remote_thr/c_remote_thr.vcproj +176 -0
  26. data/libzmq/zeromq-2.1.7/builds/msvc/libzmq/libzmq.vcproj +783 -0
  27. data/libzmq/zeromq-2.1.7/builds/msvc/msvc.sln +89 -0
  28. data/libzmq/zeromq-2.1.7/builds/msvc/platform.hpp +32 -0
  29. data/libzmq/zeromq-2.1.7/builds/redhat/zeromq.spec.in +139 -0
  30. data/libzmq/zeromq-2.1.7/config/compile +143 -0
  31. data/libzmq/zeromq-2.1.7/config/config.guess +1502 -0
  32. data/libzmq/zeromq-2.1.7/config/config.sub +1714 -0
  33. data/libzmq/zeromq-2.1.7/config/depcomp +630 -0
  34. data/libzmq/zeromq-2.1.7/config/install-sh +520 -0
  35. data/libzmq/zeromq-2.1.7/config/libtool.m4 +7377 -0
  36. data/libzmq/zeromq-2.1.7/config/ltmain.sh +8413 -0
  37. data/libzmq/zeromq-2.1.7/config/ltoptions.m4 +368 -0
  38. data/libzmq/zeromq-2.1.7/config/ltsugar.m4 +123 -0
  39. data/libzmq/zeromq-2.1.7/config/ltversion.m4 +23 -0
  40. data/libzmq/zeromq-2.1.7/config/lt~obsolete.m4 +92 -0
  41. data/libzmq/zeromq-2.1.7/config/missing +376 -0
  42. data/libzmq/zeromq-2.1.7/configure +21645 -0
  43. data/libzmq/zeromq-2.1.7/configure.in +380 -0
  44. data/libzmq/zeromq-2.1.7/doc/Makefile.am +46 -0
  45. data/libzmq/zeromq-2.1.7/doc/Makefile.in +546 -0
  46. data/libzmq/zeromq-2.1.7/doc/asciidoc.conf +56 -0
  47. data/libzmq/zeromq-2.1.7/doc/zmq.7 +242 -0
  48. data/libzmq/zeromq-2.1.7/doc/zmq.html +846 -0
  49. data/libzmq/zeromq-2.1.7/doc/zmq.txt +218 -0
  50. data/libzmq/zeromq-2.1.7/doc/zmq_bind.3 +166 -0
  51. data/libzmq/zeromq-2.1.7/doc/zmq_bind.html +746 -0
  52. data/libzmq/zeromq-2.1.7/doc/zmq_bind.txt +91 -0
  53. data/libzmq/zeromq-2.1.7/doc/zmq_close.3 +81 -0
  54. data/libzmq/zeromq-2.1.7/doc/zmq_close.html +645 -0
  55. data/libzmq/zeromq-2.1.7/doc/zmq_close.txt +52 -0
  56. data/libzmq/zeromq-2.1.7/doc/zmq_connect.3 +161 -0
  57. data/libzmq/zeromq-2.1.7/doc/zmq_connect.html +732 -0
  58. data/libzmq/zeromq-2.1.7/doc/zmq_connect.txt +89 -0
  59. data/libzmq/zeromq-2.1.7/doc/zmq_cpp.7 +410 -0
  60. data/libzmq/zeromq-2.1.7/doc/zmq_cpp.html +765 -0
  61. data/libzmq/zeromq-2.1.7/doc/zmq_cpp.txt +212 -0
  62. data/libzmq/zeromq-2.1.7/doc/zmq_device.3 +140 -0
  63. data/libzmq/zeromq-2.1.7/doc/zmq_device.html +736 -0
  64. data/libzmq/zeromq-2.1.7/doc/zmq_device.txt +138 -0
  65. data/libzmq/zeromq-2.1.7/doc/zmq_epgm.7 +209 -0
  66. data/libzmq/zeromq-2.1.7/doc/zmq_epgm.html +749 -0
  67. data/libzmq/zeromq-2.1.7/doc/zmq_epgm.txt +162 -0
  68. data/libzmq/zeromq-2.1.7/doc/zmq_errno.3 +78 -0
  69. data/libzmq/zeromq-2.1.7/doc/zmq_errno.html +634 -0
  70. data/libzmq/zeromq-2.1.7/doc/zmq_errno.txt +50 -0
  71. data/libzmq/zeromq-2.1.7/doc/zmq_getsockopt.3 +944 -0
  72. data/libzmq/zeromq-2.1.7/doc/zmq_getsockopt.html +1713 -0
  73. data/libzmq/zeromq-2.1.7/doc/zmq_getsockopt.txt +407 -0
  74. data/libzmq/zeromq-2.1.7/doc/zmq_init.3 +71 -0
  75. data/libzmq/zeromq-2.1.7/doc/zmq_init.html +635 -0
  76. data/libzmq/zeromq-2.1.7/doc/zmq_init.txt +51 -0
  77. data/libzmq/zeromq-2.1.7/doc/zmq_inproc.7 +115 -0
  78. data/libzmq/zeromq-2.1.7/doc/zmq_inproc.html +669 -0
  79. data/libzmq/zeromq-2.1.7/doc/zmq_inproc.txt +89 -0
  80. data/libzmq/zeromq-2.1.7/doc/zmq_ipc.7 +109 -0
  81. data/libzmq/zeromq-2.1.7/doc/zmq_ipc.html +662 -0
  82. data/libzmq/zeromq-2.1.7/doc/zmq_ipc.txt +80 -0
  83. data/libzmq/zeromq-2.1.7/doc/zmq_msg_close.3 +81 -0
  84. data/libzmq/zeromq-2.1.7/doc/zmq_msg_close.html +647 -0
  85. data/libzmq/zeromq-2.1.7/doc/zmq_msg_close.txt +55 -0
  86. data/libzmq/zeromq-2.1.7/doc/zmq_msg_copy.3 +95 -0
  87. data/libzmq/zeromq-2.1.7/doc/zmq_msg_copy.html +656 -0
  88. data/libzmq/zeromq-2.1.7/doc/zmq_msg_copy.txt +57 -0
  89. data/libzmq/zeromq-2.1.7/doc/zmq_msg_data.3 +76 -0
  90. data/libzmq/zeromq-2.1.7/doc/zmq_msg_data.html +633 -0
  91. data/libzmq/zeromq-2.1.7/doc/zmq_msg_data.txt +48 -0
  92. data/libzmq/zeromq-2.1.7/doc/zmq_msg_init.3 +110 -0
  93. data/libzmq/zeromq-2.1.7/doc/zmq_msg_init.html +656 -0
  94. data/libzmq/zeromq-2.1.7/doc/zmq_msg_init.txt +65 -0
  95. data/libzmq/zeromq-2.1.7/doc/zmq_msg_init_data.3 +138 -0
  96. data/libzmq/zeromq-2.1.7/doc/zmq_msg_init_data.html +678 -0
  97. data/libzmq/zeromq-2.1.7/doc/zmq_msg_init_data.txt +83 -0
  98. data/libzmq/zeromq-2.1.7/doc/zmq_msg_init_size.3 +97 -0
  99. data/libzmq/zeromq-2.1.7/doc/zmq_msg_init_size.html +656 -0
  100. data/libzmq/zeromq-2.1.7/doc/zmq_msg_init_size.txt +58 -0
  101. data/libzmq/zeromq-2.1.7/doc/zmq_msg_move.3 +79 -0
  102. data/libzmq/zeromq-2.1.7/doc/zmq_msg_move.html +645 -0
  103. data/libzmq/zeromq-2.1.7/doc/zmq_msg_move.txt +52 -0
  104. data/libzmq/zeromq-2.1.7/doc/zmq_msg_size.3 +76 -0
  105. data/libzmq/zeromq-2.1.7/doc/zmq_msg_size.html +633 -0
  106. data/libzmq/zeromq-2.1.7/doc/zmq_msg_size.txt +48 -0
  107. data/libzmq/zeromq-2.1.7/doc/zmq_pgm.7 +209 -0
  108. data/libzmq/zeromq-2.1.7/doc/zmq_pgm.html +749 -0
  109. data/libzmq/zeromq-2.1.7/doc/zmq_pgm.txt +162 -0
  110. data/libzmq/zeromq-2.1.7/doc/zmq_poll.3 +204 -0
  111. data/libzmq/zeromq-2.1.7/doc/zmq_poll.html +755 -0
  112. data/libzmq/zeromq-2.1.7/doc/zmq_poll.txt +132 -0
  113. data/libzmq/zeromq-2.1.7/doc/zmq_recv.3 +172 -0
  114. data/libzmq/zeromq-2.1.7/doc/zmq_recv.html +746 -0
  115. data/libzmq/zeromq-2.1.7/doc/zmq_recv.txt +121 -0
  116. data/libzmq/zeromq-2.1.7/doc/zmq_send.3 +185 -0
  117. data/libzmq/zeromq-2.1.7/doc/zmq_send.html +755 -0
  118. data/libzmq/zeromq-2.1.7/doc/zmq_send.txt +120 -0
  119. data/libzmq/zeromq-2.1.7/doc/zmq_setsockopt.3 +878 -0
  120. data/libzmq/zeromq-2.1.7/doc/zmq_setsockopt.html +1603 -0
  121. data/libzmq/zeromq-2.1.7/doc/zmq_setsockopt.txt +382 -0
  122. data/libzmq/zeromq-2.1.7/doc/zmq_socket.3 +779 -0
  123. data/libzmq/zeromq-2.1.7/doc/zmq_socket.html +1424 -0
  124. data/libzmq/zeromq-2.1.7/doc/zmq_socket.txt +342 -0
  125. data/libzmq/zeromq-2.1.7/doc/zmq_strerror.3 +78 -0
  126. data/libzmq/zeromq-2.1.7/doc/zmq_strerror.html +634 -0
  127. data/libzmq/zeromq-2.1.7/doc/zmq_strerror.txt +55 -0
  128. data/libzmq/zeromq-2.1.7/doc/zmq_tcp.7 +244 -0
  129. data/libzmq/zeromq-2.1.7/doc/zmq_tcp.html +755 -0
  130. data/libzmq/zeromq-2.1.7/doc/zmq_tcp.txt +162 -0
  131. data/libzmq/zeromq-2.1.7/doc/zmq_term.3 +135 -0
  132. data/libzmq/zeromq-2.1.7/doc/zmq_term.html +672 -0
  133. data/libzmq/zeromq-2.1.7/doc/zmq_term.txt +65 -0
  134. data/libzmq/zeromq-2.1.7/doc/zmq_version.3 +78 -0
  135. data/libzmq/zeromq-2.1.7/doc/zmq_version.html +632 -0
  136. data/libzmq/zeromq-2.1.7/doc/zmq_version.txt +53 -0
  137. data/libzmq/zeromq-2.1.7/foreign/openpgm/Makefile.am +8 -0
  138. data/libzmq/zeromq-2.1.7/foreign/openpgm/Makefile.in +588 -0
  139. data/libzmq/zeromq-2.1.7/foreign/openpgm/libpgm-5.1.115~dfsg.tar.gz +0 -0
  140. data/libzmq/zeromq-2.1.7/foreign/xmlParser/xmlParser.cpp +2923 -0
  141. data/libzmq/zeromq-2.1.7/foreign/xmlParser/xmlParser.hpp +762 -0
  142. data/libzmq/zeromq-2.1.7/include/zmq.h +269 -0
  143. data/libzmq/zeromq-2.1.7/include/zmq.hpp +301 -0
  144. data/libzmq/zeromq-2.1.7/include/zmq_utils.h +64 -0
  145. data/libzmq/zeromq-2.1.7/perf/Makefile.am +21 -0
  146. data/libzmq/zeromq-2.1.7/perf/Makefile.in +566 -0
  147. data/libzmq/zeromq-2.1.7/perf/inproc_lat.cpp +232 -0
  148. data/libzmq/zeromq-2.1.7/perf/inproc_thr.cpp +246 -0
  149. data/libzmq/zeromq-2.1.7/perf/local_lat.cpp +108 -0
  150. data/libzmq/zeromq-2.1.7/perf/local_thr.cpp +138 -0
  151. data/libzmq/zeromq-2.1.7/perf/remote_lat.cpp +121 -0
  152. data/libzmq/zeromq-2.1.7/perf/remote_thr.cpp +104 -0
  153. data/libzmq/zeromq-2.1.7/src/Makefile.am +155 -0
  154. data/libzmq/zeromq-2.1.7/src/Makefile.in +1320 -0
  155. data/libzmq/zeromq-2.1.7/src/array.hpp +147 -0
  156. data/libzmq/zeromq-2.1.7/src/atomic_counter.hpp +164 -0
  157. data/libzmq/zeromq-2.1.7/src/atomic_ptr.hpp +159 -0
  158. data/libzmq/zeromq-2.1.7/src/blob.hpp +34 -0
  159. data/libzmq/zeromq-2.1.7/src/clock.cpp +118 -0
  160. data/libzmq/zeromq-2.1.7/src/clock.hpp +60 -0
  161. data/libzmq/zeromq-2.1.7/src/command.cpp +39 -0
  162. data/libzmq/zeromq-2.1.7/src/command.hpp +147 -0
  163. data/libzmq/zeromq-2.1.7/src/config.hpp +88 -0
  164. data/libzmq/zeromq-2.1.7/src/connect_session.cpp +119 -0
  165. data/libzmq/zeromq-2.1.7/src/connect_session.hpp +65 -0
  166. data/libzmq/zeromq-2.1.7/src/ctx.cpp +322 -0
  167. data/libzmq/zeromq-2.1.7/src/ctx.hpp +159 -0
  168. data/libzmq/zeromq-2.1.7/src/decoder.cpp +129 -0
  169. data/libzmq/zeromq-2.1.7/src/decoder.hpp +207 -0
  170. data/libzmq/zeromq-2.1.7/src/device.cpp +120 -0
  171. data/libzmq/zeromq-2.1.7/src/device.hpp +32 -0
  172. data/libzmq/zeromq-2.1.7/src/devpoll.cpp +190 -0
  173. data/libzmq/zeromq-2.1.7/src/devpoll.hpp +100 -0
  174. data/libzmq/zeromq-2.1.7/src/dist.cpp +200 -0
  175. data/libzmq/zeromq-2.1.7/src/dist.hpp +90 -0
  176. data/libzmq/zeromq-2.1.7/src/encoder.cpp +90 -0
  177. data/libzmq/zeromq-2.1.7/src/encoder.hpp +184 -0
  178. data/libzmq/zeromq-2.1.7/src/epoll.cpp +177 -0
  179. data/libzmq/zeromq-2.1.7/src/epoll.hpp +96 -0
  180. data/libzmq/zeromq-2.1.7/src/err.cpp +238 -0
  181. data/libzmq/zeromq-2.1.7/src/err.hpp +145 -0
  182. data/libzmq/zeromq-2.1.7/src/fd.hpp +45 -0
  183. data/libzmq/zeromq-2.1.7/src/fq.cpp +164 -0
  184. data/libzmq/zeromq-2.1.7/src/fq.hpp +80 -0
  185. data/libzmq/zeromq-2.1.7/src/i_engine.hpp +53 -0
  186. data/libzmq/zeromq-2.1.7/src/i_inout.hpp +50 -0
  187. data/libzmq/zeromq-2.1.7/src/i_poll_events.hpp +46 -0
  188. data/libzmq/zeromq-2.1.7/src/io_object.cpp +107 -0
  189. data/libzmq/zeromq-2.1.7/src/io_object.hpp +78 -0
  190. data/libzmq/zeromq-2.1.7/src/io_thread.cpp +109 -0
  191. data/libzmq/zeromq-2.1.7/src/io_thread.hpp +88 -0
  192. data/libzmq/zeromq-2.1.7/src/ip.cpp +339 -0
  193. data/libzmq/zeromq-2.1.7/src/ip.hpp +68 -0
  194. data/libzmq/zeromq-2.1.7/src/kqueue.cpp +194 -0
  195. data/libzmq/zeromq-2.1.7/src/kqueue.hpp +103 -0
  196. data/libzmq/zeromq-2.1.7/src/lb.cpp +174 -0
  197. data/libzmq/zeromq-2.1.7/src/lb.hpp +79 -0
  198. data/libzmq/zeromq-2.1.7/src/libzmq.pc.in +10 -0
  199. data/libzmq/zeromq-2.1.7/src/likely.hpp +33 -0
  200. data/libzmq/zeromq-2.1.7/src/mailbox.cpp +382 -0
  201. data/libzmq/zeromq-2.1.7/src/mailbox.hpp +62 -0
  202. data/libzmq/zeromq-2.1.7/src/msg_content.hpp +52 -0
  203. data/libzmq/zeromq-2.1.7/src/mutex.hpp +121 -0
  204. data/libzmq/zeromq-2.1.7/src/named_session.cpp +85 -0
  205. data/libzmq/zeromq-2.1.7/src/named_session.hpp +57 -0
  206. data/libzmq/zeromq-2.1.7/src/object.cpp +467 -0
  207. data/libzmq/zeromq-2.1.7/src/object.hpp +127 -0
  208. data/libzmq/zeromq-2.1.7/src/options.cpp +336 -0
  209. data/libzmq/zeromq-2.1.7/src/options.hpp +87 -0
  210. data/libzmq/zeromq-2.1.7/src/own.cpp +214 -0
  211. data/libzmq/zeromq-2.1.7/src/own.hpp +140 -0
  212. data/libzmq/zeromq-2.1.7/src/pair.cpp +180 -0
  213. data/libzmq/zeromq-2.1.7/src/pair.hpp +76 -0
  214. data/libzmq/zeromq-2.1.7/src/pgm_receiver.cpp +259 -0
  215. data/libzmq/zeromq-2.1.7/src/pgm_receiver.hpp +129 -0
  216. data/libzmq/zeromq-2.1.7/src/pgm_sender.cpp +215 -0
  217. data/libzmq/zeromq-2.1.7/src/pgm_sender.hpp +105 -0
  218. data/libzmq/zeromq-2.1.7/src/pgm_socket.cpp +705 -0
  219. data/libzmq/zeromq-2.1.7/src/pgm_socket.hpp +118 -0
  220. data/libzmq/zeromq-2.1.7/src/pipe.cpp +409 -0
  221. data/libzmq/zeromq-2.1.7/src/pipe.hpp +214 -0
  222. data/libzmq/zeromq-2.1.7/src/platform.hpp.in +228 -0
  223. data/libzmq/zeromq-2.1.7/src/poll.cpp +180 -0
  224. data/libzmq/zeromq-2.1.7/src/poll.hpp +104 -0
  225. data/libzmq/zeromq-2.1.7/src/poller.hpp +73 -0
  226. data/libzmq/zeromq-2.1.7/src/poller_base.cpp +99 -0
  227. data/libzmq/zeromq-2.1.7/src/poller_base.hpp +84 -0
  228. data/libzmq/zeromq-2.1.7/src/pub.cpp +31 -0
  229. data/libzmq/zeromq-2.1.7/src/pub.hpp +44 -0
  230. data/libzmq/zeromq-2.1.7/src/pull.cpp +61 -0
  231. data/libzmq/zeromq-2.1.7/src/pull.hpp +60 -0
  232. data/libzmq/zeromq-2.1.7/src/push.cpp +62 -0
  233. data/libzmq/zeromq-2.1.7/src/push.hpp +59 -0
  234. data/libzmq/zeromq-2.1.7/src/reaper.cpp +121 -0
  235. data/libzmq/zeromq-2.1.7/src/reaper.hpp +77 -0
  236. data/libzmq/zeromq-2.1.7/src/rep.cpp +131 -0
  237. data/libzmq/zeromq-2.1.7/src/rep.hpp +59 -0
  238. data/libzmq/zeromq-2.1.7/src/req.cpp +121 -0
  239. data/libzmq/zeromq-2.1.7/src/req.hpp +58 -0
  240. data/libzmq/zeromq-2.1.7/src/select.cpp +211 -0
  241. data/libzmq/zeromq-2.1.7/src/select.hpp +116 -0
  242. data/libzmq/zeromq-2.1.7/src/semaphore.hpp +189 -0
  243. data/libzmq/zeromq-2.1.7/src/session.cpp +347 -0
  244. data/libzmq/zeromq-2.1.7/src/session.hpp +150 -0
  245. data/libzmq/zeromq-2.1.7/src/socket_base.cpp +811 -0
  246. data/libzmq/zeromq-2.1.7/src/socket_base.hpp +207 -0
  247. data/libzmq/zeromq-2.1.7/src/stdint.hpp +63 -0
  248. data/libzmq/zeromq-2.1.7/src/sub.cpp +75 -0
  249. data/libzmq/zeromq-2.1.7/src/sub.hpp +50 -0
  250. data/libzmq/zeromq-2.1.7/src/swap.cpp +325 -0
  251. data/libzmq/zeromq-2.1.7/src/swap.hpp +123 -0
  252. data/libzmq/zeromq-2.1.7/src/tcp_connecter.cpp +310 -0
  253. data/libzmq/zeromq-2.1.7/src/tcp_connecter.hpp +81 -0
  254. data/libzmq/zeromq-2.1.7/src/tcp_listener.cpp +371 -0
  255. data/libzmq/zeromq-2.1.7/src/tcp_listener.hpp +73 -0
  256. data/libzmq/zeromq-2.1.7/src/tcp_socket.cpp +228 -0
  257. data/libzmq/zeromq-2.1.7/src/tcp_socket.hpp +72 -0
  258. data/libzmq/zeromq-2.1.7/src/thread.cpp +97 -0
  259. data/libzmq/zeromq-2.1.7/src/thread.hpp +78 -0
  260. data/libzmq/zeromq-2.1.7/src/transient_session.cpp +41 -0
  261. data/libzmq/zeromq-2.1.7/src/transient_session.hpp +52 -0
  262. data/libzmq/zeromq-2.1.7/src/trie.cpp +181 -0
  263. data/libzmq/zeromq-2.1.7/src/trie.hpp +59 -0
  264. data/libzmq/zeromq-2.1.7/src/uuid.cpp +233 -0
  265. data/libzmq/zeromq-2.1.7/src/uuid.hpp +111 -0
  266. data/libzmq/zeromq-2.1.7/src/windows.hpp +79 -0
  267. data/libzmq/zeromq-2.1.7/src/wire.hpp +99 -0
  268. data/libzmq/zeromq-2.1.7/src/xpub.cpp +76 -0
  269. data/libzmq/zeromq-2.1.7/src/xpub.hpp +61 -0
  270. data/libzmq/zeromq-2.1.7/src/xrep.cpp +337 -0
  271. data/libzmq/zeromq-2.1.7/src/xrep.hpp +116 -0
  272. data/libzmq/zeromq-2.1.7/src/xreq.cpp +74 -0
  273. data/libzmq/zeromq-2.1.7/src/xreq.hpp +65 -0
  274. data/libzmq/zeromq-2.1.7/src/xsub.cpp +172 -0
  275. data/libzmq/zeromq-2.1.7/src/xsub.hpp +80 -0
  276. data/libzmq/zeromq-2.1.7/src/ypipe.hpp +209 -0
  277. data/libzmq/zeromq-2.1.7/src/yqueue.hpp +198 -0
  278. data/libzmq/zeromq-2.1.7/src/zmq.cpp +798 -0
  279. data/libzmq/zeromq-2.1.7/src/zmq_connecter.cpp +166 -0
  280. data/libzmq/zeromq-2.1.7/src/zmq_connecter.hpp +92 -0
  281. data/libzmq/zeromq-2.1.7/src/zmq_engine.cpp +220 -0
  282. data/libzmq/zeromq-2.1.7/src/zmq_engine.hpp +87 -0
  283. data/libzmq/zeromq-2.1.7/src/zmq_init.cpp +216 -0
  284. data/libzmq/zeromq-2.1.7/src/zmq_init.hpp +93 -0
  285. data/libzmq/zeromq-2.1.7/src/zmq_listener.cpp +78 -0
  286. data/libzmq/zeromq-2.1.7/src/zmq_listener.hpp +67 -0
  287. data/libzmq/zeromq-2.1.7/tests/Makefile.am +30 -0
  288. data/libzmq/zeromq-2.1.7/tests/Makefile.in +713 -0
  289. data/libzmq/zeromq-2.1.7/tests/test_hwm.cpp +68 -0
  290. data/libzmq/zeromq-2.1.7/tests/test_pair_inproc.cpp +31 -0
  291. data/libzmq/zeromq-2.1.7/tests/test_pair_ipc.cpp +31 -0
  292. data/libzmq/zeromq-2.1.7/tests/test_pair_tcp.cpp +31 -0
  293. data/libzmq/zeromq-2.1.7/tests/test_reqrep_inproc.cpp +31 -0
  294. data/libzmq/zeromq-2.1.7/tests/test_reqrep_ipc.cpp +31 -0
  295. data/libzmq/zeromq-2.1.7/tests/test_reqrep_tcp.cpp +31 -0
  296. data/libzmq/zeromq-2.1.7/tests/test_shutdown_stress.cpp +87 -0
  297. data/libzmq/zeromq-2.1.7/tests/testutil.hpp +130 -0
  298. data/libzmq/zeromq-2.1.7/version.sh +21 -0
  299. data/libzmq/zeromq-2.1.7/zeromq.spec +139 -0
  300. metadata +348 -0
@@ -0,0 +1,99 @@
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_WIRE_HPP_INCLUDED__
22
+ #define __ZMQ_WIRE_HPP_INCLUDED__
23
+
24
+ #include "stdint.hpp"
25
+
26
+ namespace zmq
27
+ {
28
+
29
+ // Helper functions to convert different integer types to/from network
30
+ // byte order.
31
+
32
+ inline void put_uint8 (unsigned char *buffer_, uint8_t value)
33
+ {
34
+ *buffer_ = value;
35
+ }
36
+
37
+ inline uint8_t get_uint8 (unsigned char *buffer_)
38
+ {
39
+ return *buffer_;
40
+ }
41
+
42
+ inline void put_uint16 (unsigned char *buffer_, uint16_t value)
43
+ {
44
+ buffer_ [0] = (unsigned char) (((value) >> 8) & 0xff);
45
+ buffer_ [1] = (unsigned char) (value & 0xff);
46
+ }
47
+
48
+ inline uint16_t get_uint16 (unsigned char *buffer_)
49
+ {
50
+ return
51
+ (((uint16_t) buffer_ [0]) << 8) |
52
+ ((uint16_t) buffer_ [1]);
53
+ }
54
+
55
+ inline void put_uint32 (unsigned char *buffer_, uint32_t value)
56
+ {
57
+ buffer_ [0] = (unsigned char) (((value) >> 24) & 0xff);
58
+ buffer_ [1] = (unsigned char) (((value) >> 16) & 0xff);
59
+ buffer_ [2] = (unsigned char) (((value) >> 8) & 0xff);
60
+ buffer_ [3] = (unsigned char) (value & 0xff);
61
+ }
62
+
63
+ inline uint32_t get_uint32 (unsigned char *buffer_)
64
+ {
65
+ return
66
+ (((uint32_t) buffer_ [0]) << 24) |
67
+ (((uint32_t) buffer_ [1]) << 16) |
68
+ (((uint32_t) buffer_ [2]) << 8) |
69
+ ((uint32_t) buffer_ [3]);
70
+ }
71
+
72
+ inline void put_uint64 (unsigned char *buffer_, uint64_t value)
73
+ {
74
+ buffer_ [0] = (unsigned char) (((value) >> 56) & 0xff);
75
+ buffer_ [1] = (unsigned char) (((value) >> 48) & 0xff);
76
+ buffer_ [2] = (unsigned char) (((value) >> 40) & 0xff);
77
+ buffer_ [3] = (unsigned char) (((value) >> 32) & 0xff);
78
+ buffer_ [4] = (unsigned char) (((value) >> 24) & 0xff);
79
+ buffer_ [5] = (unsigned char) (((value) >> 16) & 0xff);
80
+ buffer_ [6] = (unsigned char) (((value) >> 8) & 0xff);
81
+ buffer_ [7] = (unsigned char) (value & 0xff);
82
+ }
83
+
84
+ inline uint64_t get_uint64 (unsigned char *buffer_)
85
+ {
86
+ return
87
+ (((uint64_t) buffer_ [0]) << 56) |
88
+ (((uint64_t) buffer_ [1]) << 48) |
89
+ (((uint64_t) buffer_ [2]) << 40) |
90
+ (((uint64_t) buffer_ [3]) << 32) |
91
+ (((uint64_t) buffer_ [4]) << 24) |
92
+ (((uint64_t) buffer_ [5]) << 16) |
93
+ (((uint64_t) buffer_ [6]) << 8) |
94
+ ((uint64_t) buffer_ [7]);
95
+ }
96
+
97
+ }
98
+
99
+ #endif
@@ -0,0 +1,76 @@
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 "xpub.hpp"
24
+ #include "err.hpp"
25
+ #include "pipe.hpp"
26
+
27
+ zmq::xpub_t::xpub_t (class ctx_t *parent_, uint32_t tid_) :
28
+ socket_base_t (parent_, tid_),
29
+ dist (this)
30
+ {
31
+ options.type = ZMQ_XPUB;
32
+ options.requires_in = false;
33
+ options.requires_out = true;
34
+ }
35
+
36
+ zmq::xpub_t::~xpub_t ()
37
+ {
38
+ }
39
+
40
+ void zmq::xpub_t::xattach_pipes (class reader_t *inpipe_,
41
+ class writer_t *outpipe_, const blob_t &peer_identity_)
42
+ {
43
+ zmq_assert (!inpipe_ && outpipe_);
44
+ dist.attach (outpipe_);
45
+ }
46
+
47
+ void zmq::xpub_t::process_term (int linger_)
48
+ {
49
+ // Terminate the outbound pipes.
50
+ dist.terminate ();
51
+
52
+ // Continue with the termination immediately.
53
+ socket_base_t::process_term (linger_);
54
+ }
55
+
56
+ int zmq::xpub_t::xsend (zmq_msg_t *msg_, int flags_)
57
+ {
58
+ return dist.send (msg_, flags_);
59
+ }
60
+
61
+ bool zmq::xpub_t::xhas_out ()
62
+ {
63
+ return dist.has_out ();
64
+ }
65
+
66
+ int zmq::xpub_t::xrecv (zmq_msg_t *msg_, int flags_)
67
+ {
68
+ errno = EAGAIN;
69
+ return -1;
70
+ }
71
+
72
+ bool zmq::xpub_t::xhas_in ()
73
+ {
74
+ return false;
75
+ }
76
+
@@ -0,0 +1,61 @@
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_XPUB_HPP_INCLUDED__
22
+ #define __ZMQ_XPUB_HPP_INCLUDED__
23
+
24
+ #include "socket_base.hpp"
25
+ #include "array.hpp"
26
+ #include "pipe.hpp"
27
+ #include "dist.hpp"
28
+
29
+ namespace zmq
30
+ {
31
+
32
+ class xpub_t : public socket_base_t
33
+ {
34
+ public:
35
+
36
+ xpub_t (class ctx_t *parent_, uint32_t tid_);
37
+ ~xpub_t ();
38
+
39
+ // Implementations of virtual functions from socket_base_t.
40
+ void xattach_pipes (class reader_t *inpipe_, class writer_t *outpipe_,
41
+ const blob_t &peer_identity_);
42
+ int xsend (zmq_msg_t *msg_, int flags_);
43
+ bool xhas_out ();
44
+ int xrecv (zmq_msg_t *msg_, int flags_);
45
+ bool xhas_in ();
46
+
47
+ private:
48
+
49
+ // Hook into the termination process.
50
+ void process_term (int linger_);
51
+
52
+ // Distributor of messages holding the list of outbound pipes.
53
+ dist_t dist;
54
+
55
+ xpub_t (const xpub_t&);
56
+ const xpub_t &operator = (const xpub_t&);
57
+ };
58
+
59
+ }
60
+
61
+ #endif
@@ -0,0 +1,337 @@
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 "xrep.hpp"
24
+ #include "err.hpp"
25
+ #include "pipe.hpp"
26
+
27
+ zmq::xrep_t::xrep_t (class ctx_t *parent_, uint32_t tid_) :
28
+ socket_base_t (parent_, tid_),
29
+ current_in (0),
30
+ prefetched (false),
31
+ more_in (false),
32
+ current_out (NULL),
33
+ more_out (false),
34
+ terminating (false)
35
+ {
36
+ options.type = ZMQ_XREP;
37
+ options.requires_in = true;
38
+ options.requires_out = true;
39
+
40
+ // On connect, pipes are created only after initial handshaking.
41
+ // That way we are aware of the peer's identity when binding to the pipes.
42
+ options.immediate_connect = false;
43
+ }
44
+
45
+ zmq::xrep_t::~xrep_t ()
46
+ {
47
+ zmq_assert (inpipes.empty ());
48
+ zmq_assert (outpipes.empty ());
49
+ }
50
+
51
+ void zmq::xrep_t::xattach_pipes (reader_t *inpipe_, writer_t *outpipe_,
52
+ const blob_t &peer_identity_)
53
+ {
54
+ if (outpipe_) {
55
+
56
+ outpipe_->set_event_sink (this);
57
+
58
+ // TODO: What if new connection has same peer identity as the old one?
59
+ outpipe_t outpipe = {outpipe_, true};
60
+ bool ok = outpipes.insert (outpipes_t::value_type (
61
+ peer_identity_, outpipe)).second;
62
+ zmq_assert (ok);
63
+
64
+ if (terminating) {
65
+ register_term_acks (1);
66
+ outpipe_->terminate ();
67
+ }
68
+ }
69
+
70
+ if (inpipe_) {
71
+
72
+ inpipe_->set_event_sink (this);
73
+
74
+ inpipe_t inpipe = {inpipe_, peer_identity_, true};
75
+ inpipes.push_back (inpipe);
76
+
77
+ if (terminating) {
78
+ register_term_acks (1);
79
+ inpipe_->terminate ();
80
+ }
81
+ }
82
+ }
83
+
84
+ void zmq::xrep_t::process_term (int linger_)
85
+ {
86
+ terminating = true;
87
+
88
+ register_term_acks (inpipes.size () + outpipes.size ());
89
+
90
+ for (inpipes_t::iterator it = inpipes.begin (); it != inpipes.end ();
91
+ ++it)
92
+ it->reader->terminate ();
93
+ for (outpipes_t::iterator it = outpipes.begin (); it != outpipes.end ();
94
+ ++it)
95
+ it->second.writer->terminate ();
96
+
97
+ socket_base_t::process_term (linger_);
98
+ }
99
+
100
+ void zmq::xrep_t::terminated (reader_t *pipe_)
101
+ {
102
+ for (inpipes_t::iterator it = inpipes.begin (); it != inpipes.end ();
103
+ ++it) {
104
+ if (it->reader == pipe_) {
105
+ if ((inpipes_t::size_type) (it - inpipes.begin ()) < current_in)
106
+ current_in--;
107
+ inpipes.erase (it);
108
+ if (current_in >= inpipes.size ())
109
+ current_in = 0;
110
+ if (terminating)
111
+ unregister_term_ack ();
112
+ return;
113
+ }
114
+ }
115
+ zmq_assert (false);
116
+ }
117
+
118
+ void zmq::xrep_t::terminated (writer_t *pipe_)
119
+ {
120
+ for (outpipes_t::iterator it = outpipes.begin ();
121
+ it != outpipes.end (); ++it) {
122
+ if (it->second.writer == pipe_) {
123
+ outpipes.erase (it);
124
+ if (pipe_ == current_out)
125
+ current_out = NULL;
126
+ if (terminating)
127
+ unregister_term_ack ();
128
+ return;
129
+ }
130
+ }
131
+ zmq_assert (false);
132
+ }
133
+
134
+ void zmq::xrep_t::delimited (reader_t *pipe_)
135
+ {
136
+ }
137
+
138
+ void zmq::xrep_t::activated (reader_t *pipe_)
139
+ {
140
+ for (inpipes_t::iterator it = inpipes.begin (); it != inpipes.end ();
141
+ ++it) {
142
+ if (it->reader == pipe_) {
143
+ zmq_assert (!it->active);
144
+ it->active = true;
145
+ return;
146
+ }
147
+ }
148
+ zmq_assert (false);
149
+ }
150
+
151
+ void zmq::xrep_t::activated (writer_t *pipe_)
152
+ {
153
+ for (outpipes_t::iterator it = outpipes.begin ();
154
+ it != outpipes.end (); ++it) {
155
+ if (it->second.writer == pipe_) {
156
+ zmq_assert (!it->second.active);
157
+ it->second.active = true;
158
+ return;
159
+ }
160
+ }
161
+ zmq_assert (false);
162
+ }
163
+
164
+ int zmq::xrep_t::xsend (zmq_msg_t *msg_, int flags_)
165
+ {
166
+ // If this is the first part of the message it's the identity of the
167
+ // peer to send the message to.
168
+ if (!more_out) {
169
+ zmq_assert (!current_out);
170
+
171
+ // If we have malformed message (prefix with no subsequent message)
172
+ // then just silently ignore it.
173
+ if (msg_->flags & ZMQ_MSG_MORE) {
174
+
175
+ more_out = true;
176
+
177
+ // Find the pipe associated with the identity stored in the prefix.
178
+ // If there's no such pipe just silently ignore the message.
179
+ blob_t identity ((unsigned char*) zmq_msg_data (msg_),
180
+ zmq_msg_size (msg_));
181
+ outpipes_t::iterator it = outpipes.find (identity);
182
+
183
+ if (it != outpipes.end ()) {
184
+ current_out = it->second.writer;
185
+ zmq_msg_t empty;
186
+ int rc = zmq_msg_init (&empty);
187
+ zmq_assert (rc == 0);
188
+ if (!current_out->check_write (&empty)) {
189
+ it->second.active = false;
190
+ more_out = false;
191
+ current_out = NULL;
192
+ rc = zmq_msg_close (&empty);
193
+ zmq_assert (rc == 0);
194
+ errno = EAGAIN;
195
+ return -1;
196
+ }
197
+ rc = zmq_msg_close (&empty);
198
+ zmq_assert (rc == 0);
199
+ }
200
+ }
201
+
202
+ int rc = zmq_msg_close (msg_);
203
+ zmq_assert (rc == 0);
204
+ rc = zmq_msg_init (msg_);
205
+ zmq_assert (rc == 0);
206
+ return 0;
207
+ }
208
+
209
+ // Check whether this is the last part of the message.
210
+ more_out = msg_->flags & ZMQ_MSG_MORE;
211
+
212
+ // Push the message into the pipe. If there's no out pipe, just drop it.
213
+ if (current_out) {
214
+ bool ok = current_out->write (msg_);
215
+ zmq_assert (ok);
216
+ if (!more_out) {
217
+ current_out->flush ();
218
+ current_out = NULL;
219
+ }
220
+ }
221
+ else {
222
+ int rc = zmq_msg_close (msg_);
223
+ zmq_assert (rc == 0);
224
+ }
225
+
226
+ // Detach the message from the data buffer.
227
+ int rc = zmq_msg_init (msg_);
228
+ zmq_assert (rc == 0);
229
+
230
+ return 0;
231
+ }
232
+
233
+ int zmq::xrep_t::xrecv (zmq_msg_t *msg_, int flags_)
234
+ {
235
+ // If there is a prefetched message, return it.
236
+ if (prefetched) {
237
+ zmq_msg_move (msg_, &prefetched_msg);
238
+ more_in = msg_->flags & ZMQ_MSG_MORE;
239
+ prefetched = false;
240
+ return 0;
241
+ }
242
+
243
+ // Deallocate old content of the message.
244
+ zmq_msg_close (msg_);
245
+
246
+ // If we are in the middle of reading a message, just grab next part of it.
247
+ if (more_in) {
248
+ zmq_assert (inpipes [current_in].active);
249
+ bool fetched = inpipes [current_in].reader->read (msg_);
250
+ zmq_assert (fetched);
251
+ more_in = msg_->flags & ZMQ_MSG_MORE;
252
+ if (!more_in) {
253
+ current_in++;
254
+ if (current_in >= inpipes.size ())
255
+ current_in = 0;
256
+ }
257
+ return 0;
258
+ }
259
+
260
+ // Round-robin over the pipes to get the next message.
261
+ for (int count = inpipes.size (); count != 0; count--) {
262
+
263
+ // Try to fetch new message.
264
+ if (inpipes [current_in].active)
265
+ prefetched = inpipes [current_in].reader->read (&prefetched_msg);
266
+
267
+ // If we have a message, create a prefix and return it to the caller.
268
+ if (prefetched) {
269
+ int rc = zmq_msg_init_size (msg_,
270
+ inpipes [current_in].identity.size ());
271
+ zmq_assert (rc == 0);
272
+ memcpy (zmq_msg_data (msg_), inpipes [current_in].identity.data (),
273
+ zmq_msg_size (msg_));
274
+ msg_->flags |= ZMQ_MSG_MORE;
275
+ return 0;
276
+ }
277
+
278
+ // If me don't have a message, mark the pipe as passive and
279
+ // move to next pipe.
280
+ inpipes [current_in].active = false;
281
+ current_in++;
282
+ if (current_in >= inpipes.size ())
283
+ current_in = 0;
284
+ }
285
+
286
+ // No message is available. Initialise the output parameter
287
+ // to be a 0-byte message.
288
+ zmq_msg_init (msg_);
289
+ errno = EAGAIN;
290
+ return -1;
291
+ }
292
+
293
+ int zmq::xrep_t::rollback (void)
294
+ {
295
+ if (current_out) {
296
+ current_out->rollback ();
297
+ current_out = NULL;
298
+ more_out = false;
299
+ }
300
+ return 0;
301
+ }
302
+
303
+ bool zmq::xrep_t::xhas_in ()
304
+ {
305
+ // There are subsequent parts of the partly-read message available.
306
+ if (prefetched || more_in)
307
+ return true;
308
+
309
+ // Note that messing with current doesn't break the fairness of fair
310
+ // queueing algorithm. If there are no messages available current will
311
+ // get back to its original value. Otherwise it'll point to the first
312
+ // pipe holding messages, skipping only pipes with no messages available.
313
+ for (int count = inpipes.size (); count != 0; count--) {
314
+ if (inpipes [current_in].active &&
315
+ inpipes [current_in].reader->check_read ())
316
+ return true;
317
+
318
+ // If me don't have a message, mark the pipe as passive and
319
+ // move to next pipe.
320
+ inpipes [current_in].active = false;
321
+ current_in++;
322
+ if (current_in >= inpipes.size ())
323
+ current_in = 0;
324
+ }
325
+
326
+ return false;
327
+ }
328
+
329
+ bool zmq::xrep_t::xhas_out ()
330
+ {
331
+ // In theory, XREP socket is always ready for writing. Whether actual
332
+ // attempt to write succeeds depends on whitch pipe the message is going
333
+ // to be routed to.
334
+ return true;
335
+ }
336
+
337
+