ZMQ_CTX_TERM(3)
π ZMQ_CTX_TERM π
okay bestie, so this is a page from the 0MQ Manual, and we're talking about zmq_ctx_term β the girl whose whole job is saying "we're done here" to a 0MQ context. periodt.
β¨ NAME β¨
zmq_ctx_term β terminate a 0MQ context π
β¨ SYNOPSIS β¨
int zmq_ctx_term (void *context);
πΈ DESCRIPTION πΈ
The zmq_ctx_term() function shall destroy the 0MQ context context. like, actually shut it down, no half-measures π
Context termination is performed in the following steps:
- Any blocking operations currently in progress on sockets open within
contextshall return immediately with an error code ofETERM. With the exception ofzmq_close(), any further operations on sockets open withincontextshall fail with an error code ofETERM. so everyone gets kicked out of the group chat, effective immediately π - After interrupting all blocking calls,
zmq_ctx_term()shall block until the following conditions are satisfied:- All sockets open within
contexthave been closed withzmq_close(). - For each socket within
context, all messages sent by the application withzmq_send()have either been physically transferred to a network peer, or the socket's linger period set with theZMQ_LINGERsocket option has expired.
- All sockets open within
not me waiting around for every last message to actually land β yeah, zmq_ctx_term() is the patient one, she waits for the vibe to fully settle before she leaves. no cap. π«Ά
For further details regarding socket linger behaviour refer to the ZMQ_LINGER option in zmq_setsockopt(3).
This function replaces the deprecated functions zmq_term(3) and zmq_ctx_destroy(3). those are the old queens, we don't use them anymore, it's giving vintage for no reason π
β¨ RETURN VALUE β¨
The zmq_ctx_term() function shall return zero if successful. Otherwise it shall return -1 and set errno to one of the values defined below. it's giving "slay" or "ma'am what happened" and there is no in-between π
π ERRORS π
EFAULTβ The providedcontextwas invalid. like bestie that's not even a context, what are you handing me πEINTRβ Termination was interrupted by a signal. It can be restarted if needed. okay so something barged in mid-shutdown β no biggie, you can just run it again π₯
π SEE ALSO π
zmq(7) zmq_init(3) zmq_close(3) zmq_setsockopt(3)
π AUTHORS π
This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at http://www.zeromq.org/docs:contributing. they're literally the blueprint, go read it if you wanna contribute β¨
and that's the whole page, bestie!! π
this one came from 0MQ 4.3.5, dated 10/09/2023, and it's the ZMQ_CTX_TERM(3) page β go forth and terminate your contexts responsibly, mwah ππ¦
π¦ where this page comes from
- epel 10: zeromq 4.3.5-18.el10_0 Β· MPL-2.0 AND BSD-3-Clause AND MIT
- fedora 43: zeromq 4.3.5-22.fc43 Β· MPL-2.0 AND BSD-3-Clause AND MIT
- fedora 43: zeromq 4.3.5-22.fc43 Β· MPL-2.0 AND BSD-3-Clause AND MIT
- fedora 44: zeromq 4.3.5-22.fc43 Β· MPL-2.0 AND BSD-3-Clause AND MIT
- fedora 44: zeromq 4.3.5-22.fc43 Β· MPL-2.0 AND BSD-3-Clause AND MIT
- opensuse-leap 16.0: zeromq-devel 4.3.5-160000.2.2 Β· MPL-2.0
- opensuse-leap 16.0: zeromq-devel 4.3.5-160000.2.2 Β· MPL-2.0
- opensuse-leap 16.0: zeromq-devel 4.3.5-160000.2.2 Β· MPL-2.0
- opensuse-leap 16.0: zeromq-devel 4.3.5-160000.2.2 Β· MPL-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms