Router on a stick concept4/1/2024 If there are three REQ sockets connected to a ROUTER socket, it will invent three random identities, one for each REQ socket. The ROUTER socket invents a random identity for each connection with which it works. Identities are a difficult concept to understand, but it's essential if you want to become a ZeroMQ expert. When sending messages a ZMQ_ROUTER socket shall remove the first part of the message and use it to determine the identity of the peer the message shall be routed to. Messages received are fair-queued from among all connected peers. When receiving messages a ZMQ_ROUTER socket shall prepend a message part containing the identity of the originating peer to the message before passing it to the application. Then, when you send a message via a ROUTER socket, you first send an identity frame. An identity, sometimes called an address, is just a binary string with no meaning except "this is a unique handle to the connection". The way it tells the caller is to stick the connection identity in front of each message received. The ROUTER socket, unlike other sockets, tracks every connection it has, and tells the caller about these.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |