rbczmq 1.7.1 → 1.7.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (437) hide show
  1. checksums.yaml +8 -8
  2. data/.gitmodules +1 -1
  3. data/CHANGELOG.rdoc +4 -0
  4. data/Gemfile.lock +1 -1
  5. data/README.rdoc +5 -4
  6. data/ext/czmq/.gitignore +5 -0
  7. data/ext/czmq/.travis.yml +10 -1
  8. data/ext/czmq/AUTHORS +2 -0
  9. data/ext/czmq/COPYING.LESSER +3 -0
  10. data/ext/czmq/Makefile.am +13 -3
  11. data/ext/czmq/NEWS +132 -0
  12. data/ext/czmq/README.md +1553 -615
  13. data/ext/czmq/README.txt +188 -72
  14. data/ext/czmq/addons/Makefile.am +9 -0
  15. data/ext/czmq/addons/makecert.c +72 -0
  16. data/ext/czmq/builds/mingw32/Makefile.mingw32 +11 -3
  17. data/ext/czmq/builds/msvc/.gitignore +4 -1
  18. data/ext/czmq/builds/msvc/czmq.vcproj +4 -0
  19. data/ext/czmq/builds/msvc/czmq.vcxproj +6 -1
  20. data/ext/czmq/builds/msvc/czmq.vcxproj.filters +4 -1
  21. data/ext/{zeromq/cmake/Modules/zmq_version.cpp → czmq/builds/msvc/platform.h} +10 -9
  22. data/ext/czmq/configure.ac +64 -5
  23. data/ext/czmq/doc/Makefile.am +8 -1
  24. data/ext/czmq/doc/mkmans +17 -0
  25. data/ext/czmq/doc/zauth.txt +191 -0
  26. data/ext/czmq/doc/zbeacon.txt +13 -22
  27. data/ext/czmq/doc/zcert.txt +122 -0
  28. data/ext/czmq/doc/zcertstore.txt +107 -0
  29. data/ext/czmq/doc/zchunk.txt +77 -0
  30. data/ext/czmq/doc/zclock.txt +8 -0
  31. data/ext/czmq/doc/zconfig.txt +9 -63
  32. data/ext/czmq/doc/zctx.txt +26 -7
  33. data/ext/czmq/doc/zdir.txt +83 -0
  34. data/ext/czmq/doc/zfile.txt +130 -35
  35. data/ext/czmq/doc/zframe.txt +6 -39
  36. data/ext/czmq/doc/zhash.txt +55 -10
  37. data/ext/czmq/doc/zlist.txt +2 -4
  38. data/ext/czmq/doc/zloop.txt +7 -1
  39. data/ext/czmq/doc/zmsg.txt +75 -32
  40. data/ext/czmq/doc/zpoller.txt +88 -0
  41. data/ext/czmq/doc/zsocket.txt +50 -1
  42. data/ext/czmq/doc/zsockopt.txt +185 -251
  43. data/ext/czmq/doc/zstr.txt +14 -3
  44. data/ext/czmq/doc/zsys.txt +89 -1
  45. data/ext/czmq/doc/ztree.txt +21 -11
  46. data/ext/czmq/examples/security/LICENSE +18 -0
  47. data/ext/czmq/examples/security/README.txt +9 -0
  48. data/ext/czmq/examples/security/grasslands.c +29 -0
  49. data/ext/czmq/examples/security/hello.c +10 -0
  50. data/ext/czmq/examples/security/ironhouse.c +55 -0
  51. data/ext/czmq/examples/security/ironhouse2.c +103 -0
  52. data/ext/czmq/examples/security/stonehouse.c +51 -0
  53. data/ext/czmq/examples/security/strawhouse.c +44 -0
  54. data/ext/czmq/examples/security/woodhouse.c +40 -0
  55. data/ext/czmq/images/README_1.png +0 -0
  56. data/ext/czmq/images/README_2.png +0 -0
  57. data/ext/czmq/include/czmq.h +10 -4
  58. data/ext/czmq/include/czmq_prelude.h +42 -42
  59. data/ext/czmq/include/zauth.h +97 -0
  60. data/ext/czmq/include/zbeacon.h +0 -5
  61. data/ext/czmq/include/zcert.h +118 -0
  62. data/ext/czmq/include/zcertstore.h +78 -0
  63. data/ext/czmq/include/zchunk.h +87 -0
  64. data/ext/czmq/include/zclock.h +4 -0
  65. data/ext/czmq/include/zconfig.h +21 -12
  66. data/ext/czmq/include/zctx.h +34 -11
  67. data/ext/czmq/include/zdir.h +90 -0
  68. data/ext/czmq/include/zfile.h +104 -25
  69. data/ext/czmq/include/zframe.h +7 -20
  70. data/ext/czmq/include/zhash.h +13 -0
  71. data/ext/czmq/include/zlist.h +0 -4
  72. data/ext/czmq/include/zloop.h +5 -5
  73. data/ext/czmq/include/zmsg.h +59 -29
  74. data/ext/czmq/include/zmutex.h +5 -0
  75. data/ext/czmq/include/zpoller.h +72 -0
  76. data/ext/czmq/include/zsocket.h +12 -15
  77. data/ext/czmq/include/zsockopt.h +124 -121
  78. data/ext/czmq/include/zstr.h +12 -9
  79. data/ext/czmq/include/zsys.h +50 -2
  80. data/ext/czmq/mkdoc +1 -1
  81. data/ext/czmq/model/sockopts.xml +101 -21
  82. data/ext/czmq/scripts/sockopts.gsl +95 -41
  83. data/ext/czmq/src/Makefile.am +13 -0
  84. data/ext/czmq/src/czmq_selftest.c +16 -10
  85. data/ext/czmq/src/selftest +2 -2
  86. data/ext/czmq/src/zauth.c +714 -0
  87. data/ext/czmq/src/zbeacon.c +27 -35
  88. data/ext/czmq/src/zcert.c +463 -0
  89. data/ext/czmq/src/zcertstore.c +265 -0
  90. data/ext/czmq/src/zchunk.c +207 -0
  91. data/ext/czmq/src/zclock.c +18 -0
  92. data/ext/czmq/src/zconfig.c +116 -99
  93. data/ext/czmq/src/zctx.c +103 -18
  94. data/ext/czmq/src/zdir.c +409 -0
  95. data/ext/czmq/src/zfile.c +421 -130
  96. data/ext/czmq/src/zframe.c +28 -127
  97. data/ext/czmq/src/zhash.c +255 -139
  98. data/ext/czmq/src/zlist.c +2 -8
  99. data/ext/czmq/src/zloop.c +40 -13
  100. data/ext/czmq/src/zmsg.c +109 -141
  101. data/ext/czmq/src/zmutex.c +27 -1
  102. data/ext/czmq/src/zpoller.c +218 -0
  103. data/ext/czmq/src/zsocket.c +53 -66
  104. data/ext/czmq/src/zsockopt.c +2337 -682
  105. data/ext/czmq/src/zstr.c +48 -118
  106. data/ext/czmq/src/zsys.c +270 -3
  107. data/ext/czmq/src/zthread.c +2 -2
  108. data/ext/czmq/src/ztree.c +179 -180
  109. data/ext/rbczmq/beacon.c +1 -1
  110. data/ext/rbczmq/context.c +12 -3
  111. data/ext/rbczmq/context.h +7 -0
  112. data/ext/rbczmq/extconf.rb +13 -4
  113. data/ext/rbczmq/pollitem.c +1 -1
  114. data/ext/rbczmq/socket.c +34 -24
  115. data/ext/rbczmq/socket.h +3 -2
  116. data/ext/zeromq/AUTHORS +17 -3
  117. data/ext/zeromq/CMakeLists.txt +742 -339
  118. data/ext/zeromq/COPYING.LESSER +2 -0
  119. data/ext/zeromq/Makefile.am +3 -3
  120. data/ext/zeromq/NEWS +130 -1
  121. data/ext/zeromq/{README → README.md} +8 -9
  122. data/ext/zeromq/builds/cmake/Modules/FindAsciiDoc.cmake +24 -0
  123. data/ext/zeromq/builds/cmake/Modules/TestZMQVersion.cmake +18 -0
  124. data/ext/zeromq/builds/cmake/Modules/ZMQSourceRunChecks.cmake +129 -0
  125. data/ext/zeromq/{cmake → builds/cmake}/NSIS.template32.in +1 -1
  126. data/ext/zeromq/{cmake → builds/cmake}/NSIS.template64.in +1 -1
  127. data/ext/zeromq/builds/cmake/platform.hpp.in +88 -0
  128. data/ext/zeromq/builds/mingw32/Makefile.mingw32 +47 -0
  129. data/ext/zeromq/{src/i_msg_sink.hpp → builds/mingw32/platform.hpp} +10 -21
  130. data/ext/zeromq/builds/msvc/Makefile.am +5 -2
  131. data/ext/zeromq/builds/msvc/c_local_lat/c_local_lat.vcxproj +1 -1
  132. data/ext/zeromq/builds/msvc/c_local_lat/c_local_lat11.vcxproj +91 -0
  133. data/ext/zeromq/builds/msvc/c_local_thr/c_local_thr.vcproj +2 -0
  134. data/ext/zeromq/builds/msvc/c_local_thr/c_local_thr.vcxproj +21 -1
  135. data/ext/zeromq/builds/msvc/c_local_thr/c_local_thr11.vcxproj +111 -0
  136. data/ext/zeromq/builds/msvc/c_remote_lat/c_remote_lat.vcxproj +1 -1
  137. data/ext/zeromq/builds/msvc/c_remote_lat/c_remote_lat11.vcxproj +91 -0
  138. data/ext/zeromq/builds/msvc/c_remote_thr/c_remote_thr.vcproj +2 -0
  139. data/ext/zeromq/builds/msvc/c_remote_thr/c_remote_thr.vcxproj +21 -1
  140. data/ext/zeromq/builds/msvc/c_remote_thr/c_remote_thr11.vcxproj +111 -0
  141. data/ext/zeromq/builds/msvc/errno.cpp +1 -1
  142. data/ext/zeromq/builds/msvc/errno.hpp +1 -1
  143. data/ext/zeromq/builds/msvc/inproc_lat/inproc_lat.vcproj +176 -174
  144. data/ext/zeromq/builds/msvc/inproc_lat/inproc_lat.vcxproj +21 -1
  145. data/ext/zeromq/builds/msvc/inproc_lat/inproc_lat11.vcxproj +110 -0
  146. data/ext/zeromq/builds/msvc/inproc_thr/inproc_thr.vcproj +176 -174
  147. data/ext/zeromq/builds/msvc/inproc_thr/inproc_thr.vcxproj +21 -1
  148. data/ext/zeromq/builds/msvc/inproc_thr/inproc_thr11.vcxproj +110 -0
  149. data/ext/zeromq/builds/msvc/libzmq/libzmq.vcproj +997 -804
  150. data/ext/zeromq/builds/msvc/libzmq/libzmq.vcxproj +78 -2
  151. data/ext/zeromq/builds/msvc/libzmq/libzmq.vcxproj.filters +42 -6
  152. data/ext/zeromq/builds/msvc/libzmq/libzmq11.vcxproj +362 -0
  153. data/ext/zeromq/builds/msvc/msvc.sln +6 -0
  154. data/ext/zeromq/builds/msvc/msvc10.sln +36 -2
  155. data/ext/zeromq/builds/msvc/msvc11.sln +150 -0
  156. data/ext/zeromq/builds/msvc/properties/Static.props +15 -0
  157. data/ext/zeromq/builds/msvc/properties/ZeroMQ.props +0 -1
  158. data/ext/zeromq/builds/msvc/properties/ZeroMQ_Static.props +23 -0
  159. data/ext/zeromq/builds/redhat/zeromq.spec.in +2 -1
  160. data/ext/zeromq/{configure.in → configure.ac} +74 -15
  161. data/ext/zeromq/doc/Makefile.am +6 -4
  162. data/ext/zeromq/doc/zmq.txt +30 -3
  163. data/ext/zeromq/doc/zmq_bind.txt +2 -2
  164. data/ext/zeromq/doc/zmq_close.txt +2 -2
  165. data/ext/zeromq/doc/zmq_connect.txt +9 -7
  166. data/ext/zeromq/doc/zmq_ctx_destroy.txt +4 -3
  167. data/ext/zeromq/doc/zmq_ctx_get.txt +8 -3
  168. data/ext/zeromq/doc/zmq_ctx_new.txt +3 -2
  169. data/ext/zeromq/doc/zmq_ctx_set.txt +13 -1
  170. data/ext/zeromq/doc/zmq_ctx_shutdown.txt +52 -0
  171. data/ext/zeromq/doc/zmq_ctx_term.txt +67 -0
  172. data/ext/zeromq/doc/zmq_curve.txt +92 -0
  173. data/ext/zeromq/doc/zmq_curve_keypair.txt +56 -0
  174. data/ext/zeromq/doc/zmq_disconnect.txt +2 -2
  175. data/ext/zeromq/doc/zmq_epgm.txt +5 -4
  176. data/ext/zeromq/doc/zmq_errno.txt +2 -2
  177. data/ext/zeromq/doc/zmq_getsockopt.txt +149 -24
  178. data/ext/zeromq/doc/zmq_init.txt +2 -2
  179. data/ext/zeromq/doc/zmq_inproc.txt +2 -2
  180. data/ext/zeromq/doc/zmq_ipc.txt +10 -5
  181. data/ext/zeromq/doc/zmq_msg_close.txt +4 -3
  182. data/ext/zeromq/doc/zmq_msg_copy.txt +2 -2
  183. data/ext/zeromq/doc/zmq_msg_data.txt +2 -2
  184. data/ext/zeromq/doc/zmq_msg_get.txt +3 -3
  185. data/ext/zeromq/doc/zmq_msg_init.txt +2 -2
  186. data/ext/zeromq/doc/zmq_msg_init_data.txt +2 -2
  187. data/ext/zeromq/doc/zmq_msg_init_size.txt +2 -2
  188. data/ext/zeromq/doc/zmq_msg_more.txt +6 -4
  189. data/ext/zeromq/doc/zmq_msg_move.txt +2 -2
  190. data/ext/zeromq/doc/zmq_msg_recv.txt +3 -4
  191. data/ext/zeromq/doc/zmq_msg_send.txt +10 -7
  192. data/ext/zeromq/doc/zmq_msg_set.txt +2 -1
  193. data/ext/zeromq/doc/zmq_msg_size.txt +2 -2
  194. data/ext/zeromq/doc/zmq_null.txt +27 -0
  195. data/ext/zeromq/doc/zmq_pgm.txt +5 -4
  196. data/ext/zeromq/doc/zmq_plain.txt +37 -0
  197. data/ext/zeromq/doc/zmq_poll.txt +2 -6
  198. data/ext/zeromq/doc/zmq_proxy.txt +2 -1
  199. data/ext/zeromq/doc/zmq_recv.txt +2 -5
  200. data/ext/zeromq/doc/zmq_recvmsg.txt +3 -5
  201. data/ext/zeromq/doc/zmq_send.txt +9 -7
  202. data/ext/zeromq/doc/zmq_send_const.txt +103 -0
  203. data/ext/zeromq/doc/zmq_sendmsg.txt +8 -8
  204. data/ext/zeromq/doc/zmq_setsockopt.txt +291 -37
  205. data/ext/zeromq/doc/zmq_socket.txt +92 -21
  206. data/ext/zeromq/doc/zmq_socket_monitor.txt +102 -131
  207. data/ext/zeromq/doc/zmq_strerror.txt +3 -2
  208. data/ext/zeromq/doc/zmq_tcp.txt +4 -2
  209. data/ext/zeromq/doc/zmq_term.txt +3 -3
  210. data/ext/zeromq/doc/zmq_unbind.txt +2 -2
  211. data/ext/zeromq/doc/zmq_version.txt +3 -2
  212. data/ext/zeromq/doc/zmq_z85_decode.txt +50 -0
  213. data/ext/zeromq/doc/zmq_z85_encode.txt +57 -0
  214. data/ext/zeromq/foreign/openpgm/libpgm-5.2.122~dfsg.tar.gz +0 -0
  215. data/ext/zeromq/include/zmq.h +179 -136
  216. data/ext/zeromq/include/zmq_utils.h +44 -3
  217. data/ext/zeromq/perf/inproc_lat.cpp +2 -4
  218. data/ext/zeromq/perf/inproc_thr.cpp +1 -1
  219. data/ext/zeromq/perf/local_lat.cpp +1 -3
  220. data/ext/zeromq/perf/local_thr.cpp +1 -3
  221. data/ext/zeromq/perf/remote_lat.cpp +1 -3
  222. data/ext/zeromq/perf/remote_thr.cpp +1 -8
  223. data/ext/zeromq/src/Makefile.am +26 -7
  224. data/ext/zeromq/src/address.cpp +7 -8
  225. data/ext/zeromq/src/address.hpp +1 -2
  226. data/ext/zeromq/src/array.hpp +1 -3
  227. data/ext/zeromq/src/atomic_counter.hpp +11 -3
  228. data/ext/zeromq/src/atomic_ptr.hpp +9 -3
  229. data/ext/zeromq/src/blob.hpp +2 -2
  230. data/ext/zeromq/src/clock.cpp +3 -4
  231. data/ext/zeromq/src/clock.hpp +1 -2
  232. data/ext/zeromq/src/command.hpp +2 -3
  233. data/ext/zeromq/src/config.hpp +1 -3
  234. data/ext/zeromq/src/ctx.cpp +154 -15
  235. data/ext/zeromq/src/ctx.hpp +34 -3
  236. data/ext/zeromq/src/curve_client.cpp +410 -0
  237. data/ext/zeromq/src/curve_client.hpp +109 -0
  238. data/ext/zeromq/src/curve_server.cpp +629 -0
  239. data/ext/zeromq/src/curve_server.hpp +120 -0
  240. data/ext/zeromq/src/dbuffer.hpp +134 -0
  241. data/ext/zeromq/src/dealer.cpp +52 -60
  242. data/ext/zeromq/src/dealer.hpp +12 -26
  243. data/ext/zeromq/src/decoder.hpp +27 -102
  244. data/ext/zeromq/src/devpoll.cpp +1 -3
  245. data/ext/zeromq/src/devpoll.hpp +1 -3
  246. data/ext/zeromq/src/dist.cpp +17 -15
  247. data/ext/zeromq/src/dist.hpp +5 -6
  248. data/ext/zeromq/src/encoder.hpp +32 -52
  249. data/ext/zeromq/src/epoll.cpp +1 -3
  250. data/ext/zeromq/src/epoll.hpp +1 -3
  251. data/ext/zeromq/src/err.cpp +2 -4
  252. data/ext/zeromq/src/err.hpp +7 -4
  253. data/ext/zeromq/src/fd.hpp +1 -2
  254. data/ext/zeromq/src/fq.cpp +2 -5
  255. data/ext/zeromq/src/fq.hpp +2 -4
  256. data/ext/zeromq/src/i_decoder.hpp +11 -9
  257. data/ext/zeromq/src/i_encoder.hpp +7 -11
  258. data/ext/zeromq/src/i_engine.hpp +3 -3
  259. data/ext/zeromq/src/i_poll_events.hpp +1 -3
  260. data/ext/zeromq/src/io_object.cpp +1 -3
  261. data/ext/zeromq/src/io_object.hpp +1 -3
  262. data/ext/zeromq/src/io_thread.cpp +1 -3
  263. data/ext/zeromq/src/io_thread.hpp +1 -3
  264. data/ext/zeromq/src/ip.cpp +46 -5
  265. data/ext/zeromq/src/ip.hpp +7 -4
  266. data/ext/zeromq/src/ipc_address.cpp +13 -2
  267. data/ext/zeromq/src/ipc_address.hpp +1 -2
  268. data/ext/zeromq/src/ipc_connecter.cpp +3 -3
  269. data/ext/zeromq/src/ipc_connecter.hpp +1 -2
  270. data/ext/zeromq/src/ipc_listener.cpp +15 -10
  271. data/ext/zeromq/src/ipc_listener.hpp +1 -2
  272. data/ext/zeromq/src/kqueue.cpp +11 -3
  273. data/ext/zeromq/src/kqueue.hpp +7 -3
  274. data/ext/zeromq/src/lb.cpp +13 -11
  275. data/ext/zeromq/src/lb.hpp +10 -5
  276. data/ext/zeromq/src/libzmq.pc.cmake.in +10 -0
  277. data/ext/zeromq/src/likely.hpp +1 -2
  278. data/ext/zeromq/src/mailbox.cpp +1 -4
  279. data/ext/zeromq/src/mailbox.hpp +8 -3
  280. data/ext/zeromq/src/mechanism.cpp +163 -0
  281. data/ext/zeromq/src/mechanism.hpp +101 -0
  282. data/ext/zeromq/src/msg.cpp +38 -18
  283. data/ext/zeromq/src/msg.hpp +19 -7
  284. data/ext/zeromq/src/mtrie.cpp +16 -14
  285. data/ext/zeromq/src/mtrie.hpp +1 -3
  286. data/ext/zeromq/src/mutex.hpp +42 -3
  287. data/ext/zeromq/src/null_mechanism.cpp +282 -0
  288. data/ext/zeromq/src/null_mechanism.hpp +65 -0
  289. data/ext/zeromq/src/object.cpp +29 -3
  290. data/ext/zeromq/src/object.hpp +8 -5
  291. data/ext/zeromq/src/options.cpp +557 -485
  292. data/ext/zeromq/src/options.hpp +38 -24
  293. data/ext/zeromq/src/own.cpp +1 -2
  294. data/ext/zeromq/src/own.hpp +1 -2
  295. data/ext/zeromq/src/pair.cpp +8 -25
  296. data/ext/zeromq/src/pair.hpp +5 -22
  297. data/ext/zeromq/src/pgm_receiver.cpp +80 -67
  298. data/ext/zeromq/src/pgm_receiver.hpp +11 -10
  299. data/ext/zeromq/src/pgm_sender.cpp +37 -16
  300. data/ext/zeromq/src/pgm_sender.hpp +12 -6
  301. data/ext/zeromq/src/pgm_socket.cpp +8 -8
  302. data/ext/zeromq/src/pgm_socket.hpp +1 -4
  303. data/ext/zeromq/src/pipe.cpp +110 -72
  304. data/ext/zeromq/src/pipe.hpp +36 -27
  305. data/ext/zeromq/src/plain_mechanism.cpp +482 -0
  306. data/ext/zeromq/src/plain_mechanism.hpp +88 -0
  307. data/ext/zeromq/src/poll.cpp +1 -3
  308. data/ext/zeromq/src/poll.hpp +1 -3
  309. data/ext/zeromq/src/poller.hpp +1 -3
  310. data/ext/zeromq/src/poller_base.cpp +3 -3
  311. data/ext/zeromq/src/poller_base.hpp +1 -2
  312. data/ext/zeromq/src/precompiled.cpp +1 -2
  313. data/ext/zeromq/src/precompiled.hpp +1 -2
  314. data/ext/zeromq/src/proxy.cpp +1 -2
  315. data/ext/zeromq/src/proxy.hpp +1 -2
  316. data/ext/zeromq/src/pub.cpp +2 -16
  317. data/ext/zeromq/src/pub.hpp +2 -19
  318. data/ext/zeromq/src/pull.cpp +7 -24
  319. data/ext/zeromq/src/pull.hpp +4 -21
  320. data/ext/zeromq/src/push.cpp +8 -22
  321. data/ext/zeromq/src/push.hpp +4 -21
  322. data/ext/zeromq/src/random.cpp +1 -2
  323. data/ext/zeromq/src/random.hpp +1 -2
  324. data/ext/zeromq/src/raw_decoder.cpp +63 -0
  325. data/ext/zeromq/src/raw_decoder.hpp +66 -0
  326. data/ext/zeromq/src/raw_encoder.cpp +40 -0
  327. data/ext/zeromq/src/raw_encoder.hpp +60 -0
  328. data/ext/zeromq/src/reaper.cpp +12 -2
  329. data/ext/zeromq/src/reaper.hpp +6 -2
  330. data/ext/zeromq/src/rep.cpp +7 -21
  331. data/ext/zeromq/src/rep.hpp +3 -20
  332. data/ext/zeromq/src/req.cpp +132 -38
  333. data/ext/zeromq/src/req.hpp +27 -8
  334. data/ext/zeromq/src/router.cpp +109 -65
  335. data/ext/zeromq/src/router.hpp +9 -23
  336. data/ext/zeromq/src/select.cpp +1 -3
  337. data/ext/zeromq/src/select.hpp +1 -3
  338. data/ext/zeromq/src/session_base.cpp +164 -118
  339. data/ext/zeromq/src/session_base.hpp +29 -22
  340. data/ext/zeromq/src/signaler.cpp +127 -19
  341. data/ext/zeromq/src/signaler.hpp +20 -3
  342. data/ext/zeromq/src/socket_base.cpp +167 -134
  343. data/ext/zeromq/src/socket_base.hpp +18 -20
  344. data/ext/zeromq/src/stdint.hpp +1 -2
  345. data/ext/zeromq/src/stream.cpp +257 -0
  346. data/ext/zeromq/src/stream.hpp +97 -0
  347. data/ext/zeromq/src/stream_engine.cpp +405 -157
  348. data/ext/zeromq/src/stream_engine.hpp +72 -23
  349. data/ext/zeromq/src/sub.cpp +5 -18
  350. data/ext/zeromq/src/sub.hpp +2 -19
  351. data/ext/zeromq/src/tcp.cpp +23 -3
  352. data/ext/zeromq/src/tcp.hpp +7 -3
  353. data/ext/zeromq/src/tcp_address.cpp +35 -46
  354. data/ext/zeromq/src/tcp_address.hpp +7 -12
  355. data/ext/zeromq/src/tcp_connecter.cpp +10 -5
  356. data/ext/zeromq/src/tcp_connecter.hpp +1 -3
  357. data/ext/zeromq/src/tcp_listener.cpp +19 -8
  358. data/ext/zeromq/src/tcp_listener.hpp +1 -3
  359. data/ext/zeromq/src/thread.cpp +2 -4
  360. data/ext/zeromq/src/thread.hpp +1 -3
  361. data/ext/zeromq/src/trie.cpp +122 -125
  362. data/ext/zeromq/src/trie.hpp +1 -4
  363. data/ext/zeromq/src/v1_decoder.cpp +77 -91
  364. data/ext/zeromq/src/v1_decoder.hpp +10 -21
  365. data/ext/zeromq/src/v1_encoder.cpp +24 -62
  366. data/ext/zeromq/src/v1_encoder.hpp +7 -18
  367. data/ext/zeromq/src/v2_decoder.cpp +142 -0
  368. data/ext/zeromq/src/v2_decoder.hpp +57 -0
  369. data/ext/zeromq/src/v2_encoder.cpp +67 -0
  370. data/ext/zeromq/src/{i_msg_source.hpp → v2_encoder.hpp} +20 -15
  371. data/ext/zeromq/src/{v1_protocol.hpp → v2_protocol.hpp} +7 -11
  372. data/ext/zeromq/src/windows.hpp +2 -4
  373. data/ext/zeromq/src/wire.hpp +5 -6
  374. data/ext/zeromq/src/xpub.cpp +37 -46
  375. data/ext/zeromq/src/xpub.hpp +7 -23
  376. data/ext/zeromq/src/xsub.cpp +26 -40
  377. data/ext/zeromq/src/xsub.hpp +5 -21
  378. data/ext/zeromq/src/ypipe.hpp +3 -4
  379. data/ext/zeromq/src/ypipe_base.hpp +44 -0
  380. data/ext/zeromq/src/ypipe_conflate.hpp +127 -0
  381. data/ext/zeromq/src/yqueue.hpp +3 -7
  382. data/ext/zeromq/src/zmq.cpp +76 -96
  383. data/ext/zeromq/src/zmq_utils.cpp +146 -8
  384. data/ext/zeromq/tests/Makefile.am +56 -8
  385. data/ext/zeromq/tests/test_abstract_ipc.cpp +57 -0
  386. data/ext/zeromq/tests/test_conflate.cpp +75 -0
  387. data/ext/zeromq/tests/test_connect_resolve.cpp +14 -15
  388. data/ext/zeromq/tests/test_ctx_destroy.cpp +90 -0
  389. data/ext/zeromq/tests/test_ctx_options.cpp +52 -0
  390. data/ext/zeromq/tests/test_disconnect_inproc.cpp +35 -30
  391. data/ext/zeromq/tests/test_fork.cpp +81 -0
  392. data/ext/zeromq/tests/test_hwm.cpp +251 -35
  393. data/ext/zeromq/tests/test_immediate.cpp +229 -0
  394. data/ext/zeromq/tests/test_inproc_connect.cpp +339 -0
  395. data/ext/zeromq/tests/test_invalid_rep.cpp +9 -13
  396. data/ext/zeromq/tests/test_iov.cpp +106 -0
  397. data/ext/zeromq/tests/test_issue_566.cpp +85 -0
  398. data/ext/zeromq/tests/test_last_endpoint.cpp +14 -18
  399. data/ext/zeromq/tests/test_linger.cpp +93 -0
  400. data/ext/zeromq/tests/test_monitor.cpp +112 -129
  401. data/ext/zeromq/tests/test_msg_flags.cpp +17 -16
  402. data/ext/zeromq/tests/test_pair_inproc.cpp +25 -7
  403. data/ext/zeromq/tests/test_pair_ipc.cpp +4 -7
  404. data/ext/zeromq/tests/test_pair_tcp.cpp +4 -8
  405. data/ext/zeromq/tests/test_probe_router.cpp +72 -0
  406. data/ext/zeromq/tests/test_req_correlate.cpp +177 -0
  407. data/ext/zeromq/tests/test_req_relaxed.cpp +116 -0
  408. data/ext/zeromq/tests/test_reqrep_device.cpp +9 -17
  409. data/ext/zeromq/tests/test_reqrep_inproc.cpp +4 -7
  410. data/ext/zeromq/tests/test_reqrep_ipc.cpp +4 -7
  411. data/ext/zeromq/tests/test_reqrep_tcp.cpp +4 -8
  412. data/ext/zeromq/tests/test_router_mandatory.cpp +41 -22
  413. data/ext/zeromq/tests/test_security_curve.cpp +212 -0
  414. data/ext/zeromq/tests/test_security_null.cpp +148 -0
  415. data/ext/zeromq/tests/test_security_plain.cpp +150 -0
  416. data/ext/zeromq/tests/test_shutdown_stress.cpp +10 -23
  417. data/ext/zeromq/tests/test_spec_dealer.cpp +254 -0
  418. data/ext/zeromq/tests/test_spec_pushpull.cpp +293 -0
  419. data/ext/zeromq/tests/test_spec_rep.cpp +155 -0
  420. data/ext/zeromq/tests/test_spec_req.cpp +253 -0
  421. data/ext/zeromq/tests/test_spec_router.cpp +204 -0
  422. data/ext/zeromq/tests/test_stream.cpp +228 -0
  423. data/ext/zeromq/tests/test_sub_forward.cpp +14 -22
  424. data/ext/zeromq/tests/test_system.cpp +82 -0
  425. data/ext/zeromq/tests/test_term_endpoint.cpp +17 -31
  426. data/ext/zeromq/tests/test_timeo.cpp +34 -78
  427. data/ext/zeromq/tests/testutil.hpp +211 -26
  428. data/ext/zeromq/tools/Makefile.am +9 -0
  429. data/ext/zeromq/tools/curve_keygen.c +58 -0
  430. data/lib/zmq/version.rb +1 -1
  431. data/test/test_socket.rb +4 -3
  432. metadata +114 -15
  433. data/ext/zeromq/cmake/Modules/TestZMQVersion.cmake +0 -35
  434. data/ext/zeromq/foreign/openpgm/libpgm-5.1.118~dfsg.tar.gz +0 -0
  435. data/ext/zeromq/src/decoder.cpp +0 -166
  436. data/ext/zeromq/src/encoder.cpp +0 -102
  437. data/ext/zeromq/tests/test_connect_delay.cpp +0 -260
