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