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,78 @@
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_IO_OBJECT_HPP_INCLUDED__
22
+ #define __ZMQ_IO_OBJECT_HPP_INCLUDED__
23
+
24
+ #include <stddef.h>
25
+
26
+ #include "stdint.hpp"
27
+ #include "poller.hpp"
28
+ #include "i_poll_events.hpp"
29
+
30
+ namespace zmq
31
+ {
32
+
33
+ // Simple base class for objects that live in I/O threads.
34
+ // It makes communication with the poller object easier and
35
+ // makes defining unneeded event handlers unnecessary.
36
+
37
+ class io_object_t : public i_poll_events
38
+ {
39
+ public:
40
+
41
+ io_object_t (class io_thread_t *io_thread_ = NULL);
42
+ ~io_object_t ();
43
+
44
+ // When migrating an object from one I/O thread to another, first
45
+ // unplug it, then migrate it, then plug it to the new thread.
46
+ void plug (class io_thread_t *io_thread_);
47
+ void unplug ();
48
+
49
+ protected:
50
+
51
+ typedef poller_t::handle_t handle_t;
52
+
53
+ // Methods to access underlying poller object.
54
+ handle_t add_fd (fd_t fd_);
55
+ void rm_fd (handle_t handle_);
56
+ void set_pollin (handle_t handle_);
57
+ void reset_pollin (handle_t handle_);
58
+ void set_pollout (handle_t handle_);
59
+ void reset_pollout (handle_t handle_);
60
+ void add_timer (int timout_, int id_);
61
+ void cancel_timer (int id_);
62
+
63
+ // i_poll_events interface implementation.
64
+ void in_event ();
65
+ void out_event ();
66
+ void timer_event (int id_);
67
+
68
+ private:
69
+
70
+ poller_t *poller;
71
+
72
+ io_object_t (const io_object_t&);
73
+ const io_object_t &operator = (const io_object_t&);
74
+ };
75
+
76
+ }
77
+
78
+ #endif
@@ -0,0 +1,109 @@
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 <new>
22
+
23
+ #include "../include/zmq.h"
24
+
25
+ #include "io_thread.hpp"
26
+ #include "platform.hpp"
27
+ #include "err.hpp"
28
+ #include "ctx.hpp"
29
+
30
+ zmq::io_thread_t::io_thread_t (ctx_t *ctx_, uint32_t tid_) :
31
+ object_t (ctx_, tid_)
32
+ {
33
+ poller = new (std::nothrow) poller_t;
34
+ alloc_assert (poller);
35
+
36
+ mailbox_handle = poller->add_fd (mailbox.get_fd (), this);
37
+ poller->set_pollin (mailbox_handle);
38
+ }
39
+
40
+ zmq::io_thread_t::~io_thread_t ()
41
+ {
42
+ delete poller;
43
+ }
44
+
45
+ void zmq::io_thread_t::start ()
46
+ {
47
+ // Start the underlying I/O thread.
48
+ poller->start ();
49
+ }
50
+
51
+ void zmq::io_thread_t::stop ()
52
+ {
53
+ send_stop ();
54
+ }
55
+
56
+ zmq::mailbox_t *zmq::io_thread_t::get_mailbox ()
57
+ {
58
+ return &mailbox;
59
+ }
60
+
61
+ int zmq::io_thread_t::get_load ()
62
+ {
63
+ return poller->get_load ();
64
+ }
65
+
66
+ void zmq::io_thread_t::in_event ()
67
+ {
68
+ // TODO: Do we want to limit number of commands I/O thread can
69
+ // process in a single go?
70
+
71
+ while (true) {
72
+
73
+ // Get the next command. If there is none, exit.
74
+ command_t cmd;
75
+ int rc = mailbox.recv (&cmd, false);
76
+ if (rc != 0 && errno == EINTR)
77
+ continue;
78
+ if (rc != 0 && errno == EAGAIN)
79
+ break;
80
+ errno_assert (rc == 0);
81
+
82
+ // Process the command.
83
+ cmd.destination->process_command (cmd);
84
+ }
85
+ }
86
+
87
+ void zmq::io_thread_t::out_event ()
88
+ {
89
+ // We are never polling for POLLOUT here. This function is never called.
90
+ zmq_assert (false);
91
+ }
92
+
93
+ void zmq::io_thread_t::timer_event (int id_)
94
+ {
95
+ // No timers here. This function is never called.
96
+ zmq_assert (false);
97
+ }
98
+
99
+ zmq::poller_t *zmq::io_thread_t::get_poller ()
100
+ {
101
+ zmq_assert (poller);
102
+ return poller;
103
+ }
104
+
105
+ void zmq::io_thread_t::process_stop ()
106
+ {
107
+ poller->rm_fd (mailbox_handle);
108
+ poller->stop ();
109
+ }
@@ -0,0 +1,88 @@
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_IO_THREAD_HPP_INCLUDED__
22
+ #define __ZMQ_IO_THREAD_HPP_INCLUDED__
23
+
24
+ #include <vector>
25
+
26
+ #include "stdint.hpp"
27
+ #include "object.hpp"
28
+ #include "poller.hpp"
29
+ #include "i_poll_events.hpp"
30
+ #include "mailbox.hpp"
31
+
32
+ namespace zmq
33
+ {
34
+
35
+ // Generic part of the I/O thread. Polling-mechanism-specific features
36
+ // are implemented in separate "polling objects".
37
+
38
+ class io_thread_t : public object_t, public i_poll_events
39
+ {
40
+ public:
41
+
42
+ io_thread_t (class ctx_t *ctx_, uint32_t tid_);
43
+
44
+ // Clean-up. If the thread was started, it's neccessary to call 'stop'
45
+ // before invoking destructor. Otherwise the destructor would hang up.
46
+ ~io_thread_t ();
47
+
48
+ // Launch the physical thread.
49
+ void start ();
50
+
51
+ // Ask underlying thread to stop.
52
+ void stop ();
53
+
54
+ // Returns mailbox associated with this I/O thread.
55
+ mailbox_t *get_mailbox ();
56
+
57
+ // i_poll_events implementation.
58
+ void in_event ();
59
+ void out_event ();
60
+ void timer_event (int id_);
61
+
62
+ // Used by io_objects to retrieve the assciated poller object.
63
+ poller_t *get_poller ();
64
+
65
+ // Command handlers.
66
+ void process_stop ();
67
+
68
+ // Returns load experienced by the I/O thread.
69
+ int get_load ();
70
+
71
+ private:
72
+
73
+ // I/O thread accesses incoming commands via this mailbox.
74
+ mailbox_t mailbox;
75
+
76
+ // Handle associated with mailbox' file descriptor.
77
+ poller_t::handle_t mailbox_handle;
78
+
79
+ // I/O multiplexing is performed using a poller object.
80
+ poller_t *poller;
81
+
82
+ io_thread_t (const io_thread_t&);
83
+ const io_thread_t &operator = (const io_thread_t&);
84
+ };
85
+
86
+ }
87
+
88
+ #endif
@@ -0,0 +1,339 @@
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
+ #include <stdlib.h>
24
+ #include <string>
25
+
26
+ #include "../include/zmq.h"
27
+
28
+ #include "ip.hpp"
29
+ #include "platform.hpp"
30
+ #include "err.hpp"
31
+ #include "stdint.hpp"
32
+
33
+ #if defined ZMQ_HAVE_SOLARIS
34
+
35
+ #include <sys/sockio.h>
36
+ #include <net/if.h>
37
+ #include <unistd.h>
38
+
39
+ // On Solaris platform, network interface name can be queried by ioctl.
40
+ static int resolve_nic_name (in_addr* addr_, char const *interface_)
41
+ {
42
+ // Create a socket.
43
+ int fd = socket (AF_INET, SOCK_DGRAM, 0);
44
+ zmq_assert (fd != -1);
45
+
46
+ // Retrieve number of interfaces.
47
+ lifnum ifn;
48
+ ifn.lifn_family = AF_UNSPEC;
49
+ ifn.lifn_flags = 0;
50
+ int rc = ioctl (fd, SIOCGLIFNUM, (char*) &ifn);
51
+ zmq_assert (rc != -1);
52
+
53
+ // Allocate memory to get interface names.
54
+ size_t ifr_size = sizeof (struct lifreq) * ifn.lifn_count;
55
+ char *ifr = (char*) malloc (ifr_size);
56
+ alloc_assert (ifr);
57
+
58
+ // Retrieve interface names.
59
+ lifconf ifc;
60
+ ifc.lifc_family = AF_UNSPEC;
61
+ ifc.lifc_flags = 0;
62
+ ifc.lifc_len = ifr_size;
63
+ ifc.lifc_buf = ifr;
64
+ rc = ioctl (fd, SIOCGLIFCONF, (char*) &ifc);
65
+ zmq_assert (rc != -1);
66
+
67
+ // Find the interface with the specified name and AF_INET family.
68
+ bool found = false;
69
+ lifreq *ifrp = ifc.lifc_req;
70
+ for (int n = 0; n < (int) (ifc.lifc_len / sizeof (lifreq));
71
+ n ++, ifrp ++) {
72
+ if (!strcmp (interface_, ifrp->lifr_name)) {
73
+ rc = ioctl (fd, SIOCGLIFADDR, (char*) ifrp);
74
+ zmq_assert (rc != -1);
75
+ if (ifrp->lifr_addr.ss_family == AF_INET) {
76
+ *addr_ = ((sockaddr_in*) &ifrp->lifr_addr)->sin_addr;
77
+ found = true;
78
+ break;
79
+ }
80
+ }
81
+ }
82
+
83
+ // Clean-up.
84
+ free (ifr);
85
+ close (fd);
86
+
87
+ if (!found) {
88
+ errno = ENODEV;
89
+ return -1;
90
+ }
91
+
92
+ return 0;
93
+ }
94
+
95
+ #elif defined ZMQ_HAVE_AIX || ZMQ_HAVE_HPUX
96
+
97
+ #include <sys/types.h>
98
+ #include <unistd.h>
99
+ #include <sys/ioctl.h>
100
+ #include <net/if.h>
101
+
102
+ static int resolve_nic_name (in_addr* addr_, char const *interface_)
103
+ {
104
+ // Create a socket.
105
+ int sd = socket (AF_INET, SOCK_DGRAM, 0);
106
+ zmq_assert (sd != -1);
107
+
108
+ struct ifreq ifr;
109
+
110
+ // Copy interface name for ioctl get.
111
+ strncpy (ifr.ifr_name, interface_, sizeof (ifr.ifr_name));
112
+
113
+ // Fetch interface address.
114
+ int rc = ioctl (sd, SIOCGIFADDR, (caddr_t) &ifr, sizeof (struct ifreq));
115
+
116
+ // Clean up.
117
+ close (sd);
118
+
119
+ if (rc == -1) {
120
+ errno = ENODEV;
121
+ return -1;
122
+ }
123
+
124
+ struct sockaddr *sa = (struct sockaddr *) &ifr.ifr_addr;
125
+ *addr_ = ((sockaddr_in*)sa)->sin_addr;
126
+ return 0;
127
+ }
128
+
129
+ #elif ((defined ZMQ_HAVE_LINUX || defined ZMQ_HAVE_FREEBSD ||\
130
+ defined ZMQ_HAVE_OSX || defined ZMQ_HAVE_OPENBSD ||\
131
+ defined ZMQ_HAVE_QNXNTO || defined ZMQ_HAVE_NETBSD)\
132
+ && defined ZMQ_HAVE_IFADDRS)
133
+
134
+ #include <ifaddrs.h>
135
+
136
+ // On these platforms, network interface name can be queried
137
+ // using getifaddrs function.
138
+ static int resolve_nic_name (in_addr* addr_, char const *interface_)
139
+ {
140
+ // Get the addresses.
141
+ ifaddrs* ifa = NULL;
142
+ int rc = getifaddrs (&ifa);
143
+ zmq_assert (rc == 0);
144
+ zmq_assert (ifa != NULL);
145
+
146
+ // Find the corresponding network interface.
147
+ bool found = false;
148
+ for (ifaddrs *ifp = ifa; ifp != NULL ;ifp = ifp->ifa_next)
149
+ if (ifp->ifa_addr && ifp->ifa_addr->sa_family == AF_INET
150
+ && !strcmp (interface_, ifp->ifa_name))
151
+ {
152
+ *addr_ = ((sockaddr_in*) ifp->ifa_addr)->sin_addr;
153
+ found = true;
154
+ break;
155
+ }
156
+
157
+ // Clean-up;
158
+ freeifaddrs (ifa);
159
+
160
+ if (!found) {
161
+ errno = ENODEV;
162
+ return -1;
163
+ }
164
+
165
+ return 0;
166
+ }
167
+
168
+ #else
169
+
170
+ // On other platforms we assume there are no sane interface names.
171
+ // This is true especially of Windows.
172
+ static int resolve_nic_name (in_addr* addr_, char const *interface_)
173
+ {
174
+ errno = ENODEV;
175
+ return -1;
176
+ }
177
+
178
+ #endif
179
+
180
+ int zmq::resolve_ip_interface (sockaddr_storage* addr_, socklen_t *addr_len_,
181
+ char const *interface_)
182
+ {
183
+ // Find the ':' at end that separates NIC name from service.
184
+ const char *delimiter = strrchr (interface_, ':');
185
+ if (!delimiter) {
186
+ errno = EINVAL;
187
+ return -1;
188
+ }
189
+
190
+ // Separate the name/port.
191
+ std::string iface (interface_, delimiter - interface_);
192
+ std::string service (delimiter + 1);
193
+
194
+ // Initialize the output parameter.
195
+ memset (addr_, 0, sizeof (*addr_));
196
+
197
+ // Initialise IPv4-format family/port.
198
+ sockaddr_in ip4_addr;
199
+ memset (&ip4_addr, 0, sizeof (ip4_addr));
200
+ ip4_addr.sin_family = AF_INET;
201
+ ip4_addr.sin_port = htons ((uint16_t) atoi (service.c_str()));
202
+
203
+ // Initialize temporary output pointers with ip4_addr
204
+ sockaddr *out_addr = (sockaddr *) &ip4_addr;
205
+ size_t out_addrlen = sizeof (ip4_addr);
206
+
207
+ // 0 is not a valid port.
208
+ if (!ip4_addr.sin_port) {
209
+ errno = EINVAL;
210
+ return -1;
211
+ }
212
+
213
+ // * resolves to INADDR_ANY.
214
+ if (iface.compare("*") == 0) {
215
+ ip4_addr.sin_addr.s_addr = htonl (INADDR_ANY);
216
+ zmq_assert (out_addrlen <= sizeof (*addr_));
217
+ memcpy (addr_, out_addr, out_addrlen);
218
+ *addr_len_ = out_addrlen;
219
+ return 0;
220
+ }
221
+
222
+ // Try to resolve the string as a NIC name.
223
+ int rc = resolve_nic_name (&ip4_addr.sin_addr, iface.c_str());
224
+ if (rc != 0 && errno != ENODEV)
225
+ return rc;
226
+ if (rc == 0) {
227
+ zmq_assert (out_addrlen <= sizeof (*addr_));
228
+ memcpy (addr_, out_addr, out_addrlen);
229
+ *addr_len_ = out_addrlen;
230
+ return 0;
231
+ }
232
+
233
+ // There's no such interface name. Assume literal address.
234
+ #if defined ZMQ_HAVE_OPENVMS && defined __ia64
235
+ __addrinfo64 *res = NULL;
236
+ __addrinfo64 req;
237
+ #else
238
+ addrinfo *res = NULL;
239
+ addrinfo req;
240
+ #endif
241
+ memset (&req, 0, sizeof (req));
242
+
243
+ // We only support IPv4 addresses for now.
244
+ req.ai_family = AF_INET;
245
+
246
+ // Arbitrary, not used in the output, but avoids duplicate results.
247
+ req.ai_socktype = SOCK_STREAM;
248
+
249
+ // Restrict hostname/service to literals to avoid any DNS lookups or
250
+ // service-name irregularity due to indeterminate socktype.
251
+ req.ai_flags = AI_PASSIVE | AI_NUMERICHOST | AI_NUMERICSERV;
252
+
253
+ // Resolve the literal address. Some of the error info is lost in case
254
+ // of error, however, there's no way to report EAI errors via errno.
255
+ rc = getaddrinfo (iface.c_str(), service.c_str(), &req, &res);
256
+ if (rc) {
257
+ errno = ENODEV;
258
+ return -1;
259
+ }
260
+
261
+ // Use the first result.
262
+ zmq_assert ((size_t) (res->ai_addrlen) <= sizeof (*addr_));
263
+ memcpy (addr_, res->ai_addr, res->ai_addrlen);
264
+ *addr_len_ = res->ai_addrlen;
265
+
266
+ // Cleanup getaddrinfo after copying the possibly referenced result.
267
+ if (res)
268
+ freeaddrinfo (res);
269
+
270
+ return 0;
271
+ }
272
+
273
+ int zmq::resolve_ip_hostname (sockaddr_storage *addr_, socklen_t *addr_len_,
274
+ const char *hostname_)
275
+ {
276
+ // Find the ':' that separates hostname name from service.
277
+ const char *delimiter = strchr (hostname_, ':');
278
+ if (!delimiter) {
279
+ errno = EINVAL;
280
+ return -1;
281
+ }
282
+
283
+ // Separate the hostname and service.
284
+ std::string hostname (hostname_, delimiter - hostname_);
285
+ std::string service (delimiter + 1);
286
+
287
+ // Set up the query.
288
+ addrinfo req;
289
+ memset (&req, 0, sizeof (req));
290
+
291
+ // We only support IPv4 addresses for now.
292
+ req.ai_family = AF_INET;
293
+
294
+ // Need to choose one to avoid duplicate results from getaddrinfo() - this
295
+ // doesn't really matter, since it's not included in the addr-output.
296
+ req.ai_socktype = SOCK_STREAM;
297
+
298
+ // Avoid named services due to unclear socktype.
299
+ req.ai_flags = AI_NUMERICSERV;
300
+
301
+ // Resolve host name. Some of the error info is lost in case of error,
302
+ // however, there's no way to report EAI errors via errno.
303
+ addrinfo *res;
304
+ int rc = getaddrinfo (hostname.c_str (), service.c_str (), &req, &res);
305
+ if (rc) {
306
+ errno = EINVAL;
307
+ return -1;
308
+ }
309
+
310
+ // Copy first result to output addr with hostname and service.
311
+ zmq_assert ((size_t) (res->ai_addrlen) <= sizeof (*addr_));
312
+ memcpy (addr_, res->ai_addr, res->ai_addrlen);
313
+ *addr_len_ = res->ai_addrlen;
314
+
315
+ freeaddrinfo (res);
316
+
317
+ return 0;
318
+ }
319
+
320
+ int zmq::resolve_local_path (sockaddr_storage *addr_, socklen_t *addr_len_,
321
+ const char *path_)
322
+ {
323
+ #if defined ZMQ_HAVE_WINDOWS || defined ZMQ_HAVE_OPENVMS
324
+ errno = EPROTONOSUPPORT;
325
+ return -1;
326
+ #else
327
+ sockaddr_un *un = (sockaddr_un*) addr_;
328
+ if (strlen (path_) >= sizeof (un->sun_path))
329
+ {
330
+ errno = ENAMETOOLONG;
331
+ return -1;
332
+ }
333
+ strcpy (un->sun_path, path_);
334
+ un->sun_family = AF_UNIX;
335
+ *addr_len_ = sizeof (sockaddr_un);
336
+ return 0;
337
+ #endif
338
+ }
339
+