1ZMQ_CTX_TERM(3) 0MQ Manual ZMQ_CTX_TERM(3)
2
3
4
6 zmq_ctx_term - terminate a 0MQ context
7
9 int zmq_ctx_term (void *context);
10
12 The zmq_ctx_term() function shall destroy the 0MQ context context.
13
14 Context termination is performed in the following steps:
15
16 1. Any blocking operations currently in progress on sockets open
17 within context shall return immediately with an error code of
18 ETERM. With the exception of zmq_close(), any further operations on
19 sockets open within context shall fail with an error code of ETERM.
20
21 2. After interrupting all blocking calls, zmq_ctx_term() shall block
22 until the following conditions are satisfied:
23
24 • All sockets open within context have been closed with
25 zmq_close().
26
27 • For each socket within context, all messages sent by the
28 application with zmq_send() have either been physically
29 transferred to a network peer, or the socket’s linger period
30 set with the ZMQ_LINGER socket option has expired.
31
32 For further details regarding socket linger behaviour refer to the
33 ZMQ_LINGER option in zmq_setsockopt(3).
34
35 This function replaces the deprecated functions zmq_term(3) and
36 zmq_ctx_destroy(3).
37
39 The zmq_ctx_term() function shall return zero if successful. Otherwise
40 it shall return -1 and set errno to one of the values defined below.
41
43 EFAULT
44 The provided context was invalid.
45
46 EINTR
47 Termination was interrupted by a signal. It can be restarted if
48 needed.
49
51 zmq(7) zmq_init(3) zmq_close(3) zmq_setsockopt(3)
52
54 This page was written by the 0MQ community. To make a change please
55 read the 0MQ Contribution Policy at
56 http://www.zeromq.org/docs:contributing.
57
58
59
600MQ 4.3.4 01/21/2023 ZMQ_CTX_TERM(3)