PageRenderTime 51ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/extension/libzmq/doc/zmq_getsockopt.txt

https://github.com/mccheung/avbot
Plain Text | 685 lines | 529 code | 156 blank | 0 comment | 0 complexity | 93da8bbd3ce2cc94a427c4bae331509f MD5 | raw file
Possible License(s): AGPL-3.0, LGPL-2.0, GPL-3.0, LGPL-3.0
  1. zmq_getsockopt(3)
  2. =================
  3. NAME
  4. ----
  5. zmq_getsockopt - get 0MQ socket options
  6. SYNOPSIS
  7. --------
  8. *int zmq_getsockopt (void '*socket', int 'option_name', void '*option_value', size_t '*option_len');*
  9. DESCRIPTION
  10. -----------
  11. The _zmq_getsockopt()_ function shall retrieve the value for the option
  12. specified by the 'option_name' argument for the 0MQ socket pointed to by the
  13. 'socket' argument, and store it in the buffer pointed to by the 'option_value'
  14. argument. The 'option_len' argument is the size in bytes of the buffer pointed
  15. to by 'option_value'; upon successful completion _zmq_getsockopt()_ shall
  16. modify the 'option_len' argument to indicate the actual size of the option
  17. value stored in the buffer.
  18. The following options can be retrieved with the _zmq_getsockopt()_ function:
  19. ZMQ_AFFINITY: Retrieve I/O thread affinity
  20. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  21. The 'ZMQ_AFFINITY' option shall retrieve the I/O thread affinity for newly
  22. created connections on the specified 'socket'.
  23. Affinity determines which threads from the 0MQ I/O thread pool associated with
  24. the socket's _context_ shall handle newly created connections. A value of zero
  25. specifies no affinity, meaning that work shall be distributed fairly among all
  26. 0MQ I/O threads in the thread pool. For non-zero values, the lowest bit
  27. corresponds to thread 1, second lowest bit to thread 2 and so on. For example,
  28. a value of 3 specifies that subsequent connections on 'socket' shall be handled
  29. exclusively by I/O threads 1 and 2.
  30. See also linkzmq:zmq_init[3] for details on allocating the number of I/O
  31. threads for a specific _context_.
  32. [horizontal]
  33. Option value type:: uint64_t
  34. Option value unit:: N/A (bitmap)
  35. Default value:: 0
  36. Applicable socket types:: N/A
  37. ZMQ_BACKLOG: Retrieve maximum length of the queue of outstanding connections
  38. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  39. The 'ZMQ_BACKLOG' option shall retrieve the maximum length of the queue of
  40. outstanding peer connections for the specified 'socket'; this only applies to
  41. connection-oriented transports. For details refer to your operating system
  42. documentation for the 'listen' function.
  43. [horizontal]
  44. Option value type:: int
  45. Option value unit:: connections
  46. Default value:: 100
  47. Applicable socket types:: all, only for connection-oriented transports
  48. ZMQ_CURVE_PUBLICKEY: Retrieve current CURVE public key
  49. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  50. Retrieves the current long term public key for the socket. You can
  51. provide either a 32 byte buffer, to retrieve the binary key value, or
  52. a 41 byte buffer, to retrieve the key in a printable Z85 format.
  53. NOTE: to fetch a printable key, the buffer must be 41 bytes large
  54. to hold the 40-char key value and one null byte.
  55. [horizontal]
  56. Option value type:: binary data or Z85 text string
  57. Option value size:: 32 or 41
  58. Default value:: null
  59. Applicable socket types:: all, when using TCP transport
  60. ZMQ_CURVE_SECRETKEY: Retrieve current CURVE secret key
  61. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  62. Retrieves the current long term secret key for the socket. You can
  63. provide either a 32 byte buffer, to retrieve the binary key value, or
  64. a 41 byte buffer, to retrieve the key in a printable Z85 format.
  65. [horizontal]
  66. Option value type:: binary data or Z85 text string
  67. Option value size:: 32 or 41
  68. Default value:: null
  69. Applicable socket types:: all, when using TCP transport
  70. ZMQ_CURVE_SERVERKEY: Retrieve current CURVE server key
  71. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  72. Retrieves the current server key for the client socket. You can
  73. provide either a 32 byte buffer, to retrieve the binary key value, or
  74. a 40 byte buffer, to retrieve the key in a printable Z85 format.
  75. [horizontal]
  76. Option value type:: binary data or Z85 text string
  77. Option value size:: 32 or 41
  78. Default value:: null
  79. Applicable socket types:: all, when using TCP transport
  80. ZMQ_EVENTS: Retrieve socket event state
  81. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  82. The 'ZMQ_EVENTS' option shall retrieve the event state for the specified
  83. 'socket'. The returned value is a bit mask constructed by OR'ing a combination
  84. of the following event flags:
  85. *ZMQ_POLLIN*::
  86. Indicates that at least one message may be received from the specified socket
  87. without blocking.
  88. *ZMQ_POLLOUT*::
  89. Indicates that at least one message may be sent to the specified socket without
  90. blocking.
  91. The combination of a file descriptor returned by the 'ZMQ_FD' option being
  92. ready for reading but no actual events returned by a subsequent retrieval of
  93. the 'ZMQ_EVENTS' option is valid; applications should simply ignore this case
  94. and restart their polling operation/event loop.
  95. [horizontal]
  96. Option value type:: int
  97. Option value unit:: N/A (flags)
  98. Default value:: N/A
  99. Applicable socket types:: all
  100. ZMQ_FD: Retrieve file descriptor associated with the socket
  101. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  102. The 'ZMQ_FD' option shall retrieve the file descriptor associated with the
  103. specified 'socket'. The returned file descriptor can be used to integrate the
  104. socket into an existing event loop; the 0MQ library shall signal any pending
  105. events on the socket in an _edge-triggered_ fashion by making the file
  106. descriptor become ready for reading.
  107. NOTE: The ability to read from the returned file descriptor does not
  108. necessarily indicate that messages are available to be read from, or can be
  109. written to, the underlying socket; applications must retrieve the actual event
  110. state with a subsequent retrieval of the 'ZMQ_EVENTS' option.
  111. NOTE: The returned file descriptor is also used internally by the 'zmq_send'
  112. and 'zmq_recv' functions. As the descriptor is edge triggered, applications
  113. must update the state of 'ZMQ_EVENTS' after each invocation of 'zmq_send'
  114. or 'zmq_recv'.To be more explicit: after calling 'zmq_send' the socket may
  115. become readable (and vice versa) without triggering a read event on the
  116. file descriptor.
  117. CAUTION: The returned file descriptor is intended for use with a 'poll' or
  118. similar system call only. Applications must never attempt to read or write data
  119. to it directly, neither should they try to close it.
  120. [horizontal]
  121. Option value type:: int on POSIX systems, SOCKET on Windows
  122. Option value unit:: N/A
  123. Default value:: N/A
  124. Applicable socket types:: all
  125. ZMQ_HANDSHAKE_IVL: Retrieve maximum handshake interval
  126. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  127. The 'ZMQ_HANDSHAKE_IVL' option shall retrieve the maximum handshake interval
  128. for the specified 'socket'. Handshaking is the exchange of socket configuration
  129. information (socket type, identity, security) that occurs when a connection
  130. is first opened, only for connection-oriented transports. If handshaking does
  131. not complete within the configured time, the connection shall be closed.
  132. The value 0 means no handshake time limit.
  133. [horizontal]
  134. Option value type:: int
  135. Option value unit:: milliseconds
  136. Default value:: 30000
  137. Applicable socket types:: all but ZMQ_STREAM, only for connection-oriented transports
  138. ZMQ_IDENTITY: Retrieve socket identity
  139. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  140. The 'ZMQ_IDENTITY' option shall retrieve the identity of the specified 'socket'.
  141. Socket identity is used only by request/reply pattern. Namely, it can be used
  142. in tandem with ROUTER socket to route messages to the peer with specific
  143. identity.
  144. Identity should be at least one byte and at most 255 bytes long. Identities
  145. starting with binary zero are reserved for use by 0MQ infrastructure.
  146. [horizontal]
  147. Option value type:: binary data
  148. Option value unit:: N/A
  149. Default value:: NULL
  150. Applicable socket types:: ZMQ_REP, ZMQ_REQ, ZMQ_ROUTER, ZMQ_DEALER.
  151. ZMQ_IMMEDIATE: Retrieve attach-on-connect value
  152. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  153. Retrieve the state of the attach on connect value. If set to `1`, will delay the
  154. attachment of a pipe on connect until the underlying connection has completed.
  155. This will cause the socket to block if there are no other connections, but will
  156. prevent queues from filling on pipes awaiting connection.
  157. [horizontal]
  158. Option value type:: int
  159. Option value unit:: boolean
  160. Default value:: 0 (false)
  161. Applicable socket types:: all, primarily when using TCP/IPC transports.
  162. ZMQ_IPV4ONLY: Retrieve IPv4-only socket override status
  163. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  164. Retrieve the IPv4-only option for the socket. This option is deprecated.
  165. Please use the ZMQ_IPV6 option.
  166. [horizontal]
  167. Option value type:: int
  168. Option value unit:: boolean
  169. Default value:: 1 (true)
  170. Applicable socket types:: all, when using TCP transports.
  171. ZMQ_IPV6: Retrieve IPv6 socket status
  172. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  173. Retrieve the IPv6 option for the socket. A value of `1` means IPv6 is
  174. enabled on the socket, while `0` means the socket will use only IPv4.
  175. When IPv6 is enabled the socket will connect to, or accept connections
  176. from, both IPv4 and IPv6 hosts.
  177. [horizontal]
  178. Option value type:: int
  179. Option value unit:: boolean
  180. Default value:: 0 (false)
  181. Applicable socket types:: all, when using TCP transports.
  182. ZMQ_LAST_ENDPOINT: Retrieve the last endpoint set
  183. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  184. The 'ZMQ_LAST_ENDPOINT' option shall retrieve the last endpoint bound for
  185. TCP and IPC transports. The returned value will be a string in the form of
  186. a ZMQ DSN. Note that if the TCP host is INADDR_ANY, indicated by a *, then
  187. the returned address will be 0.0.0.0 (for IPv4).
  188. [horizontal]
  189. Option value type:: NULL-terminated character string
  190. Option value unit:: N/A
  191. Default value:: NULL
  192. Applicable socket types:: all, when binding TCP or IPC transports
  193. ZMQ_LINGER: Retrieve linger period for socket shutdown
  194. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  195. The 'ZMQ_LINGER' option shall retrieve the linger period for the specified
  196. 'socket'. The linger period determines how long pending messages which have
  197. yet to be sent to a peer shall linger in memory after a socket is closed with
  198. linkzmq:zmq_close[3], and further affects the termination of the socket's
  199. context with linkzmq:zmq_term[3]. The following outlines the different
  200. behaviours:
  201. * The default value of '-1' specifies an infinite linger period. Pending
  202. messages shall not be discarded after a call to _zmq_close()_; attempting to
  203. terminate the socket's context with _zmq_term()_ shall block until all
  204. pending messages have been sent to a peer.
  205. * The value of '0' specifies no linger period. Pending messages shall be
  206. discarded immediately when the socket is closed with _zmq_close()_.
  207. * Positive values specify an upper bound for the linger period in milliseconds.
  208. Pending messages shall not be discarded after a call to _zmq_close()_;
  209. attempting to terminate the socket's context with _zmq_term()_ shall block
  210. until either all pending messages have been sent to a peer, or the linger
  211. period expires, after which any pending messages shall be discarded.
  212. [horizontal]
  213. Option value type:: int
  214. Option value unit:: milliseconds
  215. Default value:: -1 (infinite)
  216. Applicable socket types:: all
  217. ZMQ_MAXMSGSIZE: Maximum acceptable inbound message size
  218. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  219. The option shall retrieve limit for the inbound messages. If a peer sends
  220. a message larger than ZMQ_MAXMSGSIZE it is disconnected. Value of -1 means
  221. 'no limit'.
  222. [horizontal]
  223. Option value type:: int64_t
  224. Option value unit:: bytes
  225. Default value:: -1
  226. Applicable socket types:: all
  227. ZMQ_MECHANISM: Retrieve current security mechanism
  228. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  229. The 'ZMQ_MECHANISM' option shall retrieve the current security mechanism
  230. for the socket.
  231. [horizontal]
  232. Option value type:: int
  233. Option value unit:: ZMQ_NULL, ZMQ_PLAIN, or ZMQ_CURVE
  234. Default value:: ZMQ_NULL
  235. Applicable socket types:: all, when using TCP or IPC transports
  236. ZMQ_MULTICAST_HOPS: Maximum network hops for multicast packets
  237. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  238. The option shall retrieve time-to-live used for outbound multicast packets.
  239. The default of 1 means that the multicast packets don't leave the local network.
  240. [horizontal]
  241. Option value type:: int
  242. Option value unit:: network hops
  243. Default value:: 1
  244. Applicable socket types:: all, when using multicast transports
  245. ZMQ_PLAIN_PASSWORD: Retrieve current password
  246. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  247. The 'ZMQ_PLAIN_PASSWORD' option shall retrieve the last password set for
  248. the PLAIN security mechanism. The returned value shall be a NULL-terminated
  249. string and MAY be empty. The returned size SHALL include the terminating
  250. null byte.
  251. [horizontal]
  252. Option value type:: NULL-terminated character string
  253. Option value unit:: N/A
  254. Default value:: null string
  255. Applicable socket types:: all, when using TCP or IPC transports
  256. ZMQ_PLAIN_SERVER: Retrieve current PLAIN server role
  257. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  258. Returns the 'ZMQ_PLAIN_SERVER' option, if any, previously set on the socket.
  259. [horizontal]
  260. Option value type:: int
  261. Option value unit:: 0, 1
  262. Default value:: int
  263. Applicable socket types:: all, when using TCP or IPC transports
  264. ZMQ_PLAIN_USERNAME: Retrieve current PLAIN username
  265. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  266. The 'ZMQ_PLAIN_USERNAME' option shall retrieve the last username set for
  267. the PLAIN security mechanism. The returned value shall be a NULL-terminated
  268. string and MAY be empty. The returned size SHALL include the terminating
  269. null byte.
  270. [horizontal]
  271. Option value type:: NULL-terminated character string
  272. Option value unit:: N/A
  273. Default value:: null string
  274. Applicable socket types:: all, when using TCP or IPC transports
  275. ZMQ_RATE: Retrieve multicast data rate
  276. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  277. The 'ZMQ_RATE' option shall retrieve the maximum send or receive data rate for
  278. multicast transports using the specified 'socket'.
  279. [horizontal]
  280. Option value type:: int
  281. Option value unit:: kilobits per second
  282. Default value:: 100
  283. Applicable socket types:: all, when using multicast transports
  284. ZMQ_RCVBUF: Retrieve kernel receive buffer size
  285. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  286. The 'ZMQ_RCVBUF' option shall retrieve the underlying kernel receive buffer
  287. size for the specified 'socket'. A value of zero means that the OS default is
  288. in effect. For details refer to your operating system documentation for the
  289. 'SO_RCVBUF' socket option.
  290. [horizontal]
  291. Option value type:: int
  292. Option value unit:: bytes
  293. Default value:: 0
  294. Applicable socket types:: all
  295. ZMQ_RCVHWM: Retrieve high water mark for inbound messages
  296. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  297. The 'ZMQ_RCVHWM' option shall return the high water mark for inbound messages on
  298. the specified 'socket'. The high water mark is a hard limit on the maximum
  299. number of outstanding messages 0MQ shall queue in memory for any single peer
  300. that the specified 'socket' is communicating with. A value of zero means no
  301. limit.
  302. If this limit has been reached the socket shall enter an exceptional state and
  303. depending on the socket type, 0MQ shall take appropriate action such as
  304. blocking or dropping sent messages. Refer to the individual socket descriptions
  305. in linkzmq:zmq_socket[3] for details on the exact action taken for each socket
  306. type.
  307. [horizontal]
  308. Option value type:: int
  309. Option value unit:: messages
  310. Default value:: 1000
  311. Applicable socket types:: all
  312. ZMQ_RCVMORE: More message data parts to follow
  313. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  314. The 'ZMQ_RCVMORE' option shall return True (1) if the message part last
  315. received from the 'socket' was a data part with more parts to follow. If there
  316. are no data parts to follow, this option shall return False (0).
  317. Refer to linkzmq:zmq_send[3] and linkzmq:zmq_recv[3] for a detailed description
  318. of multi-part messages.
  319. [horizontal]
  320. Option value type:: int
  321. Option value unit:: boolean
  322. Default value:: N/A
  323. Applicable socket types:: all
  324. ZMQ_RCVTIMEO: Maximum time before a socket operation returns with EAGAIN
  325. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  326. Retrieve the timeout for recv operation on the socket. If the value is `0`,
  327. _zmq_recv(3)_ will return immediately, with a EAGAIN error if there is no
  328. message to receive. If the value is `-1`, it will block until a message is
  329. available. For all other values, it will wait for a message for that amount
  330. of time before returning with an EAGAIN error.
  331. [horizontal]
  332. Option value type:: int
  333. Option value unit:: milliseconds
  334. Default value:: -1 (infinite)
  335. Applicable socket types:: all
  336. ZMQ_RECONNECT_IVL: Retrieve reconnection interval
  337. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  338. The 'ZMQ_RECONNECT_IVL' option shall retrieve the initial reconnection interval
  339. for the specified 'socket'. The reconnection interval is the period 0MQ shall
  340. wait between attempts to reconnect disconnected peers when using
  341. connection-oriented transports. The value -1 means no reconnection.
  342. NOTE: The reconnection interval may be randomized by 0MQ to prevent
  343. reconnection storms in topologies with a large number of peers per socket.
  344. [horizontal]
  345. Option value type:: int
  346. Option value unit:: milliseconds
  347. Default value:: 100
  348. Applicable socket types:: all, only for connection-oriented transports
  349. ZMQ_RECONNECT_IVL_MAX: Retrieve maximum reconnection interval
  350. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  351. The 'ZMQ_RECONNECT_IVL_MAX' option shall retrieve the maximum reconnection
  352. interval for the specified 'socket'. This is the maximum period 0MQ shall wait
  353. between attempts to reconnect. On each reconnect attempt, the previous interval
  354. shall be doubled untill ZMQ_RECONNECT_IVL_MAX is reached. This allows for
  355. exponential backoff strategy. Default value means no exponential backoff is
  356. performed and reconnect interval calculations are only based on
  357. ZMQ_RECONNECT_IVL.
  358. NOTE: Values less than ZMQ_RECONNECT_IVL will be ignored.
  359. [horizontal]
  360. Option value type:: int
  361. Option value unit:: milliseconds
  362. Default value:: 0 (only use ZMQ_RECONNECT_IVL)
  363. Applicable socket types:: all, only for connection-oriented transport
  364. ZMQ_RECOVERY_IVL: Get multicast recovery interval
  365. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  366. The 'ZMQ_RECOVERY_IVL' option shall retrieve the recovery interval for
  367. multicast transports using the specified 'socket'. The recovery interval
  368. determines the maximum time in milliseconds that a receiver can be absent from a
  369. multicast group before unrecoverable data loss will occur.
  370. [horizontal]
  371. Option value type:: int
  372. Option value unit:: milliseconds
  373. Default value:: 10000
  374. Applicable socket types:: all, when using multicast transports
  375. ZMQ_SNDBUF: Retrieve kernel transmit buffer size
  376. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  377. The 'ZMQ_SNDBUF' option shall retrieve the underlying kernel transmit buffer
  378. size for the specified 'socket'. A value of zero means that the OS default is
  379. in effect. For details refer to your operating system documentation for the
  380. 'SO_SNDBUF' socket option.
  381. [horizontal]
  382. Option value type:: int
  383. Option value unit:: bytes
  384. Default value:: 0
  385. Applicable socket types:: all
  386. ZMQ_SNDHWM: Retrieves high water mark for outbound messages
  387. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  388. The 'ZMQ_SNDHWM' option shall return the high water mark for outbound messages
  389. on the specified 'socket'. The high water mark is a hard limit on the maximum
  390. number of outstanding messages 0MQ shall queue in memory for any single peer
  391. that the specified 'socket' is communicating with. A value of zero means no
  392. limit.
  393. If this limit has been reached the socket shall enter an exceptional state and
  394. depending on the socket type, 0MQ shall take appropriate action such as
  395. blocking or dropping sent messages. Refer to the individual socket descriptions
  396. in linkzmq:zmq_socket[3] for details on the exact action taken for each socket
  397. type.
  398. [horizontal]
  399. Option value type:: int
  400. Option value unit:: messages
  401. Default value:: 1000
  402. Applicable socket types:: all
  403. ZMQ_SNDTIMEO: Maximum time before a socket operation returns with EAGAIN
  404. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  405. Retrieve the timeout for send operation on the socket. If the value is `0`,
  406. _zmq_send(3)_ will return immediately, with a EAGAIN error if the message
  407. cannot be sent. If the value is `-1`, it will block until the message is sent.
  408. For all other values, it will try to send the message for that amount of time
  409. before returning with an EAGAIN error.
  410. [horizontal]
  411. Option value type:: int
  412. Option value unit:: milliseconds
  413. Default value:: -1 (infinite)
  414. Applicable socket types:: all
  415. ZMQ_TCP_KEEPALIVE: Override SO_KEEPALIVE socket option
  416. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  417. Override 'SO_KEEPALIVE' socket option(where supported by OS).
  418. The default value of `-1` means to skip any overrides and leave it to OS default.
  419. [horizontal]
  420. Option value type:: int
  421. Option value unit:: -1,0,1
  422. Default value:: -1 (leave to OS default)
  423. Applicable socket types:: all, when using TCP transports.
  424. ZMQ_TCP_KEEPALIVE_CNT: Override TCP_KEEPCNT socket option
  425. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  426. Override 'TCP_KEEPCNT' socket option(where supported by OS).
  427. The default value of `-1` means to skip any overrides and leave it to OS default.
  428. [horizontal]
  429. Option value type:: int
  430. Option value unit:: -1,>0
  431. Default value:: -1 (leave to OS default)
  432. Applicable socket types:: all, when using TCP transports.
  433. ZMQ_TCP_KEEPALIVE_IDLE: Override TCP_KEEPCNT(or TCP_KEEPALIVE on some OS)
  434. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  435. Override 'TCP_KEEPCNT'(or 'TCP_KEEPALIVE' on some OS) socket option (where
  436. supported by OS). The default value of `-1` means to skip any overrides and
  437. leave it to OS default.
  438. [horizontal]
  439. Option value type:: int
  440. Option value unit:: -1,>0
  441. Default value:: -1 (leave to OS default)
  442. Applicable socket types:: all, when using TCP transports.
  443. ZMQ_TCP_KEEPALIVE_INTVL: Override TCP_KEEPINTVL socket option
  444. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  445. Override 'TCP_KEEPINTVL' socket option(where supported by OS).
  446. The default value of `-1` means to skip any overrides and leave it to OS default.
  447. [horizontal]
  448. Option value type:: int
  449. Option value unit:: -1,>0
  450. Default value:: -1 (leave to OS default)
  451. Applicable socket types:: all, when using TCP transports.
  452. ZMQ_TOS: Retrieve the Type-of-Service socket override status
  453. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  454. Retrieve the IP_TOS option for the socket.
  455. [horizontal]
  456. Option value type:: int
  457. Option value unit:: >0
  458. Default value:: 0
  459. Applicable socket types:: all, only for connection-oriented transports
  460. ZMQ_TYPE: Retrieve socket type
  461. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  462. The 'ZMQ_TYPE' option shall retrieve the socket type for the specified
  463. 'socket'. The socket type is specified at socket creation time and
  464. cannot be modified afterwards.
  465. [horizontal]
  466. Option value type:: int
  467. Option value unit:: N/A
  468. Default value:: N/A
  469. Applicable socket types:: all
  470. ZMQ_ZAP_DOMAIN: Retrieve RFC 27 authentication domain
  471. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  472. The 'ZMQ_ZAP_DOMAIN' option shall retrieve the last ZAP domain set for
  473. the socket. The returned value shall be a NULL-terminated string and MAY
  474. be empty. The returned size SHALL include the terminating null byte.
  475. [horizontal]
  476. Option value type:: character string
  477. Option value unit:: N/A
  478. Default value:: not set
  479. Applicable socket types:: all, when using TCP transport
  480. ZMQ_IDENTITY_FD: Retrieve FD associated with igven identity
  481. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  482. The 'ZMQ_IDENTITY_FD' option shall retrieve the FD associated with given identity.
  483. call _zmq_getsockopt()_ with _option_value_ / _option_len_ pointing to memory
  484. holding the identity string. On return the start of _option_value_ buffer will be
  485. filled with file descriptor of the pipe with given identity if found. If the identity
  486. is not found ENOTSOCK is returned as _zmq_getsockopt()_ result. When the pipe is not
  487. using FD as lower transport you might get -1 as FD. NB: _option_value_ must be always
  488. big enough to hold sizeof(fd_t) bytes no matter how small the identity length is.
  489. [horizontal]
  490. Option value type:: character string/fd_t
  491. Option value unit:: N/A
  492. Default value:: not set
  493. Applicable socket types:: ROUTER
  494. RETURN VALUE
  495. ------------
  496. The _zmq_getsockopt()_ function shall return zero if successful. Otherwise it
  497. shall return `-1` and set 'errno' to one of the values defined below.
  498. ERRORS
  499. ------
  500. *EINVAL*::
  501. The requested option _option_name_ is unknown, or the requested _option_len_ or
  502. _option_value_ is invalid, or the size of the buffer pointed to by
  503. _option_value_, as specified by _option_len_, is insufficient for storing the
  504. option value.
  505. *ETERM*::
  506. The 0MQ 'context' associated with the specified 'socket' was terminated.
  507. *ENOTSOCK*::
  508. The provided 'socket' was invalid.
  509. *EINTR*::
  510. The operation was interrupted by delivery of a signal.
  511. EXAMPLE
  512. -------
  513. .Retrieving the high water mark for outgoing messages
  514. ----
  515. /* Retrieve high water mark into sndhwm */
  516. int sndhwm;
  517. size_t sndhwm_size = sizeof (sndhwm);
  518. rc = zmq_getsockopt (socket, ZMQ_SNDHWM, &sndhwm, &sndhwm_size);
  519. assert (rc == 0);
  520. ----
  521. SEE ALSO
  522. --------
  523. linkzmq:zmq_setsockopt[3]
  524. linkzmq:zmq_socket[3]
  525. linkzmq:zmq[7]
  526. AUTHORS
  527. -------
  528. This page was written by the 0MQ community. To make a change please
  529. read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.