Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
8becacf8
Commit
8becacf8
authored
May 31, 2010
by
Martin Lucina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Documentation updates
Add zmq_getsockopt(3), clean up zmq_setsockopt(3).
parent
be6019ab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
241 additions
and
30 deletions
+241
-30
zmq_getsockopt.txt
doc/zmq_getsockopt.txt
+209
-0
zmq_setsockopt.txt
doc/zmq_setsockopt.txt
+32
-30
No files found.
doc/zmq_getsockopt.txt
0 → 100644
View file @
8becacf8
zmq_getsockopt(3)
=================
NAME
----
zmq_getsockopt - get 0MQ socket options
SYNOPSIS
--------
*int zmq_getsockopt (void '*socket', int 'option_name', void '*option_value', size_t 'option_len');*
DESCRIPTION
-----------
The _zmq_getsockopt()_ function shall retrieve the value for the option
specified by the 'option_name' argument for the 0MQ socket pointed to by the
'socket' argument, and store it in the buffer pointed to by the 'option_value'
argument. The 'option_len' argument is the size in bytes of the buffer pointed
to by 'option_value'.
The following options can be retrieved with the _zmq_getsockopt()_ function:
ZMQ_HWM: Retrieve high water mark
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_HWM' option shall retrieve the high water mark for the _message queue_
associated with the specified 'socket'. The high water mark is a hard limit on
the number of outstanding messages in the queue; if this limit has been reached
the socket shall enter an "emergency" state and depending on the socket type,
0MQ shall take appropriate action such as blocking or dropping new messages
entering the queue.
The default 'ZMQ_HWM' value of zero means "no limit".
Option value type:: int64_t
Option value unit:: messages
Default value:: 0
Applicable socket types:: all
ZMQ_SWAP: Retrieve disk offload size
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_SWAP' option shall retrieve the disk offload (swap) size for the
_message queue_ associated with the specified 'socket'. A socket which has
'ZMQ_SWAP' set to a non-zero value may exceed it's high water mark; in this
case outstanding messages shall be offloaded to storage on disk rather than
held in memory.
The value of 'ZMQ_SWAP' defines the maximum size of the swap space in bytes.
Option value type:: int64_t
Option value unit:: bytes
Default value:: 0
Applicable socket types:: all
ZMQ_AFFINITY: Retrieve I/O thread affinity
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_AFFINITY' option shall retrieve the I/O thread affinity for newly
created connections on the specified 'socket'.
Affinity determines which threads from the 0MQ I/O thread pool associated with
the socket's _context_ shall handle newly created connections. A value of zero
specifies no affinity, meaning that work shall be distributed fairly among all
0MQ I/O threads in the thread pool. For non-zero values, the lowest bit
corresponds to thread 1, second lowest bit to thread 2 and so on. For example,
a value of 3 specifies that subsequent connections on 'socket' shall be handled
exclusively by I/O threads 1 and 2.
See also linkzmq:zmq_init[3] for details on allocating the number of I/O
threads for a specific _context_.
Option value type:: int64_t
Option value unit:: N/A (bitmap)
Default value:: 0
Applicable socket types:: N/A
ZMQ_IDENTITY: Retrieve socket identity
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_IDENTITY' option shall retrieve the identity of the specified
'socket'. Socket identity determines if existing 0MQ infastructure (_message
queues_, _forwarding devices_) shall be identified with a specific application
and persist across multiple runs of the application.
If the socket has no identity, each run of an application is completely
separate from other runs. However, with identity set the socket shall re-use
any existing 0MQ infrastructure configured by the previous run(s). Thus the
application may receive messages that were sent in the meantime, _message
queue_ limits shall be shared with previous run(s) and so on.
Identity can be at least one byte and at most 255 bytes long. Identities
starting with binary zero are reserved for use by 0MQ infrastructure.
Option value type:: binary data
Option value unit:: N/A
Default value:: NULL
Applicable socket types:: all
ZMQ_RATE: Retrieve multicast data rate
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_RATE' option shall retrieve the maximum send or receive data rate for
multicast transports using the specified 'socket'.
Option value type:: uint64_t
Option value unit:: kilobits per second
Default value:: 100
Applicable socket types:: all, when using multicast transports
ZMQ_RECOVERY_IVL: Get multicast recovery interval
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_RECOVERY_IVL' option shall retrieve the recovery interval for
multicast transports using the specified 'socket'. The recovery interval
determines the maximum time in seconds that a receiver can be absent from a
multicast group before unrecoverable data loss will occur.
Option value type:: uint64_t
Option value unit:: seconds
Default value:: 10
Applicable socket types:: all, when using multicast transports
ZMQ_MCAST_LOOP: Control multicast loopback
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_MCAST_LOOP' option controls whether data sent via multicast
transports can also be received by the sending host via loopback. A value of
zero indicates that the loopback functionality is disabled, while the default
value of 1 indicates that the loopback functionality is enabled. Leaving
multicast loopback enabled when it is not required can have a negative impact
on performance. Where possible, disable 'ZMQ_MCAST_LOOP' in production
environments.
Option value type:: uint64_t
Option value unit:: boolean
Default value:: 1
Applicable socket types:: all, when using multicast transports
ZMQ_SNDBUF: Retrieve kernel transmit buffer size
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_SNDBUF' option shall retrieve the underlying kernel transmit buffer
size for the specified 'socket'. A value of zero means that the OS default is
in effect. For details refer to your operating system documentation for the
'SO_SNDBUF' socket option.
Option value type:: uint64_t
Option value unit:: bytes
Default value:: 0
Applicable socket types:: all
ZMQ_RCVBUF: Retrieve kernel receive buffer size
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_RCVBUF' option shall retrieve the underlying kernel receive buffer
size for the specified 'socket'. A value of zero means that the OS default is
in effect. For details refer to your operating system documentation for the
'SO_RCVBUF' socket option.
Option value type:: uint64_t
Option value unit:: bytes
Default value:: 0
Applicable socket types:: all
RETURN VALUE
------------
The _zmq_getsockopt()_ function shall return zero if successful. Otherwise it
shall return `-1` and set 'errno' to one of the values defined below.
ERRORS
------
*EINVAL*::
The requested option _option_name_ is unknown, or the requested _option_len_ or
_option_value_ is invalid, or the size of the buffer pointed to by
_option_value_, as specified by _option_len_, is insufficient for storing the
option value.
*ETERM*::
The 0MQ 'context' associated with the specified 'socket' was terminated.
EXAMPLE
-------
.Retrieving the high water mark
----
/* Retrieve high water mark into hwm */
int64_t hwm;
rc = zmq_getsockopt (socket, ZMQ_HWM, &hwm, sizeof hwm);
assert (rc == 0);
----
SEE ALSO
--------
linkzmq:zmq_setsockopt[3]
linkzmq:zmq_socket[3]
linkzmq:zmq[7]
AUTHORS
-------
The 0MQ documentation was written by Martin Sustrik <sustrik@250bpm.com> and
Martin Lucina <mato@kotelna.sk>.
doc/zmq_setsockopt.txt
View file @
8becacf8
...
@@ -20,17 +20,17 @@ The _zmq_setsockopt()_ function shall set the option specified by the
...
@@ -20,17 +20,17 @@ The _zmq_setsockopt()_ function shall set the option specified by the
for the 0MQ socket pointed to by the 'socket' argument. The 'option_len'
for the 0MQ socket pointed to by the 'socket' argument. The 'option_len'
argument is the size of the option value in bytes.
argument is the size of the option value in bytes.
The following
options are defined
:
The following
socket options can be set with the _zmq_setsockopt()_ function
:
ZMQ_HWM: Set high water mark
ZMQ_HWM: Set high water mark
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_HWM' option shall set the high water mark for the _message queue_
The 'ZMQ_HWM' option shall set the high water mark for the _message queue_
associated with the s
ocket. The high water mark is a hard limit on the number
associated with the s
pecified 'socket'. The high water mark is a hard limit on
of outstanding messages in the queue; if this limit has been reached the socket
the number of outstanding messages in the queue; if this limit has been reached
shall enter an "emergency" state and depending on the socket type, 0MQ shall
the socket shall enter an "emergency" state and depending on the socket type,
take appropriate action such as blocking or dropping new messages entering the
0MQ shall take appropriate action such as blocking or dropping new messages
queue.
entering the
queue.
The default 'ZMQ_HWM' value of zero means "no limit".
The default 'ZMQ_HWM' value of zero means "no limit".
...
@@ -43,9 +43,10 @@ Applicable socket types:: all
...
@@ -43,9 +43,10 @@ Applicable socket types:: all
ZMQ_SWAP: Set disk offload size
ZMQ_SWAP: Set disk offload size
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_SWAP' option shall set the disk offload (swap) size for the _message
The 'ZMQ_SWAP' option shall set the disk offload (swap) size for the _message
queue_ associated with the socket. A socket which has 'ZMQ_SWAP' set to a
queue_ associated with the specified 'socket'. A socket which has 'ZMQ_SWAP'
non-zero value may exceed it's high water mark; in this case outstanding
set to a non-zero value may exceed it's high water mark; in this case
messages shall be offloaded to storage on disk rather than held in memory.
outstanding messages shall be offloaded to storage on disk rather than held in
memory.
The value of 'ZMQ_SWAP' defines the maximum size of the swap space in bytes.
The value of 'ZMQ_SWAP' defines the maximum size of the swap space in bytes.
...
@@ -57,9 +58,8 @@ Applicable socket types:: all
...
@@ -57,9 +58,8 @@ Applicable socket types:: all
ZMQ_AFFINITY: Set I/O thread affinity
ZMQ_AFFINITY: Set I/O thread affinity
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_AFFINITY' option shall set the I/O thread affinity for connections
The 'ZMQ_AFFINITY' option shall set the I/O thread affinity for newly created
created by subsequent _zmq_connect()_ or _zmq_bind()_ calls on the specified
connections on the specified 'socket'.
'socket'.
Affinity determines which threads from the 0MQ I/O thread pool associated with
Affinity determines which threads from the 0MQ I/O thread pool associated with
the socket's _context_ shall handle newly created connections. A value of zero
the socket's _context_ shall handle newly created connections. A value of zero
...
@@ -80,10 +80,10 @@ Applicable socket types:: N/A
...
@@ -80,10 +80,10 @@ Applicable socket types:: N/A
ZMQ_IDENTITY: Set socket identity
ZMQ_IDENTITY: Set socket identity
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_IDENTITY' option shall set the identity of the s
ocket. Socket identity
The 'ZMQ_IDENTITY' option shall set the identity of the s
pecified 'socket'.
determines if existing 0MQ infastructure (_message queues_, _forwarding
Socket identity determines if existing 0MQ infastructure (_message queues_,
devices_) shall be identified with a specific application and persist across
_forwarding devices_) shall be identified with a specific application and
multiple runs of the application.
persist across
multiple runs of the application.
If the socket has no identity, each run of an application is completely
If the socket has no identity, each run of an application is completely
separate from other runs. However, with identity set the socket shall re-use
separate from other runs. However, with identity set the socket shall re-use
...
@@ -146,9 +146,9 @@ Applicable socket types:: all, when using multicast transports
...
@@ -146,9 +146,9 @@ Applicable socket types:: all, when using multicast transports
ZMQ_RECOVERY_IVL: Set multicast recovery interval
ZMQ_RECOVERY_IVL: Set multicast recovery interval
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_RECOVERY_IVL' option shall set the recovery interval for multicast
The 'ZMQ_RECOVERY_IVL' option shall set the recovery interval for multicast
transports
such as linkzmq:zmq_pgm[7] using the specified 'socket'. T
he
transports
using the specified 'socket'. The recovery interval determines t
he
recovery interval determines the maximum time in seconds that a receiver can be
maximum time in seconds that a receiver can be absent from a multicast group
absent from a multicast group
before unrecoverable data loss will occur.
before unrecoverable data loss will occur.
CAUTION: Excersize care when setting large recovery intervals as the data
CAUTION: Excersize care when setting large recovery intervals as the data
needed for recovery will be held in memory. For example, a 1 minute recovery
needed for recovery will be held in memory. For example, a 1 minute recovery
...
@@ -163,11 +163,12 @@ Applicable socket types:: all, when using multicast transports
...
@@ -163,11 +163,12 @@ Applicable socket types:: all, when using multicast transports
ZMQ_MCAST_LOOP: Control multicast loopback
ZMQ_MCAST_LOOP: Control multicast loopback
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_MCAST_LOOP' option shall control whether data sent via multicast
The 'ZMQ_MCAST_LOOP' option shall control whether data sent via multicast
transports can also be received by the sending host via loopback. A value of
transports using the specified 'socket' can also be received by the sending
zero disables the loopback functionality, while the default value of 1 enables
host via loopback. A value of zero disables the loopback functionality, while
the loopback functionality. Leaving multicast loopback enabled when it is not
the default value of 1 enables the loopback functionality. Leaving multicast
required can have a negative impact on performance. Where possible, disable
loopback enabled when it is not required can have a negative impact on
'ZMQ_MCAST_LOOP' in production environments.
performance. Where possible, disable 'ZMQ_MCAST_LOOP' in production
environments.
Option value type:: uint64_t
Option value type:: uint64_t
Option value unit:: boolean
Option value unit:: boolean
...
@@ -178,8 +179,8 @@ Applicable socket types:: all, when using multicast transports
...
@@ -178,8 +179,8 @@ Applicable socket types:: all, when using multicast transports
ZMQ_SNDBUF: Set kernel transmit buffer size
ZMQ_SNDBUF: Set kernel transmit buffer size
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_SNDBUF' option shall set the underlying kernel transmit buffer size
The 'ZMQ_SNDBUF' option shall set the underlying kernel transmit buffer size
for the
socket to the specified size in bytes. A value of zero means leave th
e
for the
'socket' to the specified size in bytes. A value of zero means leav
e
OS default unchanged. For details please refer to your operating system
the
OS default unchanged. For details please refer to your operating system
documentation for the 'SO_SNDBUF' socket option.
documentation for the 'SO_SNDBUF' socket option.
Option value type:: uint64_t
Option value type:: uint64_t
...
@@ -191,9 +192,9 @@ Applicable socket types:: all
...
@@ -191,9 +192,9 @@ Applicable socket types:: all
ZMQ_RCVBUF: Set kernel receive buffer size
ZMQ_RCVBUF: Set kernel receive buffer size
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_RCVBUF' option shall set the underlying kernel receive buffer size for
The 'ZMQ_RCVBUF' option shall set the underlying kernel receive buffer size for
the
socket to the specified size in bytes. A value of zero means leave the OS
the
'socket' to the specified size in bytes. A value of zero means leave the
default unchanged. For details refer to your operating system documentation for
OS default unchanged. For details refer to your operating system documentation
the 'SO_RCVBUF' socket option.
for
the 'SO_RCVBUF' socket option.
Option value type:: uint64_t
Option value type:: uint64_t
Option value unit:: bytes
Option value unit:: bytes
...
@@ -214,7 +215,7 @@ The requested option _option_name_ is unknown, or the requested _option_len_ or
...
@@ -214,7 +215,7 @@ The requested option _option_name_ is unknown, or the requested _option_len_ or
_option_value_ is invalid.
_option_value_ is invalid.
*ETERM*::
*ETERM*::
The
associated context was termin
ted.
The
0MQ 'context' associated with the specified 'socket' was termina
ted.
EXAMPLE
EXAMPLE
...
@@ -248,6 +249,7 @@ assert (rc);
...
@@ -248,6 +249,7 @@ assert (rc);
SEE ALSO
SEE ALSO
--------
--------
linkzmq:zmq_getsockopt[3]
linkzmq:zmq_socket[3]
linkzmq:zmq_socket[3]
linkzmq:zmq[7]
linkzmq:zmq[7]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment