2023-10-21 01:50:38 +02:00
|
|
|
= zmq_ctx_get_ext(3)
|
2019-08-28 00:41:23 +02:00
|
|
|
|
|
|
|
|
2023-10-21 01:50:38 +02:00
|
|
|
== NAME
|
2019-08-28 00:41:23 +02:00
|
|
|
|
|
|
|
zmq_ctx_get_ext - get extended context options
|
|
|
|
|
|
|
|
|
2023-10-21 01:50:38 +02:00
|
|
|
== SYNOPSIS
|
2019-08-28 00:41:23 +02:00
|
|
|
*int zmq_ctx_get_ext (void '*context', int 'option_name', void '*option_value', size_t '*option_len');*
|
|
|
|
|
|
|
|
|
2023-10-21 01:50:38 +02:00
|
|
|
== DESCRIPTION
|
2019-08-28 00:41:23 +02:00
|
|
|
The _zmq_ctx_get()_ function shall retrieve the value for the option
|
|
|
|
specified by the 'option_name' 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'; upon successful completion _zmq_ctx_get_ext()_ shall
|
|
|
|
modify the 'option_len' argument to indicate the actual size of the option
|
|
|
|
value stored in the buffer.
|
|
|
|
|
|
|
|
The _zmq_ctx_get_ext()_ function accepts all the option names accepted by
|
|
|
|
_zmq_ctx_get()_.
|
|
|
|
Options that make most sense to retrieve using _zmq_ctx_get_ext()_ instead of
|
|
|
|
_zmq_ctx_get()_ are:
|
|
|
|
|
|
|
|
ZMQ_THREAD_NAME_PREFIX: Get name prefix for I/O threads
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
The 'ZMQ_THREAD_NAME_PREFIX' argument gets the string prefix of each thread
|
|
|
|
created for the internal context's thread pool.
|
|
|
|
|
|
|
|
[horizontal]
|
|
|
|
Option value type:: character string
|
|
|
|
Option value unit:: N/A
|
|
|
|
Default value:: empty string
|
|
|
|
|
|
|
|
|
2023-10-21 01:50:38 +02:00
|
|
|
== RETURN VALUE
|
2019-08-28 00:41:23 +02:00
|
|
|
The _zmq_ctx_get_ext()_ function returns a value of 0 or greater if successful.
|
|
|
|
Otherwise it returns `-1` and sets 'errno' to one of the values defined
|
|
|
|
below.
|
|
|
|
|
|
|
|
|
2023-10-21 01:50:38 +02:00
|
|
|
== ERRORS
|
2019-08-28 00:41:23 +02:00
|
|
|
*EINVAL*::
|
|
|
|
The requested option _option_name_ is unknown.
|
2020-11-09 22:08:51 +01:00
|
|
|
*EFAULT*::
|
|
|
|
The provided 'context' is invalid.
|
2019-08-28 00:41:23 +02:00
|
|
|
|
|
|
|
|
2023-10-21 01:50:38 +02:00
|
|
|
== EXAMPLE
|
2020-11-09 22:30:50 +01:00
|
|
|
.Setting a prefix on internal ZMQ thread names:
|
2019-08-28 00:41:23 +02:00
|
|
|
----
|
|
|
|
void *context = zmq_ctx_new ();
|
|
|
|
const char prefix[] = "MyApp";
|
|
|
|
size_t prefixLen = sizeof(prefix);
|
|
|
|
zmq_ctx_set (context, ZMQ_THREAD_NAME_PREFIX, &prefix, &prefixLen);
|
|
|
|
|
|
|
|
char buff[256];
|
|
|
|
size_t buffLen = sizeof(buff);
|
|
|
|
int rc = zmq_ctx_get (context, ZMQ_THREAD_NAME_PREFIX, &buff, &buffLen);
|
|
|
|
assert (rc == 0);
|
|
|
|
assert (buffLen == prefixLen);
|
|
|
|
|
|
|
|
----
|
|
|
|
|
|
|
|
|
2023-10-21 01:50:38 +02:00
|
|
|
== SEE ALSO
|
2023-11-03 11:36:47 +01:00
|
|
|
* xref:zmq_ctx_get.adoc[zmq_ctx_get]
|
|
|
|
* xref:zmq.adoc[zmq]
|
2019-08-28 00:41:23 +02:00
|
|
|
|
|
|
|
|
2023-10-21 01:50:38 +02:00
|
|
|
== AUTHORS
|
2019-08-28 00:41:23 +02:00
|
|
|
This page was written by the 0MQ community. To make a change please
|
2023-11-22 23:18:23 +01:00
|
|
|
read the 0MQ Contribution Policy at <https://zeromq.org/how-to-contribute/>.
|