ZMQ_MSG_CLOSE(3)
π ZMQ_MSG_CLOSE(3) π
okay bestie, welcome to the zmq_msg_close page from the 0MQ manual β this is the one where you say bye-bye to a message and free up its lil resources. it's giving closure, literally. β¨
πΈ NAME πΈ
zmq_msg_close β release a 0MQ message π«Ά
β¨ SYNOPSIS β¨
int zmq_msg_close (zmq_msg_t *msg);
π¦ DESCRIPTION π¦
So here's the tea: zmq_msg_close() tells the 0MQ infrastructure that any resources tied to the message object that msg points at are no longer needed and can be released. π
but WAIT β and this is the part everyone skips β the actual freeing of those resources gets postponed by 0MQ until all users of the message or of the underlying data buffer have said they're done with it. it's not a "drop it the second you ask" situation, it's a "we'll handle it when everyone's out of the group chat" situation. π
applications should make sure zmq_msg_close() gets called once a message is no longer required, otherwise memory leaks may occur π. that's the scary part. don't leak, bestie.
lowkey important: this is NOT necessary after a successful zmq_msg_send(). the send already handled it, you don't need to double up. periodt.
β οΈ Caution β οΈ Never accesszmq_msg_tmembers directly. like, ever. instead, always use thezmq_msgfamily of functions. iykyk. π
π RETURN VALUE π
- zero β slay, it worked, the function was successful π
-1β not slay. and it setserrnoto one of the values listed down below π
π ERRORS π
EFAULTβ invalid message. that's it, that's the whole error. the message you handed over was not it. π
π SEE ALSO π
zmq_msg_init(3) zmq_msg_init_size(3) zmq_msg_init_buffer(3) zmq_msg_init_data(3) zmq_msg_data(3) zmq_msg_size(3) zmq(7)
π§ AUTHORS π§
this page was written by the 0MQ community π«Ά and honestly, iconic of them. if you wanna make a change, go read the 0MQ Contribution Policy at http://www.zeromq.org/docs:contributing β the link is right there, bestie, no excuses. π
and that's the whole vibe check, babe. this was the 0MQ 4.3.5 manual, dated 10/09/2023 β go close those messages responsibly and hydrate. 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