ZMQ_MSG_MOVE(3)

πŸ’Œ ZMQ_MSG_MOVE(3) β€” the 0MQ manual, but make it cute

okay bestie, welcome to the 0MQ manual page for zmq_msg_move, and no this is not a drill, we're moving message content around and it's gonna be so clean ✨


✨ NAME ✨

zmq_msg_move β€” move content of a message to another message 🫢

the vibe? you got two message objects and you're handing the goods from one to the other. no duplicating, no messy copies, just a lil handoff. iconic behavior honestly.


🌸 SYNOPSIS 🌸

int zmq_msg_move (zmq_msg_t *dest, zmq_msg_t *src);

two pointers, one function call, zero drama (until the error section, but we'll get there πŸ₯²).


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea, bestie. The zmq_msg_move() function shall move the content of the message object referenced by src to the message object referenced by dest.

and the way that it does this?? no actual copying of message content is performed β€” dest is simply updated to reference the new content. it's giving "you're not carrying the box, you're just changing who's holding it" energy πŸ’…

src becomes an empty message after calling zmq_msg_move(). yes, fr fr, emptied out. ghosted. the content has left the building.

and the original content of dest, if any, shall be released. it's not being saved, it's not being stored, it's just gone. say goodbye πŸ‘‹

Caution 🚨 Never access zmq_msg_t members directly, instead always use the zmq_msg family of functions. like literally never. do not touch the internals. do not peek. use the functions, they exist for a reason, i am begging you πŸ™ˆ

⭐ RETURN VALUE ⭐

The zmq_msg_move() function shall return zero if successful. otherwise it shall return -1 and set errno to one of the values defined below. slay when it works, -1 when it doesn't, and errno will tell you exactly what went wrong πŸŽ€


πŸ’œ ERRORS πŸ’œ

  • EFAULT β€” Invalid message. 😭

that's the whole list bestie, one singular error, very low-maintenance of it honestly.


🌈 SEE ALSO 🌈

the whole zmq_msg friend group, go say hi to all of them 🫢


πŸ‘‘ 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.

community-written, community-loved, and if you wanna contribute you absolutely can, the door is open, come through πŸšͺ✨


and that's the whole page bestie!! this was 0MQ version 4.3.5, dated 10/09/2023, brought to you from the 0MQ Manual β€” mwah, love u, go move some messages responsibly πŸ’–

πŸ“¦ where this page comes from