ZMQ_TIPC(7)

πŸ’… ZMQ_TIPC(7) πŸ’…

okay bestie, welcome to the zmq_tipc page β€” that's the 0MQ unicast transport using TIPC, and yes it lives in the 0MQ Manual, section 7, iykyk 🫢


✨ NAME ✨

zmq_tipc β€” the 0MQ unicast transport that runs on TIPC 🌸


πŸ¦‹ SYNOPSIS πŸ¦‹

TIPC is a cluster IPC protocol, and the way it does addressing is location transparent β€” literally the main character energy of addressing schemes πŸ‘‘


🌈 ADDRESSING 🌈

So a 0MQ endpoint is just a string, right? It's made of transport:// and then an address. The transport bit tells you which underlying protocol you're using, and the address bit tells you the transport-specific address you're connecting to. Simple as that, no cap ✨

For the TIPC transport specifically, the transport is tipc, and what the address part means is spelled out below πŸ‘‡

πŸŽ€ Assigning a port name to a socket πŸŽ€

When you're assigning a port name to a socket with zmq_bind() using the tipc transport, the endpoint is defined in this form: {type, lower, upper}

  • Type is the numerical (u32) ID of your service πŸ’–
  • Lower and Upper specify a range for your service πŸ’–
Publishing the same service with overlapping lower/upper ID's will cause connection requests to be distributed over these in a round-robin manner. bestie that's just how it goes πŸŒ€

πŸ’œ Connecting a socket πŸ’œ

When you're connecting a socket to a peer address with zmq_connect() using the tipc transport, the endpoint shall be interpreted as a service ID, followed by a comma and the instance ID.

And the instance ID must be within the lower/upper range of a published port name β€” otherwise the endpoint isn't valid, periodt πŸ’…


πŸ”₯ EXAMPLES πŸ”₯

Assigning a local address to a socket. slay 🫢

//  Publish TIPC service ID 5555
rc = zmq_bind(socket, "tipc://{5555,0,0}");
assert (rc == 0);
//  Publish TIPC service ID 5555 with a service range of 0-100
rc = zmq_bind(socket, "tipc://{5555,0,100}");
assert (rc == 0);

Connecting a socket. iconique ✨

//  Connect to service 5555 instance id 50
rc = zmq_connect(socket, "tipc://{5555,50}");
assert (rc == 0);

πŸ‘€ SEE ALSO πŸ‘€

go read those too, they're all bangers fr fr πŸ“š


🫢 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 🌸


and that's the whole vibe check, bestie β€” this page is from 0MQ 4.3.5, dated 10/09/2023, and it's giving ZMQ_TIPC(7) energy forever πŸ’–βœ¨πŸŽ€πŸ¦‹ bye love u, go bind something iconic πŸ‘‘

πŸ“¦ where this page comes from