ZMQ_MSG_SET_ROUTING_(3)

✨ NAME ✨

zmq_msg_set_routing_id β€” bestie, this is the one that sets the routing ID property on a message πŸ’–


🌸 SYNOPSIS 🌸

int zmq_msg_set_routing_id (zmq_msg_t *message, uint32_t routing_id);

πŸ’… DESCRIPTION πŸ’…

okay so. zmq_msg_set_routing_id()</p> does exactly one thing and it does it slayfully: it sets the routing_id you hand it, onto the message that the message argument is pointing at. no cap 🫢

here's the tea though β€” that routing_id must be greater than zero. like, that's the whole vibe check. zero is not it, zero is an error, we'll get to that 😭

and where do you even get a valid routing ID, you ask? iconic question. you have to receive a message from a ZMQ_SERVER socket, and then use the zmq_msg_routing_id method to grab it. that's the only way in, periodt ✨

one more thing bestie, and it's important: routing IDs are transient. they do not stick around forever. don't be out here storing them in a little jar and expecting them to be valid later πŸ™ˆ


πŸ”₯ RETURN VALUE πŸ”₯

  • returns zero if everything went off without a hitch β€” successful, we ate πŸ’…
  • otherwise it returns -1 and sets errno to one of the values listed down below πŸ‘‡

πŸ’€ ERRORS πŸ’€

  • EINVAL β€” the routing_id you provided is zero. that's it, that's the crime. zero is not greater than zero, so, yeah πŸŽ€

πŸ¦‹ SEE ALSO πŸ¦‹


πŸ‘‘ AUTHORS πŸ‘‘

this page was written by the 0MQ community 🌈 and if you wanna make a change (yes you, bestie, you can), please read the 0MQ Contribution Policy at http://www.zeromq.org/docs:contributing πŸ’–


and that's the whole page!! this little gem is from 0MQ 4.3.5, dated 10/09/2023 β€” 0MQ Manual energy all the way through, and the zmq_msg_set_routing_id_(3) header said hi and bye at the top and bottom πŸŽ€βœ¨

πŸ“¦ where this page comes from