@@ -91,7 +91,7 @@ zmq_msg_close (&msg);
91
91
  .Receiving a multi-part message
92
92
  ----
93
93
  int64_t more;
94
- size_t more_size = sizeof more;
94
+ size_t more_size = sizeof (more);
95
95
  do {
96
96
  /* Create an empty 0MQ message to hold the message part */
97
97
  zmq_msg_t part;
@@ -120,6 +120,5 @@ linkzmq:zmq[7]
120
120
 
121
121
  AUTHORS
122
122
  -------
123
- This man page was written by Martin Sustrik <sustrik@250bpm.com>, Martin
124
- Lucina <martin@lucina.net>, and Pieter Hintjens <ph@imatix.com>.
125
-
123
+ This page was written by the 0MQ community. To make a change please
124
+ read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
@@ -23,9 +23,10 @@ argument to be sent to the socket referenced by the 'socket' argument. The
23
23
  'flags' argument is a combination of the flags defined below:
24
24
 
25
25
  *ZMQ_DONTWAIT*::
26
- Specifies that the operation should be performed in non-blocking mode. If the
27
- message cannot be queued on the 'socket', the _zmq_msg_send()_ function shall
28
- fail with 'errno' set to EAGAIN.
26
+ For socket types (DEALER, PUSH) that block when there are no available peers
27
+ (or all peers have full high-water mark), specifies that the operation should
28
+ be performed in non-blocking mode. If the message cannot be queued on the
29
+ 'socket', the _zmq_msg_send()_ function shall fail with 'errno' set to EAGAIN.
29
30
 
30
31
  *ZMQ_SNDMORE*::
31
32
  Specifies that the message being sent is a multi-part message, and that further
@@ -38,7 +39,8 @@ it using (e.g. using _zmq_msg_copy()_).
38
39
 
39
40
  NOTE: A successful invocation of _zmq_msg_send()_ does not indicate that the
40
41
  message has been transmitted to the network, only that it has been queued on
41
- the 'socket' and 0MQ has assumed responsibility for the message.
42
+ the 'socket' and 0MQ has assumed responsibility for the message. You do not need
43
+ to call _zmq_msg_close()_ after a successful _zmq_msg_send()_.
42
44
 
43
45
 
44
46
  Multi-part messages
@@ -79,6 +81,8 @@ The operation was interrupted by delivery of a signal before the message was
79
81
  sent.
80
82
  *EFAULT*::
81
83
  Invalid message.
84
+ *EHOSTUNREACH*::
85
+ The message cannot be routed.
82
86
 
83
87
 
84
88
  EXAMPLE
@@ -117,6 +121,5 @@ linkzmq:zmq[7]
117
121
 
118
122
  AUTHORS
119
123
  -------
120
- This 0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
121
- Martin Lucina <mato@kotelna.sk>, and Pieter Hintjens <ph@imatix.com>.
122
-
124
+ This page was written by the 0MQ community. To make a change please
125
+ read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
@@ -42,4 +42,5 @@ linkzmq:zmq[7]
42
42
 
43
43
  AUTHORS
44
44
  -------
45
- This 0MQ manual page was written by Pieter Hintjens <ph@imatix.com>.
45
+ This page was written by the 0MQ community. To make a change please
46
+ read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
@@ -44,5 +44,5 @@ linkzmq:zmq[7]
44
44
 
45
45
  AUTHORS
46
46
  -------
47
- This 0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com>,
48
- Martin Lucina <mato@kotelna.sk>, and Pieter Hintjens <ph@imatix.com>.
47
+ This page was written by the 0MQ community. To make a change please
48
+ read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
@@ -0,0 +1,27 @@
1
+ zmq_null(7)
2
+ ===========
3
+
4
+
5
+ NAME
6
+ ----
7
+ zmq_null - no security or confidentiality
8
+
9
+
10
+ SYNOPSIS
11
+ --------
12
+ The NULL mechanism is defined by the ZMTP 3.0 specification:
13
+ <http://rfc.zeromq.org/spec:23>. This is the default security mechanism
14
+ for ZeroMQ sockets.
15
+
16
+
17
+ SEE ALSO
18
+ --------
19
+ linkzmq:zmq_plain[7]
20
+ linkzmq:zmq_curve[7]
21
+ linkzmq:zmq[7]
22
+
23
+
24
+ AUTHORS
25
+ -------
26
+ This page was written by the 0MQ community. To make a change please
27
+ read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
@@ -54,7 +54,7 @@ and a port number.
54
54
  An 'interface' may be specified by either of the following:
55
55
 
56
56
  * The interface name as defined by the operating system.
57
- * The primary IPv4 address assigned to the interface, in it's numeric
57
+ * The primary IPv4 address assigned to the interface, in its numeric
58
58
  representation.
59
59
 
60
60
  NOTE: Interface names are not standardised in any way and should be assumed to
@@ -63,7 +63,7 @@ names exist, thus only the primary IPv4 address may be used to specify an
63
63
  'interface'. The 'interface' part can be omitted, in that case the default one
64
64
  will be selected.
65
65
 
66
- A 'multicast address' is specified by an IPv4 multicast address in it's numeric
66
+ A 'multicast address' is specified by an IPv4 multicast address in its numeric
67
67
  representation.
68
68
 
69
69
 
@@ -156,7 +156,8 @@ linkzmq:zmq_ipc[7]
156
156
  linkzmq:zmq_inproc[7]
157
157
  linkzmq:zmq[7]
158
158
 
159
+
159
160
  AUTHORS
160
161
  -------
161
- This 0MQ manual page was written by Pieter Hintjens <ph@imatix.com>,
162
- Martin Sustrik <sustrik@250bpm.com> and Martin Lucina <mato@kotelna.sk>.
162
+ This page was written by the 0MQ community. To make a change please
163
+ read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
@@ -0,0 +1,37 @@
1
+ zmq_plain(7)
2
+ ============
3
+
4
+
5
+ NAME
6
+ ----
7
+ zmq_plain - clear-text authentication
8
+
9
+
10
+ SYNOPSIS
11
+ --------
12
+ The PLAIN mechanism defines a simple username/password mechanism that
13
+ lets a server authenticate a client. PLAIN makes no attempt at security
14
+ or confidentiality. It is intended for use on internal networks where
15
+ security requirements are low. The PLAIN mechanism is defined by this
16
+ document: <http://rfc.zeromq.org/spec:24>.
17
+
18
+
19
+ USAGE
20
+ -----
21
+ To use PLAIN, the server shall set the ZMQ_PLAIN_SERVER option, and the
22
+ client shall set the ZMQ_PLAIN_USERNAME and ZMQ_PLAIN_PASSWORD socket
23
+ options. Which peer binds, and which connects, is not relevant.
24
+
25
+
26
+ SEE ALSO
27
+ --------
28
+ linkzmq:zmq_setsockopt[3]
29
+ linkzmq:zmq_null[7]
30
+ linkzmq:zmq_curve[7]
31
+ linkzmq:zmq[7]
32
+
33
+
34
+ AUTHORS
35
+ -------
36
+ This page was written by the 0MQ community. To make a change please
37
+ read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
@@ -73,10 +73,6 @@ NOTE: The _zmq_poll()_ function may be implemented or emulated using operating
73
73
  system interfaces other than _poll()_, and as such may be subject to the limits
74
74
  of those interfaces in ways not defined in this documentation.
75
75
 
76
- NOTE: The _zmq_send()_ function will clear all pending events on a socket. Thus,
77
- if you use _zmq_poll()_ to monitor input on a socket, use it before output as
78
- well, and process all events after each _zmq_poll()_ call.
79
-
80
76
  RETURN VALUE
81
77
  ------------
82
78
  Upon successful completion, the _zmq_poll()_ function shall return the number
@@ -128,5 +124,5 @@ Your operating system documentation for the _poll()_ system call.
128
124
 
129
125
  AUTHORS
130
126
  -------
131
- This 0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
132
- Martin Lucina <mato@kotelna.sk>.
127
+ This page was written by the 0MQ community. To make a change please
128
+ read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
@@ -94,4 +94,5 @@ linkzmq:zmq[7]
94
94
 
95
95
  AUTHORS
96
96
  -------
97
- This 0MQ manual page was written by Pieter Hintjens <ph@imatix.com>
97
+ This page was written by the 0MQ community. To make a change please
98
+ read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
@@ -78,9 +78,7 @@ assert (nbytes != -1);
78
78
 
79
79
  SEE ALSO
80
80
  --------
81
- linkzmq:zmq_recvmsg[3]
82
81
  linkzmq:zmq_send[3]
83
- linkzmq:zmq_sendmsg[3]
84
82
  linkzmq:zmq_getsockopt[3]
85
83
  linkzmq:zmq_socket[7]
86
84
  linkzmq:zmq[7]
@@ -88,6 +86,5 @@ linkzmq:zmq[7]
88
86
 
89
87
  AUTHORS
90
88
  -------
91
- This 0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
92
- Martin Lucina <mato@kotelna.sk>, and Pieter Hintjens <ph@imatix.com>.
93
-
89
+ This page was written by the 0MQ community. To make a change please
90
+ read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
@@ -89,7 +89,7 @@ zmq_msg_close (&msg);
89
89
  .Receiving a multi-part message
90
90
  ----
91
91
  int64_t more;
92
- size_t more_size = sizeof more;
92
+ size_t more_size = sizeof (more);
93
93
  do {
94
94
  /* Create an empty 0MQ message to hold the message part */
95
95
  zmq_msg_t part;
@@ -110,7 +110,6 @@ SEE ALSO
110
110
  --------
111
111
  linkzmq:zmq_recv[3]
112
112
  linkzmq:zmq_send[3]
113
- linkzmq:zmq_sendmsg[3]
114
113
  linkzmq:zmq_getsockopt[3]
115
114
  linkzmq:zmq_socket[7]
116
115
  linkzmq:zmq[7]
@@ -118,6 +117,5 @@ linkzmq:zmq[7]
118
117
 
119
118
  AUTHORS
120
119
  -------
121
- This man page was written by Martin Sustrik <sustrik@250bpm.com>, Martin
122
- Lucina <martin@lucina.net> and Pieter Hintjens <ph@imatix.com>.
123
-
120
+ This page was written by the 0MQ community. To make a change please
121
+ read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
@@ -19,9 +19,10 @@ referenced by the 'buf' and 'len' arguments. The 'flags' argument is
19
19
  a combination of the flags defined below:
20
20
 
21
21
  *ZMQ_DONTWAIT*::
22
- Specifies that the operation should be performed in non-blocking mode. If the
23
- message cannot be queued on the 'socket', the _zmq_send()_ function shall
24
- fail with 'errno' set to EAGAIN.
22
+ For socket types (DEALER, PUSH) that block when there are no available peers
23
+ (or all peers have full high-water mark), specifies that the operation should
24
+ be performed in non-blocking mode. If the message cannot be queued on the
25
+ 'socket', the _zmq_send()_ function shall fail with 'errno' set to EAGAIN.
25
26
 
26
27
  *ZMQ_SNDMORE*::
27
28
  Specifies that the message being sent is a multi-part message, and that further
@@ -69,6 +70,8 @@ The provided 'socket' was invalid.
69
70
  *EINTR*::
70
71
  The operation was interrupted by delivery of a signal before the message was
71
72
  sent.
73
+ *EHOSTUNREACH*::
74
+ The message cannot be routed.
72
75
 
73
76
 
74
77
  EXAMPLE
@@ -87,14 +90,13 @@ assert (rc == 2);
87
90
 
88
91
  SEE ALSO
89
92
  --------
90
- linkzmq:zmq_sendmsg[3]
93
+ linkzmq:zmq_send_const[3]
91
94
  linkzmq:zmq_recv[3]
92
- linkzmq:zmq_recvmsg[3]
93
95
  linkzmq:zmq_socket[7]
94
96
  linkzmq:zmq[7]
95
97
 
96
98
 
97
99
  AUTHORS
98
100
  -------
99
- This 0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
100
- Martin Lucina <mato@kotelna.sk>, and Pieter Hintjens <ph@imatix.com>.
101
+ This page was written by the 0MQ community. To make a change please
102
+ read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
@@ -0,0 +1,103 @@
1
+ zmq_send_const(3)
2
+ =================
3
+
4
+
5
+ NAME
6
+ ----
7
+ zmq_send_const - send a constant-memory message part on a socket
8
+
9
+
10
+ SYNOPSIS
11
+ --------
12
+ *int zmq_send_const (void '*socket', void '*buf', size_t 'len', int 'flags');*
13
+
14
+
15
+ DESCRIPTION
16
+ -----------
17
+ The _zmq_send_const()_ function shall queue a message created from the buffer
18
+ referenced by the 'buf' and 'len' arguments. The message buffer is assumed
19
+ to be constant-memory and will therefore not be copied or deallocated
20
+ in any way. The 'flags' argument is a combination of the flags defined below:
21
+
22
+ *ZMQ_DONTWAIT*::
23
+ For socket types (DEALER, PUSH) that block when there are no available peers
24
+ (or all peers have full high-water mark), specifies that the operation should
25
+ be performed in non-blocking mode. If the message cannot be queued on the
26
+ 'socket', the _zmq_send_const()_ function shall fail with 'errno' set to EAGAIN.
27
+
28
+ *ZMQ_SNDMORE*::
29
+ Specifies that the message being sent is a multi-part message, and that further
30
+ message parts are to follow. Refer to the section regarding multi-part messages
31
+ below for a detailed description.
32
+
33
+ NOTE: A successful invocation of _zmq_send_const()_ does not indicate that the
34
+ message has been transmitted to the network, only that it has been queued on
35
+ the 'socket' and 0MQ has assumed responsibility for the message.
36
+
37
+
38
+ Multi-part messages
39
+ ~~~~~~~~~~~~~~~~~~~
40
+ A 0MQ message is composed of 1 or more message parts. 0MQ ensures atomic
41
+ delivery of messages: peers shall receive either all _message parts_ of a
42
+ message or none at all. The total number of message parts is unlimited except
43
+ by available memory.
44
+
45
+ An application that sends multi-part messages must use the _ZMQ_SNDMORE_ flag
46
+ when sending each message part except the final one.
47
+
48
+
49
+ RETURN VALUE
50
+ ------------
51
+ The _zmq_send_const()_ function shall return number of bytes in the message
52
+ if successful. Otherwise it shall return `-1` and set 'errno' to one of the
53
+ values defined below.
54
+
55
+
56
+ ERRORS
57
+ ------
58
+ *EAGAIN*::
59
+ Non-blocking mode was requested and the message cannot be sent at the moment.
60
+ *ENOTSUP*::
61
+ The _zmq_send_const()_ operation is not supported by this socket type.
62
+ *EFSM*::
63
+ The _zmq_send_const()_ operation cannot be performed on this socket at the moment
64
+ due to the socket not being in the appropriate state. This error may occur with
65
+ socket types that switch between several states, such as ZMQ_REP. See the
66
+ _messaging patterns_ section of linkzmq:zmq_socket[3] for more information.
67
+ *ETERM*::
68
+ The 0MQ 'context' associated with the specified 'socket' was terminated.
69
+ *ENOTSOCK*::
70
+ The provided 'socket' was invalid.
71
+ *EINTR*::
72
+ The operation was interrupted by delivery of a signal before the message was
73
+ sent.
74
+ *EHOSTUNREACH*::
75
+ The message cannot be routed.
76
+
77
+
78
+ EXAMPLE
79
+ -------
80
+ .Sending a multi-part message
81
+ ----
82
+ /* Send a multi-part message consisting of three parts to socket */
83
+ rc = zmq_send_const (socket, "ABC", 3, ZMQ_SNDMORE);
84
+ assert (rc == 3);
85
+ rc = zmq_send_const (socket, "DEFGH", 5, ZMQ_SNDMORE);
86
+ assert (rc == 5);
87
+ /* Final part; no more parts to follow */
88
+ rc = zmq_send_const (socket, "JK", 2, 0);
89
+ assert (rc == 2);
90
+ ----
91
+
92
+ SEE ALSO
93
+ --------
94
+ linkzmq:zmq_send[3]
95
+ linkzmq:zmq_recv[3]
96
+ linkzmq:zmq_socket[7]
97
+ linkzmq:zmq[7]
98
+
99
+
100
+ AUTHORS
101
+ -------
102
+ This page was written by the 0MQ community. To make a change please
103
+ read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
@@ -19,9 +19,10 @@ argument to be sent to the socket referenced by the 'socket' argument. The
19
19
  'flags' argument is a combination of the flags defined below:
20
20
 
21
21
  *ZMQ_DONTWAIT*::
22
- Specifies that the operation should be performed in non-blocking mode. If the
23
- message cannot be queued on the 'socket', the _zmq_sendmsg()_ function shall
24
- fail with 'errno' set to EAGAIN.
22
+ For socket types (DEALER, PUSH) that block when there are no available peers
23
+ (or all peers have full high-water mark), specifies that the operation should
24
+ be performed in non-blocking mode. If the message cannot be queued on the
25
+ 'socket', the _zmq_sendmsg()_ function shall fail with 'errno' set to EAGAIN.
25
26
 
26
27
  *ZMQ_SNDMORE*::
27
28
  Specifies that the message being sent is a multi-part message, and that further
@@ -76,6 +77,8 @@ The operation was interrupted by delivery of a signal before the message was
76
77
  sent.
77
78
  *EFAULT*::
78
79
  Invalid message.
80
+ *EHOSTUNREACH*::
81
+ The message cannot be routed.
79
82
 
80
83
 
81
84
  EXAMPLE
@@ -106,14 +109,11 @@ rc = zmq_sendmsg (socket, &part3, 0);
106
109
  SEE ALSO
107
110
  --------
108
111
  linkzmq:zmq_recv[3]
109
- linkzmq:zmq_recv[3]
110
- linkzmq:zmq_recvmsg[3]
111
112
  linkzmq:zmq_socket[7]
112
113
  linkzmq:zmq[7]
113
114
 
114
115
 
115
116
  AUTHORS
116
117
  -------
117
- This 0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
118
- Martin Lucina <mato@kotelna.sk>, and Pieter Hintjens <ph@imatix.com>.
119
-
118
+ This page was written by the 0MQ community. To make a change please
119
+ read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
@@ -13,8 +13,12 @@ SYNOPSIS
13
13
  *int zmq_setsockopt (void '*socket', int 'option_name', const void '*option_value', size_t 'option_len');*
14
14
 
15
15
  Caution: All options, with the exception of ZMQ_SUBSCRIBE, ZMQ_UNSUBSCRIBE,
16
- ZMQ_LINGER, ZMQ_ROUTER_MANDATORY and ZMQ_XPUB_VERBOSE only take effect for
17
- subsequent socket bind/connects.
16
+ ZMQ_LINGER, ZMQ_ROUTER_MANDATORY, ZMQ_PROBE_ROUTER, ZMQ_XPUB_VERBOSE,
17
+ ZMQ_REQ_CORRELATE, and ZMQ_REQ_RELAXED, only take effect for subsequent socket
18
+ bind/connects.
19
+
20
+ Specifically, security options take effect for subsequent bind/connect calls,
21
+ and can be changed at any time to affect subsequent binds and/or connects.
18
22
 
19
23
  DESCRIPTION
20
24
  -----------
@@ -31,7 +35,8 @@ ZMQ_SNDHWM: Set high water mark for outbound messages
31
35
  The 'ZMQ_SNDHWM' option shall set the high water mark for outbound messages on
32
36
  the specified 'socket'. The high water mark is a hard limit on the maximum
33
37
  number of outstanding messages 0MQ shall queue in memory for any single peer
34
- that the specified 'socket' is communicating with.
38
+ that the specified 'socket' is communicating with. A value of zero means no
39
+ limit.
35
40
 
36
41
  If this limit has been reached the socket shall enter an exceptional state and
37
42
  depending on the socket type, 0MQ shall take appropriate action such as
@@ -55,7 +60,8 @@ ZMQ_RCVHWM: Set high water mark for inbound messages
55
60
  The 'ZMQ_RCVHWM' option shall set the high water mark for inbound messages on
56
61
  the specified 'socket'. The high water mark is a hard limit on the maximum
57
62
  number of outstanding messages 0MQ shall queue in memory for any single peer
58
- that the specified 'socket' is communicating with.
63
+ that the specified 'socket' is communicating with. A value of zero means no
64
+ limit.
59
65
 
60
66
  If this limit has been reached the socket shall enter an exceptional state and
61
67
  depending on the socket type, 0MQ shall take appropriate action such as
@@ -176,6 +182,7 @@ Option value unit:: milliseconds
176
182
  Default value:: 10000
177
183
  Applicable socket types:: all, when using multicast transports
178
184
 
185
+
179
186
  ZMQ_SNDBUF: Set kernel transmit buffer size
180
187
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
181
188
  The 'ZMQ_SNDBUF' option shall set the underlying kernel transmit buffer size
@@ -253,7 +260,7 @@ Applicable socket types:: all, only for connection-oriented transports
253
260
 
254
261
  ZMQ_RECONNECT_IVL_MAX: Set maximum reconnection interval
255
262
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
256
- The 'ZMQ_RECONNECT_IVL_MAX' option shall set the maximum reconnection interval
263
+ The 'ZMQ_RECONNECT_IVL_MAX' option shall set the maximum reconnection interval
257
264
  for the specified 'socket'. This is the maximum period 0MQ shall wait between
258
265
  attempts to reconnect. On each reconnect attempt, the previous interval shall be
259
266
  doubled untill ZMQ_RECONNECT_IVL_MAX is reached. This allows for exponential
@@ -342,12 +349,26 @@ Default value:: -1 (infinite)
342
349
  Applicable socket types:: all
343
350
 
344
351
 
345
- ZMQ_IPV4ONLY: Use IPv4-only sockets
346
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
352
+ ZMQ_IPV6: Enable IPv6 on socket
353
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
347
354
 
348
- Sets the underlying native socket type. A value of `1` will use IPv4 sockets,
349
- while the value of `0` will use IPv6 sockets. An IPv6 socket lets
350
- applications connect to and accept connections from both IPv4 and IPv6 hosts.
355
+ Set the IPv6 option for the socket. A value of `1` means IPv6 is
356
+ enabled on the socket, while `0` means the socket will use only IPv4.
357
+ When IPv6 is enabled the socket will connect to, or accept connections
358
+ from, both IPv4 and IPv6 hosts.
359
+
360
+ [horizontal]
361
+ Option value type:: int
362
+ Option value unit:: boolean
363
+ Default value:: 0 (false)
364
+ Applicable socket types:: all, when using TCP transports.
365
+
366
+
367
+ ZMQ_IPV4ONLY: Use IPv4-only on socket
368
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
369
+
370
+ Set the IPv4-only option for the socket. This option is deprecated.
371
+ Please use the ZMQ_IPV6 option.
351
372
 
352
373
  [horizontal]
353
374
  Option value type:: int
@@ -356,12 +377,15 @@ Default value:: 1 (true)
356
377
  Applicable socket types:: all, when using TCP transports.
357
378
 
358
379
 
359
- ZMQ_DELAY_ATTACH_ON_CONNECT: Accept messages only when connections are made
360
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
380
+ ZMQ_IMMEDIATE: Queue messages only to completed connections
381
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
361
382
 
362
- If set to `1`, will delay the attachment of a pipe on connect until the underlying
363
- connection has completed. This will cause the socket to block if there are no other
364
- connections, but will prevent queues from filling on pipes awaiting connection.
383
+ By default queues will fill on outgoing connections even if the connection has
384
+ not completed. This can lead to "lost" messages on sockets with round-robin
385
+ routing (REQ, PUSH, DEALER). If this option is set to `1`, messages shall be
386
+ queued only to completed connections. This will cause the socket to block if
387
+ there are no other connections, but will prevent queues from filling on pipes
388
+ awaiting connection.
365
389
 
366
390
  [horizontal]
367
391
  Option value type:: int
@@ -373,8 +397,8 @@ Applicable socket types:: all, only for connection-oriented transports.
373
397
  ZMQ_ROUTER_MANDATORY: accept only routable messages on ROUTER sockets
374
398
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
375
399
 
376
- Sets the 'ROUTER' socket behavior when an unroutable message is encountered. A
377
- value of `0` is the default and discards the message silently when it cannot be
400
+ Sets the ROUTER socket behavior when an unroutable message is encountered. A
401
+ value of `0` is the default and discards the message silently when it cannot be
378
402
  routed. A value of `1` returns an 'EHOSTUNREACH' error code if the message
379
403
  cannot be routed.
380
404
 
@@ -385,11 +409,49 @@ Default value:: 0
385
409
  Applicable socket types:: ZMQ_ROUTER
386
410
 
387
411
 
412
+ ZMQ_ROUTER_RAW: switch ROUTER socket to raw mode
413
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
414
+
415
+ Sets the raw mode on the ROUTER, when set to 1. When the ROUTER socket is in
416
+ raw mode, and when using the tcp:// transport, it will read and write TCP data
417
+ without 0MQ framing. This lets 0MQ applications talk to non-0MQ applications.
418
+ When using raw mode, you cannot set explicit identities, and the ZMQ_MSGMORE
419
+ flag is ignored when sending data messages. In raw mode you can close a specific
420
+ connection by sending it a zero-length message (following the identity frame).
421
+
422
+ NOTE: This option is deprecated, please use ZMQ_STREAM sockets instead.
423
+
424
+ [horizontal]
425
+ Option value type:: int
426
+ Option value unit:: 0, 1
427
+ Default value:: 0
428
+ Applicable socket types:: ZMQ_ROUTER
429
+
430
+
431
+ ZMQ_PROBE_ROUTER: bootstrap connections to ROUTER sockets
432
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
433
+
434
+ When set to 1, the socket will automatically send an empty message when a
435
+ new connection is made or accepted. You may set this on REQ, DEALER, or
436
+ ROUTER sockets connected to a ROUTER socket. The application must filter
437
+ such empty messages. The ZMQ_PROBE_ROUTER option in effect provides the
438
+ ROUTER application with an event signaling the arrival of a new peer.
439
+
440
+ NOTE: do not set this option on a socket that talks to any other socket
441
+ types: the results are undefined.
442
+
443
+ [horizontal]
444
+ Option value type:: int
445
+ Option value unit:: 0, 1
446
+ Default value:: 0
447
+ Applicable socket types:: ZMQ_ROUTER, ZMQ_DEALER, ZMQ_REQ
448
+
449
+
388
450
  ZMQ_XPUB_VERBOSE: provide all subscription messages on XPUB sockets
389
451
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
390
452
 
391
- Sets the 'XPUB' socket behavior on new subscriptions and unsubscriptions.
392
- A value of '0' is the default and passes only new subscription messages to
453
+ Sets the 'XPUB' socket behavior on new subscriptions and unsubscriptions.
454
+ A value of '0' is the default and passes only new subscription messages to
393
455
  upstream. A value of '1' passes all subscription messages upstream.
394
456
 
395
457
  [horizontal]
@@ -399,9 +461,49 @@ Default value:: 0
399
461
  Applicable socket types:: ZMQ_XPUB
400
462
 
401
463
 
464
+ ZMQ_REQ_CORRELATE: match replies with requests
465
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
466
+
467
+ The default behavior of REQ sockets is to rely on the ordering of messages to
468
+ match requests and responses and that is usually sufficient. When this option
469
+ is set to 1, the REQ socket will prefix outgoing messages with an extra frame
470
+ containing a request id. That means the full message is (request id, 0,
471
+ user frames...). The REQ socket will discard all incoming messages that don't
472
+ begin with these two frames.
473
+
474
+ [horizontal]
475
+ Option value type:: int
476
+ Option value unit:: 0, 1
477
+ Default value:: 0
478
+ Applicable socket types:: ZMQ_REQ
479
+
480
+
481
+ ZMQ_REQ_RELAXED: relax strict alternation between request and reply
482
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
483
+
484
+ By default, a REQ socket does not allow initiating a new request with
485
+ _zmq_send(3)_ until the reply to the previous one has been received.
486
+ When set to 1, sending another message is allowed and has the effect of
487
+ disconnecting the underlying connection to the peer from which the reply was
488
+ expected, triggering a reconnection attempt on transports that support it.
489
+ The request-reply state machine is reset and a new request is sent to the
490
+ next available peer.
491
+
492
+ If set to 1, also enable ZMQ_REQ_CORRELATE to ensure correct matching of
493
+ requests and replies. Otherwise a late reply to an aborted request can be
494
+ reported as the reply to the superseding request.
495
+
496
+ [horizontal]
497
+ Option value type:: int
498
+ Option value unit:: 0, 1
499
+ Default value:: 0
500
+ Applicable socket types:: ZMQ_REQ
501
+
502
+
402
503
  ZMQ_TCP_KEEPALIVE: Override SO_KEEPALIVE socket option
403
504
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
404
- Override 'SO_KEEPALIVE' socket option(where supported by OS).
505
+
506
+ Override 'SO_KEEPALIVE' socket option (where supported by OS).
405
507
  The default value of `-1` means to skip any overrides and leave it to OS default.
406
508
 
407
509
  [horizontal]
@@ -411,10 +513,12 @@ Default value:: -1 (leave to OS default)
411
513
  Applicable socket types:: all, when using TCP transports.
412
514
 
413
515
 
414
- ZMQ_TCP_KEEPALIVE_IDLE: Override TCP_KEEPCNT(or TCP_KEEPALIVE on some OS)
415
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
416
- Override 'TCP_KEEPCNT'(or 'TCP_KEEPALIVE' on some OS) socket option(where supported by OS).
417
- The default value of `-1` means to skip any overrides and leave it to OS default.
516
+ ZMQ_TCP_KEEPALIVE_IDLE: Override TCP_KEEPCNT (or TCP_KEEPALIVE on some OS)
517
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
518
+
519
+ Override 'TCP_KEEPCNT'(or 'TCP_KEEPALIVE' on some OS) socket option (where
520
+ supported by OS). The default value of `-1` means to skip any overrides and
521
+ leave it to OS default.
418
522
 
419
523
  [horizontal]
420
524
  Option value type:: int
@@ -425,8 +529,9 @@ Applicable socket types:: all, when using TCP transports.
425
529
 
426
530
  ZMQ_TCP_KEEPALIVE_CNT: Override TCP_KEEPCNT socket option
427
531
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
428
- Override 'TCP_KEEPCNT' socket option(where supported by OS).
429
- The default value of `-1` means to skip any overrides and leave it to OS default.
532
+
533
+ Override 'TCP_KEEPCNT' socket option (where supported by OS). The default
534
+ value of `-1` means to skip any overrides and leave it to OS default.
430
535
 
431
536
  [horizontal]
432
537
  Option value type:: int
@@ -437,8 +542,9 @@ Applicable socket types:: all, when using TCP transports.
437
542
 
438
543
  ZMQ_TCP_KEEPALIVE_INTVL: Override TCP_KEEPINTVL socket option
439
544
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
440
- Override 'TCP_KEEPINTVL' socket option(where supported by OS).
441
- The default value of `-1` means to skip any overrides and leave it to OS default.
545
+
546
+ Override 'TCP_KEEPINTVL' socket option(where supported by OS). The default
547
+ value of `-1` means to skip any overrides and leave it to OS default.
442
548
 
443
549
  [horizontal]
444
550
  Option value type:: int
@@ -449,11 +555,12 @@ Applicable socket types:: all, when using TCP transports.
449
555
 
450
556
  ZMQ_TCP_ACCEPT_FILTER: Assign filters to allow new TCP connections
451
557
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
452
- Assign arbitrary number of filters that will be applied for each new TCP transport
453
- connection on a listening socket.
454
- If no filters applied, then TCP transport allows connections from any ip.
455
- If at least one filter is applied then new connection source ip should be matched.
456
- To clear all filters call zmq_setsockopt(socket, ZMQ_TCP_ACCEPT_FILTER, NULL, 0).
558
+
559
+ Assign an arbitrary number of filters that will be applied for each new TCP
560
+ transport connection on a listening socket. If no filters are applied, then
561
+ the TCP transport allows connections from any IP address. If at least one
562
+ filter is applied then new connection source ip should be matched. To clear
563
+ all filters call zmq_setsockopt(socket, ZMQ_TCP_ACCEPT_FILTER, NULL, 0).
457
564
  Filter is a null-terminated string with ipv6 or ipv4 CIDR.
458
565
 
459
566
  [horizontal]
@@ -463,6 +570,151 @@ Default value:: no filters (allow from all)
463
570
  Applicable socket types:: all listening sockets, when using TCP transports.
464
571
 
465
572
 
573
+ ZMQ_PLAIN_SERVER: Set PLAIN server role
574
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
575
+
576
+ Defines whether the socket will act as server for PLAIN security, see
577
+ linkzmq:zmq_plain[7]. A value of '1' means the socket will act as
578
+ PLAIN server. A value of '0' means the socket will not act as PLAIN
579
+ server, and its security role then depends on other option settings.
580
+ Setting this to '0' shall reset the socket security to NULL.
581
+
582
+ [horizontal]
583
+ Option value type:: int
584
+ Option value unit:: 0, 1
585
+ Default value:: 0
586
+ Applicable socket types:: all, when using TCP transport
587
+
588
+
589
+ ZMQ_PLAIN_USERNAME: Set PLAIN security username
590
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
591
+
592
+ Sets the username for outgoing connections over TCP or IPC. If you set this
593
+ to a non-null value, the security mechanism used for connections shall be
594
+ PLAIN, see linkzmq:zmq_plain[7]. If you set this to a null value, the security
595
+ mechanism used for connections shall be NULL, see linkzmq:zmq_null[3].
596
+
597
+ [horizontal]
598
+ Option value type:: character string
599
+ Option value unit:: N/A
600
+ Default value:: not set
601
+ Applicable socket types:: all, when using TCP transport
602
+
603
+
604
+ ZMQ_PLAIN_PASSWORD: Set PLAIN security password
605
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
606
+
607
+ Sets the password for outgoing connections over TCP or IPC. If you set this
608
+ to a non-null value, the security mechanism used for connections shall be
609
+ PLAIN, see linkzmq:zmq_plain[7]. If you set this to a null value, the security
610
+ mechanism used for connections shall be NULL, see linkzmq:zmq_null[3].
611
+
612
+ [horizontal]
613
+ Option value type:: character string
614
+ Option value unit:: N/A
615
+ Default value:: not set
616
+ Applicable socket types:: all, when using TCP transport
617
+
618
+
619
+ ZMQ_CURVE_SERVER: Set CURVE server role
620
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
621
+
622
+ Defines whether the socket will act as server for CURVE security, see
623
+ linkzmq:zmq_curve[7]. A value of '1' means the socket will act as
624
+ CURVE server. A value of '0' means the socket will not act as CURVE
625
+ server, and its security role then depends on other option settings.
626
+ Setting this to '0' shall reset the socket security to NULL. When you
627
+ set this you must also set the ZMQ_CURVE_PUBLICKEY option.
628
+
629
+ [horizontal]
630
+ Option value type:: int
631
+ Option value unit:: 0, 1
632
+ Default value:: 0
633
+ Applicable socket types:: all, when using TCP transport
634
+
635
+
636
+ ZMQ_CURVE_PUBLICKEY: Set CURVE public key
637
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
638
+
639
+ Sets the socket's long term public key. You must set this on a CURVE
640
+ client or server socket, see linkzmq:zmq_curve[7]. You can provide the
641
+ key as 32 binary bytes, or as a 40-character string encoded in the Z85
642
+ encoding format. For servers, the public key must be persisted and
643
+ shared through some unspecified but secure mechanism to clients. The
644
+ public key must always be used with the matching secret key generated
645
+ at the same time. To generate a public/secret key pair, use the
646
+ tools/curve_keygen tool.
647
+
648
+ [horizontal]
649
+ Option value type:: binary data or Z85 text string
650
+ Option value size:: 32 or 40
651
+ Default value:: NULL
652
+ Applicable socket types:: all, when using TCP transport
653
+
654
+
655
+ ZMQ_CURVE_SECRETKEY: Set CURVE secret key
656
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
657
+
658
+ Sets the socket's long term secret key. You must set this on a CURVE
659
+ client socket, see linkzmq:zmq_curve[7]. You can provide the key as
660
+ 32 binary bytes, or as a 40-character string encoded in the Z85 encoding
661
+ format.
662
+
663
+ [horizontal]
664
+ Option value type:: binary data or Z85 text string
665
+ Option value size:: 32 or 40
666
+ Default value:: NULL
667
+ Applicable socket types:: all, when using TCP transport
668
+
669
+
670
+ ZMQ_CURVE_SERVERKEY: Set CURVE server key
671
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
672
+
673
+ Sets the socket's long term server key. You must set this on a CURVE
674
+ client socket, see linkzmq:zmq_curve[7]. You can provide the key as
675
+ 32 binary bytes, or as a 40-character string encoded in the Z85 encoding
676
+ format. This key must be the same as the public key set on the server
677
+ socket.
678
+
679
+ [horizontal]
680
+ Option value type:: binary data or Z85 text string
681
+ Option value size:: 32 or 40
682
+ Default value:: NULL
683
+ Applicable socket types:: all, when using TCP transport
684
+
685
+
686
+ ZMQ_ZAP_DOMAIN: Set RFC 27 authentication domain
687
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
688
+
689
+ Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the
690
+ default on all tcp:// connections), ZAP authentication only happens if you
691
+ set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always
692
+ made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27
693
+ for more details.
694
+
695
+ [horizontal]
696
+ Option value type:: character string
697
+ Option value unit:: N/A
698
+ Default value:: not set
699
+ Applicable socket types:: all, when using TCP transport
700
+
701
+
702
+ ZMQ_CONFLATE: Keep only last message
703
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
704
+
705
+ If set, a socket shall keep only one message in its inbound/outbound
706
+ queue, this message being the last message received/the last message
707
+ to be sent.
708
+ Ignores 'ZMQ_RECVHWM' and 'ZMQ_SENDHWM' options.
709
+ Does not supports multi-part messages, in particular, only one part of it
710
+ is kept in the socket internal queue.
711
+ [horizontal]
712
+ Option value type:: int
713
+ Option value unit:: boolean
714
+ Default value:: 0 (false)
715
+ Applicable socket types:: ZMQ_PULL, ZMQ_PUSH, ZMQ_SUB, ZMQ_PUB, ZMQ_DEALER
716
+
717
+
466
718
  RETURN VALUE
467
719
  ------------
468
720
  The _zmq_setsockopt()_ function shall return zero if successful. Otherwise it
@@ -497,13 +749,13 @@ rc = zmq_setsockopt (socket, ZMQ_SUBSCRIBE, "ANIMALS.CATS", 12);
497
749
  int64_t affinity;
498
750
  /* Incoming connections on TCP port 5555 shall be handled by I/O thread 1 */
499
751
  affinity = 1;
500
- rc = zmq_setsockopt (socket, ZMQ_AFFINITY, &affinity, sizeof affinity);
752
+ rc = zmq_setsockopt (socket, ZMQ_AFFINITY, &affinity, sizeof (affinity));
501
753
  assert (rc);
502
754
  rc = zmq_bind (socket, "tcp://lo:5555");
503
755
  assert (rc);
504
756
  /* Incoming connections on TCP port 5556 shall be handled by I/O thread 2 */
505
757
  affinity = 2;
506
- rc = zmq_setsockopt (socket, ZMQ_AFFINITY, &affinity, sizeof affinity);
758
+ rc = zmq_setsockopt (socket, ZMQ_AFFINITY, &affinity, sizeof (affinity));
507
759
  assert (rc);
508
760
  rc = zmq_bind (socket, "tcp://lo:5556");
509
761
  assert (rc);
@@ -514,10 +766,12 @@ SEE ALSO
514
766
  --------
515
767
  linkzmq:zmq_getsockopt[3]
516
768
  linkzmq:zmq_socket[3]
769
+ linkzmq:zmq_plain[7]
770
+ linkzmq:zmq_curve[7]
517
771
  linkzmq:zmq[7]
518
772
 
519
773
 
520
774
  AUTHORS
521
775
  -------
522
- This 0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
523
- Martin Lucina <mato@kotelna.sk>.
776
+ This page was written by the 0MQ community. To make a change please
777
+ read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.