1ZMQ_CTX_GET(3)                    0MQ Manual                    ZMQ_CTX_GET(3)
2
3
4

NAME

6       zmq_ctx_get - get context options
7

SYNOPSIS

9       int zmq_ctx_get (void *context, int option_name);
10

DESCRIPTION

12       The zmq_ctx_get() function shall return the option specified by the
13       option_name argument.
14
15       The zmq_ctx_get() function accepts the following option names:
16
17   ZMQ_IO_THREADS: Get number of I/O threads
18       The ZMQ_IO_THREADS argument returns the size of the 0MQ thread pool for
19       this context.
20
21   ZMQ_MAX_SOCKETS: Get maximum number of sockets
22       The ZMQ_MAX_SOCKETS argument returns the maximum number of sockets
23       allowed for this context.
24
25   ZMQ_MAX_MSGSZ: Get maximum message size
26       The ZMQ_MAX_MSGSZ argument returns the maximum size of a message
27       allowed for this context. Default value is INT_MAX.
28
29   ZMQ_ZERO_COPY_RECV: Get message decoding strategy
30       The ZMQ_ZERO_COPY_RECV argument return whether message decoder uses a
31       zero copy strategy when receiving messages. Default value is 1. NOTE:
32       in DRAFT state, not yet available in stable releases.
33
34   ZMQ_SOCKET_LIMIT: Get largest configurable number of sockets
35       The ZMQ_SOCKET_LIMIT argument returns the largest number of sockets
36       that zmq_ctx_set(3) will accept.
37
38   ZMQ_IPV6: Set IPv6 option
39       The ZMQ_IPV6 argument returns the IPv6 option for the context.
40
41   ZMQ_BLOCKY: Get blocky setting
42       The ZMQ_BLOCKY argument returns 1 if the context will block on
43       terminate, zero if the "block forever on context termination" gambit
44       was disabled by setting ZMQ_BLOCKY to false on all new contexts.
45
46   ZMQ_THREAD_SCHED_POLICY: Get scheduling policy for I/O threads
47       The ZMQ_THREAD_SCHED_POLICY argument returns the scheduling policy for
48       internal context’s thread pool.
49
50   ZMQ_THREAD_NAME_PREFIX: Get name prefix for I/O threads
51       The ZMQ_THREAD_NAME_PREFIX argument gets the numeric prefix of each
52       thread created for the internal context’s thread pool.
53
54   ZMQ_MSG_T_SIZE: Get the zmq_msg_t size at runtime
55       The ZMQ_MSG_T_SIZE argument returns the size of the zmq_msg_t structure
56       at runtime, as defined in the include/zmq.h public header. This is
57       useful for example for FFI bindings that can’t simply do a sizeof().
58

RETURN VALUE

60       The zmq_ctx_get() function returns a value of 0 or greater if
61       successful. Otherwise it returns -1 and sets errno to one of the values
62       defined below.
63

ERRORS

65       EINVAL
66           The requested option option_name is unknown.
67
68       EFAULT
69           The provided context is invalid.
70

EXAMPLE

72       Setting a limit on the number of sockets.
73
74           void *context = zmq_ctx_new ();
75           zmq_ctx_set (context, ZMQ_MAX_SOCKETS, 256);
76           int max_sockets = zmq_ctx_get (context, ZMQ_MAX_SOCKETS);
77           assert (max_sockets == 256);
78
79       Switching off the context deadlock gambit.
80
81           zmq_ctx_set (ctx, ZMQ_BLOCKY, false);
82
83

SEE ALSO

85       zmq_ctx_set(3) zmq(7)
86

AUTHORS

88       This page was written by the 0MQ community. To make a change please
89       read the 0MQ Contribution Policy at
90       http://www.zeromq.org/docs:contributing.
91
92
93
940MQ 4.3.4                         01/30/2021                    ZMQ_CTX_GET(3)
Impressum