zmq_setsockopt.txt 60 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528
  1. zmq_setsockopt(3)
  2. =================
  3. NAME
  4. ----
  5. zmq_setsockopt - set 0MQ socket options
  6. SYNOPSIS
  7. --------
  8. *int zmq_setsockopt (void '*socket', int 'option_name', const void '*option_value', size_t 'option_len');*
  9. Caution: All options, with the exception of ZMQ_SUBSCRIBE, ZMQ_UNSUBSCRIBE,
  10. ZMQ_LINGER, ZMQ_ROUTER_HANDOVER, ZMQ_ROUTER_MANDATORY, ZMQ_PROBE_ROUTER,
  11. ZMQ_XPUB_VERBOSE, ZMQ_XPUB_VERBOSER, ZMQ_REQ_CORRELATE,
  12. ZMQ_REQ_RELAXED, ZMQ_SNDHWM and ZMQ_RCVHWM, only take effect for
  13. subsequent socket bind/connects.
  14. Specifically, security options take effect for subsequent bind/connect calls,
  15. and can be changed at any time to affect subsequent binds and/or connects.
  16. DESCRIPTION
  17. -----------
  18. The _zmq_setsockopt()_ function shall set the option specified by the
  19. 'option_name' argument to the value pointed to by the 'option_value' argument
  20. for the 0MQ socket pointed to by the 'socket' argument. The 'option_len'
  21. argument is the size of the option value in bytes. For options taking a value of
  22. type "character string", the provided byte data should either contain no zero
  23. bytes, or end in a single zero byte (terminating ASCII NUL character).
  24. The following socket options can be set with the _zmq_setsockopt()_ function:
  25. ZMQ_AFFINITY: Set I/O thread affinity
  26. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  27. The 'ZMQ_AFFINITY' option shall set the I/O thread affinity for newly created
  28. connections on the specified 'socket'.
  29. Affinity determines which threads from the 0MQ I/O thread pool associated with
  30. the socket's _context_ shall handle newly created connections. A value of zero
  31. specifies no affinity, meaning that work shall be distributed fairly among all
  32. 0MQ I/O threads in the thread pool. For non-zero values, the lowest bit
  33. corresponds to thread 1, second lowest bit to thread 2 and so on. For example,
  34. a value of 3 specifies that subsequent connections on 'socket' shall be handled
  35. exclusively by I/O threads 1 and 2.
  36. See also linkzmq:zmq_init[3] for details on allocating the number of I/O
  37. threads for a specific _context_.
  38. [horizontal]
  39. Option value type:: uint64_t
  40. Option value unit:: N/A (bitmap)
  41. Default value:: 0
  42. Applicable socket types:: N/A
  43. ZMQ_BACKLOG: Set maximum length of the queue of outstanding connections
  44. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  45. The 'ZMQ_BACKLOG' option shall set the maximum length of the queue of
  46. outstanding peer connections for the specified 'socket'; this only applies to
  47. connection-oriented transports. For details refer to your operating system
  48. documentation for the 'listen' function.
  49. [horizontal]
  50. Option value type:: int
  51. Option value unit:: connections
  52. Default value:: 100
  53. Applicable socket types:: all, only for connection-oriented transports.
  54. ZMQ_BINDTODEVICE: Set name of device to bind the socket to
  55. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  56. The 'ZMQ_BINDTODEVICE' option binds this socket to a particular device, eg.
  57. an interface or VRF. If a socket is bound to an interface, only packets
  58. received from that particular interface are processed by the socket. If device
  59. is a VRF device, then subsequent binds/connects to that socket use addresses
  60. in the VRF routing table.
  61. NOTE: requires setting CAP_NET_RAW on the compiled program.
  62. [horizontal]
  63. Option value type:: character string
  64. Option value unit:: N/A
  65. Default value:: not set
  66. Applicable socket types:: all, when using TCP or UDP transports.
  67. ZMQ_CONNECT_RID: Assign the next outbound connection id
  68. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  69. This option name is now deprecated. Use ZMQ_CONNECT_ROUTING_ID instead.
  70. ZMQ_CONNECT_RID remains as an alias for now.
  71. ZMQ_CONNECT_ROUTING_ID: Assign the next outbound routing id
  72. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  73. The 'ZMQ_CONNECT_ROUTING_ID' option sets the peer id of the peer connected
  74. via the next zmq_connect() call, such that that connection is immediately ready for
  75. data transfer with the given routing id. This option applies only to the first
  76. subsequent call to zmq_connect(), zmq_connect() calls thereafter use the default
  77. connection behaviour.
  78. Typical use is to set this socket option ahead of each zmq_connect() call.
  79. Each connection MUST be assigned a unique routing id. Assigning a
  80. routing id that is already in use is not allowed.
  81. Useful when connecting ROUTER to ROUTER, or STREAM to STREAM, as it
  82. allows for immediate sending to peers. Outbound routing id framing requirements
  83. for ROUTER and STREAM sockets apply.
  84. The routing id must be from 1 to 255 bytes long and MAY NOT start with
  85. a zero byte (such routing ids are reserved for internal use by the 0MQ
  86. infrastructure).
  87. [horizontal]
  88. Option value type:: binary data
  89. Option value unit:: N/A
  90. Default value:: NULL
  91. Applicable socket types:: ZMQ_ROUTER, ZMQ_STREAM
  92. ZMQ_CONFLATE: Keep only last message
  93. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  94. If set, a socket shall keep only one message in its inbound/outbound
  95. queue, this message being the last message received/the last message
  96. to be sent. Ignores 'ZMQ_RCVHWM' and 'ZMQ_SNDHWM' options. Does not
  97. support multi-part messages, in particular, only one part of it is kept
  98. in the socket internal queue.
  99. NOTE: If recv is not called on the inbound socket, the queue and memory will
  100. grow with each message received. Use linkzmq:zmq_getsockopt[3] with ZMQ_EVENTS
  101. to trigger the conflation of the messages.
  102. [horizontal]
  103. Option value type:: int
  104. Option value unit:: boolean
  105. Default value:: 0 (false)
  106. Applicable socket types:: ZMQ_PULL, ZMQ_PUSH, ZMQ_SUB, ZMQ_PUB, ZMQ_DEALER
  107. ZMQ_CONNECT_TIMEOUT: Set connect() timeout
  108. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  109. Sets how long to wait before timing-out a connect() system call.
  110. The connect() system call normally takes a long time before it returns a
  111. time out error. Setting this option allows the library to time out the call
  112. at an earlier interval.
  113. [horizontal]
  114. Option value type:: int
  115. Option value unit:: milliseconds
  116. Default value:: 0 (disabled)
  117. Applicable socket types:: all, when using TCP transports.
  118. ZMQ_CURVE_PUBLICKEY: Set CURVE public key
  119. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  120. Sets the socket's long term public key. You must set this on CURVE client
  121. sockets, see linkzmq:zmq_curve[7]. You can provide the key as 32 binary
  122. bytes, or as a 40-character string encoded in the Z85 encoding format and
  123. terminated in a null byte. The public key must always be used with the
  124. matching secret key. To generate a public/secret key pair, use
  125. linkzmq:zmq_curve_keypair[3]. To derive the public key from a secret key,
  126. use linkzmq:zmq_curve_public[3].
  127. NOTE: an option value size of 40 is supported for backwards compatibility,
  128. though is deprecated.
  129. [horizontal]
  130. Option value type:: binary data or Z85 text string
  131. Option value size:: 32 or 41
  132. Default value:: NULL
  133. Applicable socket types:: all, when using TCP transport
  134. ZMQ_CURVE_SECRETKEY: Set CURVE secret key
  135. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  136. Sets the socket's long term secret key. You must set this on both CURVE
  137. client and server sockets, see linkzmq:zmq_curve[7]. You can provide the
  138. key as 32 binary bytes, or as a 40-character string encoded in the Z85
  139. encoding format and terminated in a null byte. To generate a public/secret
  140. key pair, use linkzmq:zmq_curve_keypair[3]. To derive the public key from
  141. a secret key, use linkzmq:zmq_curve_public[3].
  142. NOTE: an option value size of 40 is supported for backwards compatibility,
  143. though is deprecated.
  144. [horizontal]
  145. Option value type:: binary data or Z85 text string
  146. Option value size:: 32 or 41
  147. Default value:: NULL
  148. Applicable socket types:: all, when using TCP transport
  149. ZMQ_CURVE_SERVER: Set CURVE server role
  150. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  151. Defines whether the socket will act as server for CURVE security, see
  152. linkzmq:zmq_curve[7]. A value of '1' means the socket will act as
  153. CURVE server. A value of '0' means the socket will not act as CURVE
  154. server, and its security role then depends on other option settings.
  155. Setting this to '0' shall reset the socket security to NULL. When you
  156. set this you must also set the server's secret key using the
  157. ZMQ_CURVE_SECRETKEY option. A server socket does not need to know
  158. its own public key.
  159. [horizontal]
  160. Option value type:: int
  161. Option value unit:: 0, 1
  162. Default value:: 0
  163. Applicable socket types:: all, when using TCP transport
  164. ZMQ_CURVE_SERVERKEY: Set CURVE server key
  165. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  166. Sets the socket's long term server key. You must set this on CURVE client
  167. sockets, see linkzmq:zmq_curve[7]. You can provide the key as 32 binary
  168. bytes, or as a 40-character string encoded in the Z85 encoding format and
  169. terminated in a null byte. This key must have been generated together with
  170. the server's secret key. To generate a public/secret key pair, use
  171. linkzmq:zmq_curve_keypair[3].
  172. NOTE: an option value size of 40 is supported for backwards compatibility,
  173. though is deprecated.
  174. [horizontal]
  175. Option value type:: binary data or Z85 text string
  176. Option value size:: 32 or 41
  177. Default value:: NULL
  178. Applicable socket types:: all, when using TCP transport
  179. ZMQ_DISCONNECT_MSG: set a disconnect message that the socket will generate when accepted peer disconnect
  180. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  181. When set, the socket will generate a disconnect message when accepted peer has been disconnected.
  182. You may set this on ROUTER, SERVER and PEER sockets.
  183. The combination with ZMQ_HEARTBEAT_IVL is powerful and simplify protocols, when heartbeat recognize a connection drop it
  184. will generate a disconnect message that can match the protocol of the application.
  185. [horizontal]
  186. Option value type:: binary data
  187. Option value unit:: N/A
  188. Default value:: NULL
  189. Applicable socket types:: ZMQ_ROUTER, ZMQ_SERVER and ZMQ_PEER
  190. ZMQ_GSSAPI_PLAINTEXT: Disable GSSAPI encryption
  191. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  192. Defines whether communications on the socket will be encrypted, see
  193. linkzmq:zmq_gssapi[7]. A value of '1' means that communications will be
  194. plaintext. A value of '0' means communications will be encrypted.
  195. [horizontal]
  196. Option value type:: int
  197. Option value unit:: 0, 1
  198. Default value:: 0 (false)
  199. Applicable socket types:: all, when using TCP transport
  200. ZMQ_GSSAPI_PRINCIPAL: Set name of GSSAPI principal
  201. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  202. Sets the name of the principal for whom GSSAPI credentials should be acquired.
  203. [horizontal]
  204. Option value type:: character string
  205. Option value unit:: N/A
  206. Default value:: not set
  207. Applicable socket types:: all, when using TCP transport
  208. ZMQ_GSSAPI_SERVER: Set GSSAPI server role
  209. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  210. Defines whether the socket will act as server for GSSAPI security, see
  211. linkzmq:zmq_gssapi[7]. A value of '1' means the socket will act as GSSAPI
  212. server. A value of '0' means the socket will act as GSSAPI client.
  213. [horizontal]
  214. Option value type:: int
  215. Option value unit:: 0, 1
  216. Default value:: 0 (false)
  217. Applicable socket types:: all, when using TCP transport
  218. ZMQ_GSSAPI_SERVICE_PRINCIPAL: Set name of GSSAPI service principal
  219. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  220. Sets the name of the principal of the GSSAPI server to which a GSSAPI client
  221. intends to connect.
  222. [horizontal]
  223. Option value type:: character string
  224. Option value unit:: N/A
  225. Default value:: not set
  226. Applicable socket types:: all, when using TCP transport
  227. ZMQ_GSSAPI_SERVICE_PRINCIPAL_NAMETYPE: Set name type of service principal
  228. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  229. Sets the name type of the GSSAPI service principal. A value of
  230. 'ZMQ_GSSAPI_NT_HOSTBASED' (0) means the name specified with
  231. 'ZMQ_GSSAPI_SERVICE_PRINCIPAL' is interpreted as a host based name. A value
  232. of 'ZMQ_GSSAPI_NT_USER_NAME' (1) means it is interpreted as a local user name.
  233. A value of 'ZMQ_GSSAPI_NT_KRB5_PRINCIPAL' (2) means it is interpreted as an
  234. unparsed principal name string (valid only with the krb5 GSSAPI mechanism).
  235. [horizontal]
  236. Option value type:: int
  237. Option value unit:: 0, 1, 2
  238. Default value:: 0 (ZMQ_GSSAPI_NT_HOSTBASED)
  239. Applicable socket types:: all, when using TCP or IPC transport
  240. ZMQ_GSSAPI_PRINCIPAL_NAMETYPE: Set name type of principal
  241. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  242. Sets the name type of the GSSAPI principal. A value of
  243. 'ZMQ_GSSAPI_NT_HOSTBASED' (0) means the name specified with
  244. 'ZMQ_GSSAPI_PRINCIPAL' is interpreted as a host based name. A value of
  245. 'ZMQ_GSSAPI_NT_USER_NAME' (1) means it is interpreted as a local user name.
  246. A value of 'ZMQ_GSSAPI_NT_KRB5_PRINCIPAL' (2) means it is interpreted as an
  247. unparsed principal name string (valid only with the krb5 GSSAPI mechanism).
  248. [horizontal]
  249. Option value type:: int
  250. Option value unit:: 0, 1, 2
  251. Default value:: 0 (ZMQ_GSSAPI_NT_HOSTBASED)
  252. Applicable socket types:: all, when using TCP or IPC transport
  253. ZMQ_HANDSHAKE_IVL: Set maximum handshake interval
  254. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  255. The 'ZMQ_HANDSHAKE_IVL' option shall set the maximum handshake interval for
  256. the specified 'socket'. Handshaking is the exchange of socket configuration
  257. information (socket type, routing id, security) that occurs when a connection
  258. is first opened, only for connection-oriented transports. If handshaking does
  259. not complete within the configured time, the connection shall be closed.
  260. The value 0 means no handshake time limit.
  261. [horizontal]
  262. Option value type:: int
  263. Option value unit:: milliseconds
  264. Default value:: 30000
  265. Applicable socket types:: all but ZMQ_STREAM, only for connection-oriented transports
  266. ZMQ_HELLO_MSG: set an hello message that will be sent when a new peer connect
  267. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  268. When set, the socket will automatically send an hello message when a new connection is made or accepted.
  269. You may set this on DEALER, ROUTER, CLIENT, SERVER and PEER sockets.
  270. The combination with ZMQ_HEARTBEAT_IVL is powerful and simplify protocols,
  271. as now heartbeat and sending the hello message can be left out of protocols and be handled by zeromq.
  272. [horizontal]
  273. Option value type:: binary data
  274. Option value unit:: N/A
  275. Default value:: NULL
  276. Applicable socket types:: ZMQ_ROUTER, ZMQ_DEALER, ZMQ_CLIENT, ZMQ_SERVER and ZMQ_PEER
  277. ZMQ_HEARTBEAT_IVL: Set interval between sending ZMTP heartbeats
  278. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  279. The 'ZMQ_HEARTBEAT_IVL' option shall set the interval between sending ZMTP heartbeats
  280. for the specified 'socket'. If this option is set and is greater than 0, then a 'PING'
  281. ZMTP command will be sent every 'ZMQ_HEARTBEAT_IVL' milliseconds.
  282. [horizontal]
  283. Option value type:: int
  284. Option value unit:: milliseconds
  285. Default value:: 0
  286. Applicable socket types:: all, when using connection-oriented transports
  287. ZMQ_HEARTBEAT_TIMEOUT: Set timeout for ZMTP heartbeats
  288. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  289. The 'ZMQ_HEARTBEAT_TIMEOUT' option shall set how long to wait before timing-out a
  290. connection after sending a 'PING' ZMTP command and not receiving any traffic. This
  291. option is only valid if 'ZMQ_HEARTBEAT_IVL' is also set, and is greater than 0. The
  292. connection will time out if there is no traffic received after sending the 'PING'
  293. command, but the received traffic does not have to be a 'PONG' command - any received
  294. traffic will cancel the timeout.
  295. [horizontal]
  296. Option value type:: int
  297. Option value unit:: milliseconds
  298. Default value:: 0 normally, ZMQ_HEARTBEAT_IVL if it is set
  299. Applicable socket types:: all, when using connection-oriented transports
  300. ZMQ_HEARTBEAT_TTL: Set the TTL value for ZMTP heartbeats
  301. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  302. The 'ZMQ_HEARTBEAT_TTL' option shall set the timeout on the remote peer for ZMTP
  303. heartbeats. If this option is greater than 0, the remote side shall time out the
  304. connection if it does not receive any more traffic within the TTL period. This option
  305. does not have any effect if 'ZMQ_HEARTBEAT_IVL' is not set or is 0. Internally, this
  306. value is rounded down to the nearest decisecond, any value less than 100 will have
  307. no effect.
  308. [horizontal]
  309. Option value type:: int
  310. Option value unit:: milliseconds
  311. Default value:: 0
  312. Maximum value:: 6553599 (which is 2^16-1 deciseconds)
  313. Applicable socket types:: all, when using connection-oriented transports
  314. ZMQ_IDENTITY: Set socket identity
  315. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  316. This option name is now deprecated. Use ZMQ_ROUTING_ID instead.
  317. ZMQ_IDENTITY remains as an alias for now.
  318. ZMQ_IMMEDIATE: Queue messages only to completed connections
  319. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  320. By default queues will fill on outgoing connections even if the connection has
  321. not completed. This can lead to "lost" messages on sockets with round-robin
  322. routing (REQ, PUSH, DEALER). If this option is set to `1`, messages shall be
  323. queued only to completed connections. This will cause the socket to block if
  324. there are no other connections, but will prevent queues from filling on pipes
  325. awaiting connection.
  326. [horizontal]
  327. Option value type:: int
  328. Option value unit:: boolean
  329. Default value:: 0 (false)
  330. Applicable socket types:: all, only for connection-oriented transports.
  331. ZMQ_INVERT_MATCHING: Invert message filtering
  332. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  333. Reverses the filtering behavior of PUB-SUB sockets, when set to 1.
  334. On 'PUB' and 'XPUB' sockets, this causes messages to be sent to all
  335. connected sockets 'except' those subscribed to a prefix that matches
  336. the message. On 'SUB' sockets, this causes only incoming messages that
  337. do 'not' match any of the socket's subscriptions to be received by the user.
  338. Whenever 'ZMQ_INVERT_MATCHING' is set to 1 on a 'PUB' socket, all 'SUB'
  339. sockets connecting to it must also have the option set to 1. Failure to
  340. do so will have the 'SUB' sockets reject everything the 'PUB' socket sends
  341. them. 'XSUB' sockets do not need to do this because they do not filter
  342. incoming messages.
  343. [horizontal]
  344. Option value type:: int
  345. Option value unit:: 0,1
  346. Default value:: 0
  347. Applicable socket types:: ZMQ_PUB, ZMQ_XPUB, ZMQ_SUB
  348. ZMQ_IPV6: Enable IPv6 on socket
  349. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  350. Set the IPv6 option for the socket. A value of `1` means IPv6 is
  351. enabled on the socket, while `0` means the socket will use only IPv4.
  352. When IPv6 is enabled the socket will connect to, or accept connections
  353. from, both IPv4 and IPv6 hosts.
  354. [horizontal]
  355. Option value type:: int
  356. Option value unit:: boolean
  357. Default value:: 0 (false)
  358. Applicable socket types:: all, when using TCP transports.
  359. ZMQ_LINGER: Set linger period for socket shutdown
  360. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  361. The 'ZMQ_LINGER' option shall set the linger period for the specified 'socket'.
  362. The linger period determines how long pending messages which have yet to be
  363. sent to a peer shall linger in memory after a socket is disconnected with
  364. linkzmq:zmq_disconnect[3] or closed with linkzmq:zmq_close[3], and further
  365. affects the termination of the socket's context with linkzmq:zmq_ctx_term[3].
  366. The following outlines the different behaviours:
  367. * A value of '-1' specifies an infinite linger period. Pending
  368. messages shall not be discarded after a call to _zmq_disconnect()_ or
  369. _zmq_close()_; attempting to terminate the socket's context with _zmq_ctx_term()_
  370. shall block until all pending messages have been sent to a peer.
  371. * The value of '0' specifies no linger period. Pending messages shall be
  372. discarded immediately after a call to _zmq_disconnect()_ or _zmq_close()_.
  373. * Positive values specify an upper bound for the linger period in milliseconds.
  374. Pending messages shall not be discarded after a call to _zmq_disconnect()_ or
  375. _zmq_close()_; attempting to terminate the socket's context with _zmq_ctx_term()_
  376. shall block until either all pending messages have been sent to a peer, or the
  377. linger period expires, after which any pending messages shall be discarded.
  378. [horizontal]
  379. Option value type:: int
  380. Option value unit:: milliseconds
  381. Default value:: -1 (infinite)
  382. Applicable socket types:: all
  383. ZMQ_MAXMSGSIZE: Maximum acceptable inbound message size
  384. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  385. Limits the size of the inbound message. If a peer sends a message larger than
  386. ZMQ_MAXMSGSIZE it is disconnected. Value of -1 means 'no limit'.
  387. [horizontal]
  388. Option value type:: int64_t
  389. Option value unit:: bytes
  390. Default value:: -1
  391. Applicable socket types:: all
  392. ZMQ_METADATA: Add application metadata properties to a socket
  393. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  394. The _ZMQ_METADATA_ option shall add application metadata to the specified _socket_,
  395. the metadata is exchanged with peers during connection setup. A metadata property is
  396. specfied as a string, delimited by a colon, starting with the metadata _property_
  397. followed by the metadata value, for example "X-key:value".
  398. _Property_ names are restrited to maximum 255 characters and must be prefixed by "X-".
  399. Multiple application metadata properties can be added to a socket by executing zmq_setsockopt()
  400. multiple times. As the argument is a null-terminated string, binary data must be encoded
  401. before it is added e.g. using Z85 (linkzmq:zmq_z85_encode[3]).
  402. NOTE: in DRAFT state, not yet available in stable releases.
  403. [horizontal]
  404. Option value type:: character string
  405. Option value unit:: N/A
  406. Default value:: not set
  407. Applicable socket types:: all
  408. ZMQ_MULTICAST_HOPS: Maximum network hops for multicast packets
  409. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  410. Sets the time-to-live field in every multicast packet sent from this socket.
  411. The default is 1 which means that the multicast packets don't leave the local
  412. network.
  413. [horizontal]
  414. Option value type:: int
  415. Option value unit:: network hops
  416. Default value:: 1
  417. Applicable socket types:: all, when using multicast transports
  418. ZMQ_MULTICAST_MAXTPDU: Maximum transport data unit size for multicast packets
  419. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  420. Sets the maximum transport data unit size used for outbound multicast
  421. packets.
  422. This must be set at or below the minimum Maximum Transmission Unit (MTU) for
  423. all network paths over which multicast reception is required.
  424. [horizontal]
  425. Option value type:: int
  426. Option value unit:: bytes
  427. Default value:: 1500
  428. Applicable socket types:: all, when using multicast transports
  429. ZMQ_PLAIN_PASSWORD: Set PLAIN security password
  430. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  431. Sets the password for outgoing connections over TCP or IPC. If you set this
  432. to a non-null value, the security mechanism used for connections shall be
  433. PLAIN, see linkzmq:zmq_plain[7]. If you set this to a null value, the security
  434. mechanism used for connections shall be NULL, see linkzmq:zmq_null[3].
  435. [horizontal]
  436. Option value type:: character string
  437. Option value unit:: N/A
  438. Default value:: not set
  439. Applicable socket types:: all, when using TCP transport
  440. ZMQ_PLAIN_SERVER: Set PLAIN server role
  441. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  442. Defines whether the socket will act as server for PLAIN security, see
  443. linkzmq:zmq_plain[7]. A value of '1' means the socket will act as
  444. PLAIN server. A value of '0' means the socket will not act as PLAIN
  445. server, and its security role then depends on other option settings.
  446. Setting this to '0' shall reset the socket security to NULL.
  447. [horizontal]
  448. Option value type:: int
  449. Option value unit:: 0, 1
  450. Default value:: 0
  451. Applicable socket types:: all, when using TCP transport
  452. ZMQ_PLAIN_USERNAME: Set PLAIN security username
  453. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  454. Sets the username for outgoing connections over TCP or IPC. If you set this
  455. to a non-null value, the security mechanism used for connections shall be
  456. PLAIN, see linkzmq:zmq_plain[7]. If you set this to a null value, the security
  457. mechanism used for connections shall be NULL, see linkzmq:zmq_null[3].
  458. [horizontal]
  459. Option value type:: character string
  460. Option value unit:: N/A
  461. Default value:: not set
  462. Applicable socket types:: all, when using TCP transport
  463. ZMQ_USE_FD: Set the pre-allocated socket file descriptor
  464. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  465. When set to a positive integer value before zmq_bind is called on the socket,
  466. the socket shall use the corresponding file descriptor for connections over
  467. TCP or IPC instead of allocating a new file descriptor.
  468. Useful for writing systemd socket activated services. If set to -1 (default),
  469. a new file descriptor will be allocated instead (default behaviour).
  470. NOTE: if set after calling zmq_bind, this option shall have no effect.
  471. NOTE: the file descriptor passed through MUST have been ran through the "bind"
  472. and "listen" system calls beforehand. Also, socket option that would
  473. normally be passed through zmq_setsockopt like TCP buffers length,
  474. IP_TOS or SO_REUSEADDR MUST be set beforehand by the caller, as they
  475. must be set before the socket is bound.
  476. [horizontal]
  477. Option value type:: int
  478. Option value unit:: file descriptor
  479. Default value:: -1
  480. Applicable socket types:: all bound sockets, when using IPC or TCP transport
  481. ZMQ_PROBE_ROUTER: bootstrap connections to ROUTER sockets
  482. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  483. When set to 1, the socket will automatically send an empty message when a
  484. new connection is made or accepted. You may set this on REQ, DEALER, or
  485. ROUTER sockets connected to a ROUTER socket. The application must filter
  486. such empty messages. The ZMQ_PROBE_ROUTER option in effect provides the
  487. ROUTER application with an event signaling the arrival of a new peer.
  488. NOTE: do not set this option on a socket that talks to any other socket
  489. types: the results are undefined.
  490. [horizontal]
  491. Option value type:: int
  492. Option value unit:: 0, 1
  493. Default value:: 0
  494. Applicable socket types:: ZMQ_ROUTER, ZMQ_DEALER, ZMQ_REQ
  495. ZMQ_RATE: Set multicast data rate
  496. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  497. The 'ZMQ_RATE' option shall set the maximum send or receive data rate for
  498. multicast transports such as linkzmq:zmq_pgm[7] using the specified 'socket'.
  499. [horizontal]
  500. Option value type:: int
  501. Option value unit:: kilobits per second
  502. Default value:: 100
  503. Applicable socket types:: all, when using multicast transports
  504. ZMQ_RCVBUF: Set kernel receive buffer size
  505. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  506. The 'ZMQ_RCVBUF' option shall set the underlying kernel receive buffer size for
  507. the 'socket' to the specified size in bytes. A value of -1 means leave the
  508. OS default unchanged. For details refer to your operating system documentation
  509. for the 'SO_RCVBUF' socket option.
  510. [horizontal]
  511. Option value type:: int
  512. Option value unit:: bytes
  513. Default value:: -1
  514. Applicable socket types:: all
  515. ZMQ_RCVHWM: Set high water mark for inbound messages
  516. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  517. The 'ZMQ_RCVHWM' option shall set the high water mark for inbound messages on
  518. the specified 'socket'. The high water mark is a hard limit on the maximum
  519. number of outstanding messages 0MQ shall queue in memory for any single peer
  520. that the specified 'socket' is communicating with. A value of zero means no
  521. limit.
  522. If this limit has been reached the socket shall enter an exceptional state and
  523. depending on the socket type, 0MQ shall take appropriate action such as
  524. blocking or dropping sent messages. Refer to the individual socket descriptions
  525. in linkzmq:zmq_socket[3] for details on the exact action taken for each socket
  526. type.
  527. NOTE: 0MQ does not guarantee that the socket will be able to queue as many as ZMQ_RCVHWM
  528. messages, and the actual limit may be lower or higher, depending on socket transport.
  529. A notable example is for sockets using TCP transport; see linkzmq:zmq_tcp[7].
  530. [horizontal]
  531. Option value type:: int
  532. Option value unit:: messages
  533. Default value:: 1000
  534. Applicable socket types:: all
  535. ZMQ_RCVTIMEO: Maximum time before a recv operation returns with EAGAIN
  536. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  537. Sets the timeout for receive operation on the socket. If the value is `0`,
  538. _zmq_recv(3)_ will return immediately, with a EAGAIN error if there is no
  539. message to receive. If the value is `-1`, it will block until a message is
  540. available. For all other values, it will wait for a message for that amount
  541. of time before returning with an EAGAIN error.
  542. [horizontal]
  543. Option value type:: int
  544. Option value unit:: milliseconds
  545. Default value:: -1 (infinite)
  546. Applicable socket types:: all
  547. ZMQ_RECONNECT_IVL: Set reconnection interval
  548. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  549. The 'ZMQ_RECONNECT_IVL' option shall set the initial reconnection interval for
  550. the specified 'socket'. The reconnection interval is the period 0MQ
  551. shall wait between attempts to reconnect disconnected peers when using
  552. connection-oriented transports. The value -1 means no reconnection.
  553. NOTE: The reconnection interval may be randomized by 0MQ to prevent
  554. reconnection storms in topologies with a large number of peers per socket.
  555. [horizontal]
  556. Option value type:: int
  557. Option value unit:: milliseconds
  558. Default value:: 100
  559. Applicable socket types:: all, only for connection-oriented transports
  560. ZMQ_RECONNECT_IVL_MAX: Set maximum reconnection interval
  561. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  562. The 'ZMQ_RECONNECT_IVL_MAX' option shall set the maximum reconnection interval
  563. for the specified 'socket'. This is the maximum period 0MQ shall wait between
  564. attempts to reconnect. On each reconnect attempt, the previous interval shall be
  565. doubled untill ZMQ_RECONNECT_IVL_MAX is reached. This allows for exponential
  566. backoff strategy. Default value means no exponential backoff is performed and
  567. reconnect interval calculations are only based on ZMQ_RECONNECT_IVL.
  568. NOTE: Values less than ZMQ_RECONNECT_IVL will be ignored.
  569. [horizontal]
  570. Option value type:: int
  571. Option value unit:: milliseconds
  572. Default value:: 0 (only use ZMQ_RECONNECT_IVL)
  573. Applicable socket types:: all, only for connection-oriented transports
  574. ZMQ_RECONNECT_STOP: Set condition where reconnection will stop
  575. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  576. The 'ZMQ_RECONNECT_STOP' option shall set the conditions under which automatic
  577. reconnection will stop. This can be useful when a process binds to a
  578. wild-card port, where the OS supplies an ephemeral port.
  579. The 'ZMQ_RECONNECT_STOP_CONN_REFUSED' option will stop reconnection when 0MQ
  580. receives the ECONNREFUSED return code from the connect. This indicates that
  581. there is no code bound to the specified endpoint.
  582. The 'ZMQ_RECONNECT_STOP_HANDSHAKE_FAILED' option will stop reconnection if
  583. the 0MQ handshake fails. This can be used to detect and/or prevent errant
  584. connection attempts to non-0MQ sockets. Note that when specifying this option
  585. you may also want to set `ZMQ_HANDSHAKE_IVL` -- the default handshake interval
  586. is 30000 (30 seconds), which is typically too large.
  587. NOTE: in DRAFT state, not yet available in stable releases.
  588. [horizontal]
  589. Option value type:: int
  590. Option value unit:: 0, ZMQ_RECONNECT_STOP_CONN_REFUSED, ZMQ_RECONNECT_STOP_HANDSHAKE_FAILED, ZMQ_RECONNECT_STOP_CONN_REFUSED | ZMQ_RECONNECT_STOP_HANDSHAKE_FAILED
  591. Default value:: 0
  592. Applicable socket types:: all, only for connection-oriented transports (ZMQ_HANDSHAKE_IVL is
  593. not applicable for ZMQ_STREAM sockets)
  594. ZMQ_RECOVERY_IVL: Set multicast recovery interval
  595. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  596. The 'ZMQ_RECOVERY_IVL' option shall set the recovery interval for multicast
  597. transports using the specified 'socket'. The recovery interval determines the
  598. maximum time in milliseconds that a receiver can be absent from a multicast
  599. group before unrecoverable data loss will occur.
  600. CAUTION: Exercise care when setting large recovery intervals as the data
  601. needed for recovery will be held in memory. For example, a 1 minute recovery
  602. interval at a data rate of 1Gbps requires a 7GB in-memory buffer.
  603. [horizontal]
  604. Option value type:: int
  605. Option value unit:: milliseconds
  606. Default value:: 10000
  607. Applicable socket types:: all, when using multicast transports
  608. ZMQ_REQ_CORRELATE: match replies with requests
  609. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  610. The default behaviour of REQ sockets is to rely on the ordering of messages to
  611. match requests and responses and that is usually sufficient. When this option
  612. is set to 1, the REQ socket will prefix outgoing messages with an extra frame
  613. containing a request id. That means the full message is (request id, 0,
  614. user frames...). The REQ socket will discard all incoming messages that don't
  615. begin with these two frames.
  616. [horizontal]
  617. Option value type:: int
  618. Option value unit:: 0, 1
  619. Default value:: 0
  620. Applicable socket types:: ZMQ_REQ
  621. ZMQ_REQ_RELAXED: relax strict alternation between request and reply
  622. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  623. By default, a REQ socket does not allow initiating a new request with
  624. _zmq_send(3)_ until the reply to the previous one has been received.
  625. When set to 1, sending another message is allowed and previous replies will
  626. be discarded if any. The request-reply state machine is reset and a new
  627. request is sent to the next available peer.
  628. If set to 1, also enable ZMQ_REQ_CORRELATE to ensure correct matching of
  629. requests and replies. Otherwise a late reply to an aborted request can be
  630. reported as the reply to the superseding request.
  631. [horizontal]
  632. Option value type:: int
  633. Option value unit:: 0, 1
  634. Default value:: 0
  635. Applicable socket types:: ZMQ_REQ
  636. ZMQ_ROUTER_HANDOVER: handle duplicate client routing ids on ROUTER sockets
  637. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  638. If two clients use the same routing id when connecting to a ROUTER, the
  639. results shall depend on the ZMQ_ROUTER_HANDOVER option setting. If that
  640. is not set (or set to the default of zero), the ROUTER socket shall reject
  641. clients trying to connect with an already-used routing id. If that option
  642. is set to 1, the ROUTER socket shall hand-over the connection to the new
  643. client and disconnect the existing one.
  644. [horizontal]
  645. Option value type:: int
  646. Option value unit:: 0, 1
  647. Default value:: 0
  648. Applicable socket types:: ZMQ_ROUTER
  649. ZMQ_ROUTER_MANDATORY: accept only routable messages on ROUTER sockets
  650. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  651. Sets the ROUTER socket behaviour when an unroutable message is encountered. A
  652. value of `0` is the default and discards the message silently when it cannot be
  653. routed or the peers SNDHWM is reached. A value of `1` returns an
  654. 'EHOSTUNREACH' error code if the message cannot be routed or 'EAGAIN' error
  655. code if the SNDHWM is reached and ZMQ_DONTWAIT was used. Without ZMQ_DONTWAIT
  656. it will block until the SNDTIMEO is reached or a spot in the send queue opens
  657. up.
  658. When ZMQ_ROUTER_MANDATORY is set to `1`, 'ZMQ_POLLOUT' events will be generated
  659. if one or more messages can be sent to at least one of the peers. If
  660. ZMQ_ROUTER_MANDATORY is set to `0`, the socket will generate a 'ZMQ_POLLOUT'
  661. event on every call to 'zmq_poll' resp. 'zmq_poller_wait_all'.
  662. [horizontal]
  663. Option value type:: int
  664. Option value unit:: 0, 1
  665. Default value:: 0
  666. Applicable socket types:: ZMQ_ROUTER
  667. ZMQ_ROUTER_RAW: switch ROUTER socket to raw mode
  668. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  669. Sets the raw mode on the ROUTER, when set to 1. When the ROUTER socket is in
  670. raw mode, and when using the tcp:// transport, it will read and write TCP data
  671. without 0MQ framing. This lets 0MQ applications talk to non-0MQ applications.
  672. When using raw mode, you cannot set explicit identities, and the ZMQ_SNDMORE
  673. flag is ignored when sending data messages. In raw mode you can close a specific
  674. connection by sending it a zero-length message (following the routing id frame).
  675. NOTE: This option is deprecated, please use ZMQ_STREAM sockets instead.
  676. [horizontal]
  677. Option value type:: int
  678. Option value unit:: 0, 1
  679. Default value:: 0
  680. Applicable socket types:: ZMQ_ROUTER
  681. ZMQ_ROUTING_ID: Set socket routing id
  682. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  683. The 'ZMQ_ROUTING_ID' option shall set the routing id of the specified 'socket'
  684. when connecting to a ROUTER socket.
  685. A routing id must be at least one byte and at most 255 bytes long. Identities
  686. starting with a zero byte are reserved for use by the 0MQ infrastructure.
  687. If two clients use the same routing id when connecting to a ROUTER, the
  688. results shall depend on the ZMQ_ROUTER_HANDOVER option setting. If that
  689. is not set (or set to the default of zero), the ROUTER socket shall reject
  690. clients trying to connect with an already-used routing id. If that option
  691. is set to 1, the ROUTER socket shall hand-over the connection to the new
  692. client and disconnect the existing one.
  693. [horizontal]
  694. Option value type:: binary data
  695. Option value unit:: N/A
  696. Default value:: NULL
  697. Applicable socket types:: ZMQ_REQ, ZMQ_REP, ZMQ_ROUTER, ZMQ_DEALER.
  698. ZMQ_SNDBUF: Set kernel transmit buffer size
  699. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  700. The 'ZMQ_SNDBUF' option shall set the underlying kernel transmit buffer size
  701. for the 'socket' to the specified size in bytes. A value of -1 means leave
  702. the OS default unchanged. For details please refer to your operating system
  703. documentation for the 'SO_SNDBUF' socket option.
  704. [horizontal]
  705. Option value type:: int
  706. Option value unit:: bytes
  707. Default value:: -1
  708. Applicable socket types:: all
  709. ZMQ_SNDHWM: Set high water mark for outbound messages
  710. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  711. The 'ZMQ_SNDHWM' option shall set the high water mark for outbound messages on
  712. the specified 'socket'. The high water mark is a hard limit on the maximum
  713. number of outstanding messages 0MQ shall queue in memory for any single peer
  714. that the specified 'socket' is communicating with. A value of zero means no
  715. limit.
  716. If this limit has been reached the socket shall enter an exceptional state and
  717. depending on the socket type, 0MQ shall take appropriate action such as
  718. blocking or dropping sent messages. Refer to the individual socket descriptions
  719. in linkzmq:zmq_socket[3] for details on the exact action taken for each socket
  720. type.
  721. NOTE: 0MQ does not guarantee that the socket will accept as many as ZMQ_SNDHWM
  722. messages, and the actual limit may be as much as 90% lower depending on the
  723. flow of messages on the socket. The socket may even be able to accept more messages
  724. than the ZMQ_SNDHWM threshold; a notable example is for sockets using TCP transport;
  725. see linkzmq:zmq_tcp[7].
  726. [horizontal]
  727. Option value type:: int
  728. Option value unit:: messages
  729. Default value:: 1000
  730. Applicable socket types:: all
  731. ZMQ_SNDTIMEO: Maximum time before a send operation returns with EAGAIN
  732. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  733. Sets the timeout for send operation on the socket. If the value is `0`,
  734. _zmq_send(3)_ will return immediately, with a EAGAIN error if the message
  735. cannot be sent. If the value is `-1`, it will block until the message is sent.
  736. For all other values, it will try to send the message for that amount of time
  737. before returning with an EAGAIN error.
  738. [horizontal]
  739. Option value type:: int
  740. Option value unit:: milliseconds
  741. Default value:: -1 (infinite)
  742. Applicable socket types:: all
  743. ZMQ_SOCKS_PROXY: Set SOCKS5 proxy address
  744. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  745. Sets the SOCKS5 proxy address that shall be used by the socket for the TCP
  746. connection(s). Supported authentication methods are: no authentication
  747. or basic authentication when setup with ZMQ_SOCKS_USERNAME. If the endpoints
  748. are domain names instead of addresses they shall not be resolved and they
  749. shall be forwarded unchanged to the SOCKS proxy service in the client
  750. connection request message (address type 0x03 domain name).
  751. [horizontal]
  752. Option value type:: character string
  753. Option value unit:: N/A
  754. Default value:: not set
  755. Applicable socket types:: all, when using TCP transport
  756. ZMQ_SOCKS_USERNAME: Set SOCKS username and select basic authentication
  757. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  758. Sets the username for authenticated connection to the SOCKS5 proxy.
  759. If you set this to a non-null and non-empty value, the authentication
  760. method used for the SOCKS5 connection shall be basic authentication.
  761. In this case, use ZMQ_SOCKS_PASSWORD option in order to set the password.
  762. If you set this to a null value or empty value, the authentication method
  763. shall be no authentication, the default.
  764. [horizontal]
  765. Option value type:: character string
  766. Option value unit:: N/A
  767. Default value:: not set
  768. Applicable socket types:: all, when using TCP transport
  769. ZMQ_SOCKS_PASSWORD: Set SOCKS basic authentication password
  770. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  771. Sets the password for authenticating to the SOCKS5 proxy server.
  772. This is used only when the SOCKS5 authentication method has been
  773. set to basic authentication through the ZMQ_SOCKS_USERNAME option.
  774. Setting this to a null value (the default) is equivalent to an
  775. empty password string.
  776. [horizontal]
  777. Option value type:: character string
  778. Option value unit:: N/A
  779. Default value:: not set
  780. Applicable socket types:: all, when using TCP transport
  781. ZMQ_STREAM_NOTIFY: send connect and disconnect notifications
  782. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  783. Enables connect and disconnect notifications on a STREAM socket, when set
  784. to 1. When notifications are enabled, the socket delivers a zero-length
  785. message when a peer connects or disconnects.
  786. [horizontal]
  787. Option value type:: int
  788. Option value unit:: 0, 1
  789. Default value:: 1
  790. Applicable socket types:: ZMQ_STREAM
  791. ZMQ_SUBSCRIBE: Establish message filter
  792. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  793. The 'ZMQ_SUBSCRIBE' option shall establish a new message filter on a 'ZMQ_SUB'
  794. socket. Newly created 'ZMQ_SUB' sockets shall filter out all incoming messages,
  795. therefore you should call this option to establish an initial message filter.
  796. An empty 'option_value' of length zero shall subscribe to all incoming
  797. messages. A non-empty 'option_value' shall subscribe to all messages beginning
  798. with the specified prefix. Multiple filters may be attached to a single
  799. 'ZMQ_SUB' socket, in which case a message shall be accepted if it matches at
  800. least one filter.
  801. [horizontal]
  802. Option value type:: binary data
  803. Option value unit:: N/A
  804. Default value:: N/A
  805. Applicable socket types:: ZMQ_SUB
  806. ZMQ_TCP_KEEPALIVE: Override SO_KEEPALIVE socket option
  807. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  808. Override 'SO_KEEPALIVE' socket option (where supported by OS).
  809. The default value of `-1` means to skip any overrides and leave it to OS default.
  810. [horizontal]
  811. Option value type:: int
  812. Option value unit:: -1,0,1
  813. Default value:: -1 (leave to OS default)
  814. Applicable socket types:: all, when using TCP transports.
  815. ZMQ_TCP_KEEPALIVE_CNT: Override TCP_KEEPCNT socket option
  816. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  817. Override 'TCP_KEEPCNT' socket option (where supported by OS). The default
  818. value of `-1` means to skip any overrides and leave it to OS default.
  819. [horizontal]
  820. Option value type:: int
  821. Option value unit:: -1,>0
  822. Default value:: -1 (leave to OS default)
  823. Applicable socket types:: all, when using TCP transports.
  824. ZMQ_TCP_KEEPALIVE_IDLE: Override TCP_KEEPIDLE (or TCP_KEEPALIVE on some OS)
  825. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  826. Override 'TCP_KEEPIDLE' (or 'TCP_KEEPALIVE' on some OS) socket option (where
  827. supported by OS). The default value of `-1` means to skip any overrides and
  828. leave it to OS default.
  829. [horizontal]
  830. Option value type:: int
  831. Option value unit:: -1,>0
  832. Default value:: -1 (leave to OS default)
  833. Applicable socket types:: all, when using TCP transports.
  834. ZMQ_TCP_KEEPALIVE_INTVL: Override TCP_KEEPINTVL socket option
  835. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  836. Override 'TCP_KEEPINTVL' socket option(where supported by OS). The default
  837. value of `-1` means to skip any overrides and leave it to OS default.
  838. [horizontal]
  839. Option value type:: int
  840. Option value unit:: -1,>0
  841. Default value:: -1 (leave to OS default)
  842. Applicable socket types:: all, when using TCP transports.
  843. ZMQ_TCP_MAXRT: Set TCP Maximum Retransmit Timeout
  844. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  845. On OSes where it is supported, sets how long before an unacknowledged TCP
  846. retransmit times out. The system normally attempts many TCP retransmits
  847. following an exponential backoff strategy. This means that after a network
  848. outage, it may take a long time before the session can be re-established.
  849. Setting this option allows the timeout to happen at a shorter interval.
  850. [horizontal]
  851. Option value type:: int
  852. Option value unit:: milliseconds
  853. Default value:: 0 (leave to OS default)
  854. Applicable socket types:: all, when using TCP transports.
  855. ZMQ_TOS: Set the Type-of-Service on socket
  856. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  857. Sets the ToS fields (Differentiated services (DS) and Explicit Congestion
  858. Notification (ECN) field of the IP header. The ToS field is typically used
  859. to specify a packets priority. The availability of this option is dependent
  860. on intermediate network equipment that inspect the ToS field and provide a
  861. path for low-delay, high-throughput, highly-reliable service, etc.
  862. [horizontal]
  863. Option value type:: int
  864. Option value unit:: >0
  865. Default value:: 0
  866. Applicable socket types:: all, only for connection-oriented transports
  867. ZMQ_UNSUBSCRIBE: Remove message filter
  868. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  869. The 'ZMQ_UNSUBSCRIBE' option shall remove an existing message filter on a
  870. 'ZMQ_SUB' socket. The filter specified must match an existing filter previously
  871. established with the 'ZMQ_SUBSCRIBE' option. If the socket has several
  872. instances of the same filter attached the 'ZMQ_UNSUBSCRIBE' option shall remove
  873. only one instance, leaving the rest in place and functional.
  874. [horizontal]
  875. Option value type:: binary data
  876. Option value unit:: N/A
  877. Default value:: N/A
  878. Applicable socket types:: ZMQ_SUB
  879. ZMQ_XPUB_VERBOSE: pass duplicate subscribe messages on XPUB socket
  880. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  881. Sets the 'XPUB' socket behaviour on new duplicated subscriptions. If enabled,
  882. the socket passes all subscribe messages to the caller. If disabled,
  883. only the first subscription to each filter will be passed. The default is 0
  884. (disabled).
  885. [horizontal]
  886. Option value type:: int
  887. Option value unit:: 0, 1
  888. Default value:: 0
  889. Applicable socket types:: ZMQ_XPUB
  890. ZMQ_XPUB_VERBOSER: pass duplicate subscribe and unsubscribe messages on XPUB socket
  891. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  892. Sets the 'XPUB' socket behaviour on new duplicated subscriptions and
  893. unsubscriptions. If enabled, the socket passes all subscribe and unsubscribe
  894. messages to the caller. If disabled, only the first subscription to each filter and
  895. the last unsubscription from each filter will be passed. The default is 0
  896. (disabled).
  897. [horizontal]
  898. Option value type:: int
  899. Option value unit:: 0, 1
  900. Default value:: 0
  901. Applicable socket types:: ZMQ_XPUB
  902. ZMQ_XPUB_MANUAL: change the subscription handling to manual
  903. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  904. Sets the 'XPUB' socket subscription handling mode manual/automatic.
  905. A value of '0' is the default and subscription requests will be handled automatically.
  906. A value of '1' will change the subscription requests handling to manual,
  907. with manual mode subscription requests are not added to the subscription list.
  908. To add subscription the user need to call setsockopt with ZMQ_SUBSCRIBE on XPUB socket.
  909. [horizontal]
  910. Option value type:: int
  911. Option value unit:: 0, 1
  912. Default value:: 0
  913. Applicable socket types:: ZMQ_XPUB
  914. ZMQ_XPUB_MANUAL_LAST_VALUE: change the subscription handling to manual
  915. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  916. This option is similar to ZMQ_XPUB_MANUAL.
  917. The difference is that ZMQ_XPUB_MANUAL_LAST_VALUE changes the 'XPUB' socket
  918. behaviour to send the first message to the last subscriber after the socket
  919. receives a subscription and call setsockopt with ZMQ_SUBSCRIBE on 'XPUB' socket.
  920. This prevents duplicated messages when using last value caching(LVC).
  921. NOTE: in DRAFT state, not yet available in stable releases.
  922. [horizontal]
  923. Option value type:: int
  924. Option value unit:: 0, 1
  925. Default value:: 0
  926. Applicable socket types:: ZMQ_XPUB
  927. ZMQ_XPUB_NODROP: do not silently drop messages if SENDHWM is reached
  928. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  929. Sets the 'XPUB' socket behaviour to return error EAGAIN if SENDHWM is
  930. reached and the message could not be send.
  931. A value of `0` is the default and drops the message silently when the peers
  932. SNDHWM is reached. A value of `1` returns an 'EAGAIN' error code if the
  933. SNDHWM is reached and ZMQ_DONTWAIT was used.
  934. [horizontal]
  935. Option value type:: int
  936. Option value unit:: 0, 1
  937. Default value:: 0
  938. Applicable socket types:: ZMQ_XPUB, ZMQ_PUB
  939. ZMQ_XPUB_WELCOME_MSG: set welcome message that will be received by subscriber when connecting
  940. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  941. Sets a welcome message the will be recieved by subscriber when connecting.
  942. Subscriber must subscribe to the Welcome message before connecting.
  943. Welcome message will also be sent on reconnecting.
  944. For welcome message to work well user must poll on incoming subscription messages on the XPUB socket and handle them.
  945. Use NULL and length of zero to disable welcome message.
  946. [horizontal]
  947. Option value type:: binary data
  948. Option value unit:: N/A
  949. Default value:: NULL
  950. Applicable socket types:: ZMQ_XPUB
  951. ZMQ_ONLY_FIRST_SUBSCRIBE: Process only first subscribe/unsubscribe in a multipart message
  952. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  953. If set, only the first part of the multipart message is processed as
  954. a subscribe/unsubscribe message. The rest are forwarded as user data
  955. regardless of message contents.
  956. It not set (default), subscribe/unsubscribe messages in a multipart message
  957. are processed as such regardless of their number and order.
  958. [horizontal]
  959. Option value type:: int
  960. Option value unit:: boolean
  961. Default value:: 0 (false)
  962. Applicable socket types:: ZMQ_XSUB, ZMQ_XPUB
  963. ZMQ_ZAP_DOMAIN: Set RFC 27 authentication domain
  964. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  965. Sets the domain for ZAP (ZMQ RFC 27) authentication. A ZAP domain must be
  966. specified to enable authentication. When the ZAP domain is empty, which is
  967. the default, ZAP authentication is disabled. This is not compatible with
  968. previous versions of libzmq, so it can be controlled by ZMQ_ZAP_ENFORCE_DOMAIN
  969. which for now is disabled by default.
  970. See http://rfc.zeromq.org/spec:27 for more details.
  971. [horizontal]
  972. Option value type:: character string
  973. Option value unit:: N/A
  974. Default value:: empty
  975. Applicable socket types:: all, when using TCP transport
  976. ZMQ_ZAP_ENFORCE_DOMAIN: Set ZAP domain handling to strictly adhere the RFC
  977. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  978. The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must
  979. always be set. Older versions of libzmq did not follow the spec and allowed
  980. an empty domain to be set.
  981. This option can be used to enabled or disable the stricter, backward
  982. incompatible behaviour. For now it is disabled by default, but in a future
  983. version it will be enabled by default.
  984. [horizontal]
  985. Option value type:: int
  986. Option value unit:: 0, 1
  987. Default value:: 0
  988. Applicable socket types:: all, when using ZAP
  989. ZMQ_TCP_ACCEPT_FILTER: Assign filters to allow new TCP connections
  990. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  991. Assign an arbitrary number of filters that will be applied for each new TCP
  992. transport connection on a listening socket. If no filters are applied, then
  993. the TCP transport allows connections from any IP address. If at least one
  994. filter is applied then new connection source ip should be matched. To clear
  995. all filters call zmq_setsockopt(socket, ZMQ_TCP_ACCEPT_FILTER, NULL, 0).
  996. Filter is a null-terminated string with ipv6 or ipv4 CIDR.
  997. NOTE: This option is deprecated, please use authentication via the ZAP API
  998. and IP address allowing / blocking.
  999. [horizontal]
  1000. Option value type:: binary data
  1001. Option value unit:: N/A
  1002. Default value:: no filters (allow from all)
  1003. Applicable socket types:: all listening sockets, when using TCP transports.
  1004. ZMQ_IPC_FILTER_GID: Assign group ID filters to allow new IPC connections
  1005. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1006. Assign an arbitrary number of filters that will be applied for each new IPC
  1007. transport connection on a listening socket. If no IPC filters are applied, then
  1008. the IPC transport allows connections from any process. If at least one UID,
  1009. GID, or PID filter is applied then new connection credentials should be
  1010. matched. To clear all GID filters call zmq_setsockopt(socket,
  1011. ZMQ_IPC_FILTER_GID, NULL, 0).
  1012. NOTE: GID filters are only available on platforms supporting SO_PEERCRED or
  1013. LOCAL_PEERCRED socket options (currently only Linux and later versions of
  1014. OS X).
  1015. NOTE: This option is deprecated, please use authentication via the ZAP API
  1016. and IPC allowing / blocking.
  1017. [horizontal]
  1018. Option value type:: gid_t
  1019. Option value unit:: N/A
  1020. Default value:: no filters (allow from all)
  1021. Applicable socket types:: all listening sockets, when using IPC transports.
  1022. ZMQ_IPC_FILTER_PID: Assign process ID filters to allow new IPC connections
  1023. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1024. Assign an arbitrary number of filters that will be applied for each new IPC
  1025. transport connection on a listening socket. If no IPC filters are applied, then
  1026. the IPC transport allows connections from any process. If at least one UID,
  1027. GID, or PID filter is applied then new connection credentials should be
  1028. matched. To clear all PID filters call zmq_setsockopt(socket,
  1029. ZMQ_IPC_FILTER_PID, NULL, 0).
  1030. NOTE: PID filters are only available on platforms supporting the SO_PEERCRED
  1031. socket option (currently only Linux).
  1032. NOTE: This option is deprecated, please use authentication via the ZAP API
  1033. and IPC allowing / blocking.
  1034. [horizontal]
  1035. Option value type:: pid_t
  1036. Option value unit:: N/A
  1037. Default value:: no filters (allow from all)
  1038. Applicable socket types:: all listening sockets, when using IPC transports.
  1039. ZMQ_IPC_FILTER_UID: Assign user ID filters to allow new IPC connections
  1040. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1041. Assign an arbitrary number of filters that will be applied for each new IPC
  1042. transport connection on a listening socket. If no IPC filters are applied, then
  1043. the IPC transport allows connections from any process. If at least one UID,
  1044. GID, or PID filter is applied then new connection credentials should be
  1045. matched. To clear all UID filters call zmq_setsockopt(socket,
  1046. ZMQ_IPC_FILTER_UID, NULL, 0).
  1047. NOTE: UID filters are only available on platforms supporting SO_PEERCRED or
  1048. LOCAL_PEERCRED socket options (currently only Linux and later versions of
  1049. OS X).
  1050. NOTE: This option is deprecated, please use authentication via the ZAP API
  1051. and IPC allowing / blocking.
  1052. [horizontal]
  1053. Option value type:: uid_t
  1054. Option value unit:: N/A
  1055. Default value:: no filters (allow from all)
  1056. Applicable socket types:: all listening sockets, when using IPC transports.
  1057. ZMQ_IPV4ONLY: Use IPv4-only on socket
  1058. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1059. Set the IPv4-only option for the socket. This option is deprecated.
  1060. Please use the ZMQ_IPV6 option.
  1061. [horizontal]
  1062. Option value type:: int
  1063. Option value unit:: boolean
  1064. Default value:: 1 (true)
  1065. Applicable socket types:: all, when using TCP transports.
  1066. ZMQ_VMCI_BUFFER_SIZE: Set buffer size of the VMCI socket
  1067. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1068. The `ZMQ_VMCI_BUFFER_SIZE` option shall set the size of the underlying
  1069. buffer for the socket. Used during negotiation before the connection is established.
  1070. [horizontal]
  1071. Option value type:: uint64_t
  1072. Option value unit:: bytes
  1073. Default value:: 65546
  1074. Applicable socket types:: all, when using VMCI transport
  1075. ZMQ_VMCI_BUFFER_MIN_SIZE: Set min buffer size of the VMCI socket
  1076. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1077. The `ZMQ_VMCI_BUFFER_MIN_SIZE` option shall set the min size of the underlying
  1078. buffer for the socket. Used during negotiation before the connection is established.
  1079. [horizontal]
  1080. Option value type:: uint64_t
  1081. Option value unit:: bytes
  1082. Default value:: 128
  1083. Applicable socket types:: all, when using VMCI transport
  1084. ZMQ_VMCI_BUFFER_MAX_SIZE: Set max buffer size of the VMCI socket
  1085. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1086. The `ZMQ_VMCI_BUFFER_MAX_SIZE` option shall set the max size of the underlying
  1087. buffer for the socket. Used during negotiation before the connection is established.
  1088. [horizontal]
  1089. Option value type:: uint64_t
  1090. Option value unit:: bytes
  1091. Default value:: 262144
  1092. Applicable socket types:: all, when using VMCI transport
  1093. ZMQ_VMCI_CONNECT_TIMEOUT: Set connection timeout of the VMCI socket
  1094. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1095. The `ZMQ_VMCI_CONNECT_TIMEOUT` option shall set connection timeout
  1096. for the socket.
  1097. [horizontal]
  1098. Option value type:: int
  1099. Option value unit:: milliseconds
  1100. Default value:: -1
  1101. Applicable socket types:: all, when using VMCI transport
  1102. ZMQ_MULTICAST_LOOP: Control multicast local loopback
  1103. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1104. For multicast UDP sender sockets this option sets whether the data
  1105. sent should be looped back on local listening sockets.
  1106. [horizontal]
  1107. Option value type:: int
  1108. Option value unit:: 0, 1
  1109. Default value:: 1
  1110. Applicable socket types:: ZMQ_RADIO, when using UDP multicast transport
  1111. ZMQ_ROUTER_NOTIFY: Send connect and disconnect notifications
  1112. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1113. Enable connect and disconnect notifications on a ROUTER socket.
  1114. When enabled, the socket delivers a zero-length message (with routing-id
  1115. as first frame) when a peer connects or disconnects. It's possible
  1116. to notify both events for a peer by OR-ing the flag values. This option
  1117. only applies to stream oriented (tcp, ipc) transports.
  1118. NOTE: in DRAFT state, not yet available in stable releases.
  1119. [horizontal]
  1120. Option value type:: int
  1121. Option value unit:: 0, ZMQ_NOTIFY_CONNECT, ZMQ_NOTIFY_DISCONNECT, ZMQ_NOTIFY_CONNECT | ZMQ_NOTIFY_DISCONNECT
  1122. Default value:: 0
  1123. Applicable socket types:: ZMQ_ROUTER
  1124. ZMQ_IN_BATCH_SIZE: Maximal receive batch size
  1125. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1126. Sets the maximal amount of messages that can be received in a single
  1127. 'recv' system call. WARNING: this option should almost never be changed.
  1128. The default has been chosen to offer the best compromise between latency and
  1129. throughtput. In the vast majority of cases, changing this option will result in
  1130. worst result if not outright breakages.
  1131. Cannot be zero.
  1132. NOTE: in DRAFT state, not yet available in stable releases.
  1133. [horizontal]
  1134. Option value type:: int
  1135. Option value unit:: messages
  1136. Default value:: 8192
  1137. Applicable socket types:: All, when using TCP, IPC, PGM or NORM transport.
  1138. ZMQ_OUT_BATCH_SIZE: Maximal send batch size
  1139. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1140. Sets the maximal amount of messages that can be sent in a single
  1141. 'send' system call. WARNING: this option should almost never be changed.
  1142. The default has been chosen to offer the best compromise between latency and
  1143. throughtput. In the vast majority of cases, changing this option will result in
  1144. worst result if not outright breakages.
  1145. Cannot be zero.
  1146. NOTE: in DRAFT state, not yet available in stable releases.
  1147. [horizontal]
  1148. Option value type:: int
  1149. Option value unit:: messages
  1150. Default value:: 8192
  1151. Applicable socket types:: All, when using TCP, IPC, PGM or NORM transport.
  1152. RETURN VALUE
  1153. ------------
  1154. The _zmq_setsockopt()_ function shall return zero if successful. Otherwise it
  1155. shall return `-1` and set 'errno' to one of the values defined below.
  1156. ERRORS
  1157. ------
  1158. *EINVAL*::
  1159. The requested option _option_name_ is unknown, or the requested _option_len_ or
  1160. _option_value_ is invalid.
  1161. *ETERM*::
  1162. The 0MQ 'context' associated with the specified 'socket' was terminated.
  1163. *ENOTSOCK*::
  1164. The provided 'socket' was invalid.
  1165. *EINTR*::
  1166. The operation was interrupted by delivery of a signal.
  1167. EXAMPLE
  1168. -------
  1169. .Subscribing to messages on a 'ZMQ_SUB' socket
  1170. ----
  1171. /* Subscribe to all messages */
  1172. rc = zmq_setsockopt (socket, ZMQ_SUBSCRIBE, "", 0);
  1173. assert (rc == 0);
  1174. /* Subscribe to messages prefixed with "ANIMALS.CATS" */
  1175. rc = zmq_setsockopt (socket, ZMQ_SUBSCRIBE, "ANIMALS.CATS", 12);
  1176. ----
  1177. .Setting I/O thread affinity
  1178. ----
  1179. int64_t affinity;
  1180. /* Incoming connections on TCP port 5555 shall be handled by I/O thread 1 */
  1181. affinity = 1;
  1182. rc = zmq_setsockopt (socket, ZMQ_AFFINITY, &affinity, sizeof (affinity));
  1183. assert (rc);
  1184. rc = zmq_bind (socket, "tcp://lo:5555");
  1185. assert (rc);
  1186. /* Incoming connections on TCP port 5556 shall be handled by I/O thread 2 */
  1187. affinity = 2;
  1188. rc = zmq_setsockopt (socket, ZMQ_AFFINITY, &affinity, sizeof (affinity));
  1189. assert (rc);
  1190. rc = zmq_bind (socket, "tcp://lo:5556");
  1191. assert (rc);
  1192. ----
  1193. SEE ALSO
  1194. --------
  1195. linkzmq:zmq_getsockopt[3]
  1196. linkzmq:zmq_socket[3]
  1197. linkzmq:zmq_plain[7]
  1198. linkzmq:zmq_curve[7]
  1199. linkzmq:zmq[7]
  1200. AUTHORS
  1201. -------
  1202. This page was written by the 0MQ community. To make a change please
  1203. read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.