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,159 @@
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_CTX_HPP_INCLUDED__
22
+ #define __ZMQ_CTX_HPP_INCLUDED__
23
+
24
+ #include <map>
25
+ #include <vector>
26
+ #include <string>
27
+ #include <stdarg.h>
28
+
29
+ #include "../include/zmq.h"
30
+
31
+ #include "mailbox.hpp"
32
+ #include "semaphore.hpp"
33
+ #include "ypipe.hpp"
34
+ #include "array.hpp"
35
+ #include "config.hpp"
36
+ #include "mutex.hpp"
37
+ #include "stdint.hpp"
38
+ #include "thread.hpp"
39
+ #include "options.hpp"
40
+
41
+ namespace zmq
42
+ {
43
+ // Information associated with inproc endpoint. Note that endpoint options
44
+ // are registered as well so that the peer can access them without a need
45
+ // for synchronisation, handshaking or similar.
46
+ struct endpoint_t
47
+ {
48
+ class socket_base_t *socket;
49
+ options_t options;
50
+ };
51
+
52
+ // Context object encapsulates all the global state associated with
53
+ // the library.
54
+
55
+ class ctx_t
56
+ {
57
+ public:
58
+
59
+ // Create the context object. The argument specifies the size
60
+ // of I/O thread pool to create.
61
+ ctx_t (uint32_t io_threads_);
62
+
63
+ // Returns false if object is not a context.
64
+ bool check_tag ();
65
+
66
+ // This function is called when user invokes zmq_term. If there are
67
+ // no more sockets open it'll cause all the infrastructure to be shut
68
+ // down. If there are open sockets still, the deallocation happens
69
+ // after the last one is closed.
70
+ int terminate ();
71
+
72
+ // Create and destroy a socket.
73
+ class socket_base_t *create_socket (int type_);
74
+ void destroy_socket (class socket_base_t *socket_);
75
+
76
+ // Send command to the destination thread.
77
+ void send_command (uint32_t tid_, const command_t &command_);
78
+
79
+ // Returns the I/O thread that is the least busy at the moment.
80
+ // Affinity specifies which I/O threads are eligible (0 = all).
81
+ // Returns NULL is no I/O thread is available.
82
+ class io_thread_t *choose_io_thread (uint64_t affinity_);
83
+
84
+ // Returns reaper thread object.
85
+ class object_t *get_reaper ();
86
+
87
+ // Management of inproc endpoints.
88
+ int register_endpoint (const char *addr_, endpoint_t &endpoint_);
89
+ void unregister_endpoints (class socket_base_t *socket_);
90
+ endpoint_t find_endpoint (const char *addr_);
91
+
92
+ // Logging.
93
+ void log (const char *format_, va_list args_);
94
+
95
+ enum {
96
+ term_tid = 0,
97
+ reaper_tid = 1
98
+ };
99
+
100
+ private:
101
+
102
+ ~ctx_t ();
103
+
104
+ // Used to check whether the object is a context.
105
+ uint32_t tag;
106
+
107
+ // Sockets belonging to this context. We need the list so that
108
+ // we can notify the sockets when zmq_term() is called. The sockets
109
+ // will return ETERM then.
110
+ typedef array_t <socket_base_t> sockets_t;
111
+ sockets_t sockets;
112
+
113
+ // List of unused thread slots.
114
+ typedef std::vector <uint32_t> emtpy_slots_t;
115
+ emtpy_slots_t empty_slots;
116
+
117
+ // If true, zmq_term was already called.
118
+ bool terminating;
119
+
120
+ // Synchronisation of accesses to global slot-related data:
121
+ // sockets, empty_slots, terminating. It also synchronises
122
+ // access to zombie sockets as such (as oposed to slots) and provides
123
+ // a memory barrier to ensure that all CPU cores see the same data.
124
+ mutex_t slot_sync;
125
+
126
+ // The reaper thread.
127
+ class reaper_t *reaper;
128
+
129
+ // I/O threads.
130
+ typedef std::vector <class io_thread_t*> io_threads_t;
131
+ io_threads_t io_threads;
132
+
133
+ // Array of pointers to mailboxes for both application and I/O threads.
134
+ uint32_t slot_count;
135
+ mailbox_t **slots;
136
+
137
+ // Mailbox for zmq_term thread.
138
+ mailbox_t term_mailbox;
139
+
140
+ // List of inproc endpoints within this context.
141
+ typedef std::map <std::string, endpoint_t> endpoints_t;
142
+ endpoints_t endpoints;
143
+
144
+ // Synchronisation of access to the list of inproc endpoints.
145
+ mutex_t endpoints_sync;
146
+
147
+ // PUB socket for logging. The socket is shared among all the threads,
148
+ // thus it is synchronised by a mutex.
149
+ class socket_base_t *log_socket;
150
+ mutex_t log_sync;
151
+
152
+ ctx_t (const ctx_t&);
153
+ const ctx_t &operator = (const ctx_t&);
154
+ };
155
+
156
+ }
157
+
158
+ #endif
159
+
@@ -0,0 +1,129 @@
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 <stdlib.h>
22
+ #include <string.h>
23
+
24
+ #include "decoder.hpp"
25
+ #include "i_inout.hpp"
26
+ #include "wire.hpp"
27
+ #include "err.hpp"
28
+
29
+ zmq::decoder_t::decoder_t (size_t bufsize_) :
30
+ decoder_base_t <decoder_t> (bufsize_),
31
+ destination (NULL)
32
+ {
33
+ zmq_msg_init (&in_progress);
34
+
35
+ // At the beginning, read one byte and go to one_byte_size_ready state.
36
+ next_step (tmpbuf, 1, &decoder_t::one_byte_size_ready);
37
+ }
38
+
39
+ zmq::decoder_t::~decoder_t ()
40
+ {
41
+ zmq_msg_close (&in_progress);
42
+ }
43
+
44
+ void zmq::decoder_t::set_inout (i_inout *destination_)
45
+ {
46
+ destination = destination_;
47
+ }
48
+
49
+ bool zmq::decoder_t::one_byte_size_ready ()
50
+ {
51
+ // First byte of size is read. If it is 0xff read 8-byte size.
52
+ // Otherwise allocate the buffer for message data and read the
53
+ // message data into it.
54
+ if (*tmpbuf == 0xff)
55
+ next_step (tmpbuf, 8, &decoder_t::eight_byte_size_ready);
56
+ else {
57
+
58
+ // There has to be at least one byte (the flags) in the message).
59
+ if (!*tmpbuf) {
60
+ decoding_error ();
61
+ return false;
62
+ }
63
+
64
+ // in_progress is initialised at this point so in theory we should
65
+ // close it before calling zmq_msg_init_size, however, it's a 0-byte
66
+ // message and thus we can treat it as uninitialised...
67
+ int rc = zmq_msg_init_size (&in_progress, *tmpbuf - 1);
68
+ if (rc != 0 && errno == ENOMEM) {
69
+ rc = zmq_msg_init (&in_progress);
70
+ errno_assert (rc == 0);
71
+ decoding_error ();
72
+ return false;
73
+ }
74
+ errno_assert (rc == 0);
75
+
76
+ next_step (tmpbuf, 1, &decoder_t::flags_ready);
77
+ }
78
+ return true;
79
+ }
80
+
81
+ bool zmq::decoder_t::eight_byte_size_ready ()
82
+ {
83
+ // 8-byte size is read. Allocate the buffer for message body and
84
+ // read the message data into it.
85
+ size_t size = (size_t) get_uint64 (tmpbuf);
86
+
87
+ // There has to be at least one byte (the flags) in the message).
88
+ if (!size) {
89
+ decoding_error ();
90
+ return false;
91
+ }
92
+
93
+ // in_progress is initialised at this point so in theory we should
94
+ // close it before calling zmq_msg_init_size, however, it's a 0-byte
95
+ // message and thus we can treat it as uninitialised...
96
+ int rc = zmq_msg_init_size (&in_progress, size - 1);
97
+ if (rc != 0 && errno == ENOMEM) {
98
+ rc = zmq_msg_init (&in_progress);
99
+ errno_assert (rc == 0);
100
+ decoding_error ();
101
+ return false;
102
+ }
103
+ errno_assert (rc == 0);
104
+
105
+ next_step (tmpbuf, 1, &decoder_t::flags_ready);
106
+ return true;
107
+ }
108
+
109
+ bool zmq::decoder_t::flags_ready ()
110
+ {
111
+ // Store the flags from the wire into the message structure.
112
+ in_progress.flags = tmpbuf [0] | ~ZMQ_MSG_MASK;
113
+
114
+ next_step (zmq_msg_data (&in_progress), zmq_msg_size (&in_progress),
115
+ &decoder_t::message_ready);
116
+
117
+ return true;
118
+ }
119
+
120
+ bool zmq::decoder_t::message_ready ()
121
+ {
122
+ // Message is completely read. Push it further and start reading
123
+ // new message. (in_progress is a 0-byte message after this point.)
124
+ if (!destination || !destination->write (&in_progress))
125
+ return false;
126
+
127
+ next_step (tmpbuf, 1, &decoder_t::one_byte_size_ready);
128
+ return true;
129
+ }
@@ -0,0 +1,207 @@
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_DECODER_HPP_INCLUDED__
22
+ #define __ZMQ_DECODER_HPP_INCLUDED__
23
+
24
+ #include <stddef.h>
25
+ #include <string.h>
26
+ #include <stdlib.h>
27
+ #include <algorithm>
28
+
29
+ #include "err.hpp"
30
+
31
+ #include "../include/zmq.h"
32
+
33
+ namespace zmq
34
+ {
35
+
36
+ // Helper base class for decoders that know the amount of data to read
37
+ // in advance at any moment. Knowing the amount in advance is a property
38
+ // of the protocol used. 0MQ framing protocol is based size-prefixed
39
+ // paradigm, whixh qualifies it to be parsed by this class.
40
+ // On the other hand, XML-based transports (like XMPP or SOAP) don't allow
41
+ // for knowing the size of data to read in advance and should use different
42
+ // decoding algorithms.
43
+ //
44
+ // This class implements the state machine that parses the incoming buffer.
45
+ // Derived class should implement individual state machine actions.
46
+
47
+ template <typename T> class decoder_base_t
48
+ {
49
+ public:
50
+
51
+ inline decoder_base_t (size_t bufsize_) :
52
+ read_pos (NULL),
53
+ to_read (0),
54
+ next (NULL),
55
+ bufsize (bufsize_)
56
+ {
57
+ buf = (unsigned char*) malloc (bufsize_);
58
+ alloc_assert (buf);
59
+ }
60
+
61
+ // The destructor doesn't have to be virtual. It is mad virtual
62
+ // just to keep ICC and code checking tools from complaining.
63
+ inline virtual ~decoder_base_t ()
64
+ {
65
+ free (buf);
66
+ }
67
+
68
+ // Returns a buffer to be filled with binary data.
69
+ inline void get_buffer (unsigned char **data_, size_t *size_)
70
+ {
71
+ // If we are expected to read large message, we'll opt for zero-
72
+ // copy, i.e. we'll ask caller to fill the data directly to the
73
+ // message. Note that subsequent read(s) are non-blocking, thus
74
+ // each single read reads at most SO_RCVBUF bytes at once not
75
+ // depending on how large is the chunk returned from here.
76
+ // As a consequence, large messages being received won't block
77
+ // other engines running in the same I/O thread for excessive
78
+ // amounts of time.
79
+ if (to_read >= bufsize) {
80
+ *data_ = read_pos;
81
+ *size_ = to_read;
82
+ return;
83
+ }
84
+
85
+ *data_ = buf;
86
+ *size_ = bufsize;
87
+ }
88
+
89
+ // Processes the data in the buffer previously allocated using
90
+ // get_buffer function. size_ argument specifies nemuber of bytes
91
+ // actually filled into the buffer. Function returns number of
92
+ // bytes actually processed.
93
+ inline size_t process_buffer (unsigned char *data_, size_t size_)
94
+ {
95
+ // Check if we had an error in previous attempt.
96
+ if (unlikely (!(static_cast <T*> (this)->next)))
97
+ return (size_t) -1;
98
+
99
+ // In case of zero-copy simply adjust the pointers, no copying
100
+ // is required. Also, run the state machine in case all the data
101
+ // were processed.
102
+ if (data_ == read_pos) {
103
+ read_pos += size_;
104
+ to_read -= size_;
105
+
106
+ while (!to_read) {
107
+ if (!(static_cast <T*> (this)->*next) ()) {
108
+ if (unlikely (!(static_cast <T*> (this)->next)))
109
+ return (size_t) -1;
110
+ return size_;
111
+ }
112
+ }
113
+ return size_;
114
+ }
115
+
116
+ size_t pos = 0;
117
+ while (true) {
118
+
119
+ // Try to get more space in the message to fill in.
120
+ // If none is available, return.
121
+ while (!to_read) {
122
+ if (!(static_cast <T*> (this)->*next) ()) {
123
+ if (unlikely (!(static_cast <T*> (this)->next)))
124
+ return (size_t) -1;
125
+ return pos;
126
+ }
127
+ }
128
+
129
+ // If there are no more data in the buffer, return.
130
+ if (pos == size_)
131
+ return pos;
132
+
133
+ // Copy the data from buffer to the message.
134
+ size_t to_copy = std::min (to_read, size_ - pos);
135
+ memcpy (read_pos, data_ + pos, to_copy);
136
+ read_pos += to_copy;
137
+ pos += to_copy;
138
+ to_read -= to_copy;
139
+ }
140
+ }
141
+
142
+ protected:
143
+
144
+ // Prototype of state machine action. Action should return false if
145
+ // it is unable to push the data to the system.
146
+ typedef bool (T::*step_t) ();
147
+
148
+ // This function should be called from derived class to read data
149
+ // from the buffer and schedule next state machine action.
150
+ inline void next_step (void *read_pos_, size_t to_read_,
151
+ step_t next_)
152
+ {
153
+ read_pos = (unsigned char*) read_pos_;
154
+ to_read = to_read_;
155
+ next = next_;
156
+ }
157
+
158
+ // This function should be called from the derived class to
159
+ // abort decoder state machine.
160
+ inline void decoding_error ()
161
+ {
162
+ next = NULL;
163
+ }
164
+
165
+ private:
166
+
167
+ unsigned char *read_pos;
168
+ size_t to_read;
169
+ step_t next;
170
+
171
+ size_t bufsize;
172
+ unsigned char *buf;
173
+
174
+ decoder_base_t (const decoder_base_t&);
175
+ const decoder_base_t &operator = (const decoder_base_t&);
176
+ };
177
+
178
+ // Decoder for 0MQ framing protocol. Converts data batches into messages.
179
+
180
+ class decoder_t : public decoder_base_t <decoder_t>
181
+ {
182
+ public:
183
+
184
+ decoder_t (size_t bufsize_);
185
+ ~decoder_t ();
186
+
187
+ void set_inout (struct i_inout *destination_);
188
+
189
+ private:
190
+
191
+ bool one_byte_size_ready ();
192
+ bool eight_byte_size_ready ();
193
+ bool flags_ready ();
194
+ bool message_ready ();
195
+
196
+ struct i_inout *destination;
197
+ unsigned char tmpbuf [8];
198
+ ::zmq_msg_t in_progress;
199
+
200
+ decoder_t (const decoder_t&);
201
+ void operator = (const decoder_t&);
202
+ };
203
+
204
+ }
205
+
206
+ #endif
207
+