ZMQ_TERM(3)
π ZMQ_TERM(3) β the 0MQ Manual, but make it make sense
okay so bestie, we're in the 0MQ Manual today and this page is all about zmq_term β the terminate the 0MQ context girlie. she's giving "shutting down the whole group chat" energy π«Ά
β¨ SYNOPSIS β¨
int zmq_term (void *context);
that's it. that's the whole vibe check. one function, one pointer, one big goodbye π
πΈ DESCRIPTION πΈ
so like β the zmq_term() function shall terminate the 0MQ context context. like, fr fr, it ends it. no cap.
context termination is a whole β¨processβ¨ and it happens in these steps, okay, don't skip ahead:
- any blocking operations that are currently in progress on sockets open within context shall return immediately with an error code of
ETERM. and with the exception ofzmq_close(), any further operations on sockets open within context shall fail with an error code ofETERM. so basically everything gets theETERMtreatment exceptzmq_close()β she's the exception, she's the main character π - after interrupting all those blocking calls,
zmq_term()shall block until the following conditions are satisfied:- all sockets open within context have been closed with
zmq_close()π - for each socket within context, all messages sent by the application with
zmq_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 context have been closed with
lowkey important: for further details regarding socket linger behaviour, refer to the ZMQ_LINGER option in zmq_setsockopt(3). she knows things. go read her.
π¨ and bestie, heads up: this function is deprecated by zmq_ctx_term(3). it's giving "old icon, still iconic, but use the new one" β so like, keep that in mind. periodt.
π RETURN VALUE π
zmq_term() shall return zero if successful. slay. β¨
otherwise it shall return -1 and set errno to one of the values defined below. not slay. π
π ERRORS π
EFAULTβ the provided context was invalid. like, it wasn't even a thing. invalid vibes entirely πEINTRβ termination was interrupted by a signal. it can be restarted if needed, so like, no biggie, just try again π«Ά
π¦ SEE ALSO π¦
go read all of them, i'll wait π
π 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 β like, they want your edits, it's giving collaborative queen energy π
and that's the page, bestie π this was 0MQ 4.3.5, dated 02/15/2026 β mwah, bye, go terminate your contexts responsibly β¨π
π¦ where this page comes from
- arch rolling: zeromq 4.3.5-3 Β· MPL-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms