All zeromq sockets implicitly have an identifier associated with them. (This identifier can be obtained using zmq_getsockopt () .)
For bidirectional socket types, not XREQ or XREP, this identity is automatically transferred as part of every message sent over the socket. The REP socket uses this identifier to redirect the response message to the corresponding socket. This leads to automatic routing.
Under the hood, identifiers are transmitted through multi-page messages. The first message in a multi-page message will contain the socket identifier. An empty message will follow, followed by all messages specified by the user. REQ and REP sockets automatically process these prefix messages. However, if you use XREQ or XREP sockets, you need to fill in these messages yourself.
If you are looking for "identity" in the ZMQ Guide , you should find all the details that you will ever want to learn about how identifiers and socket operation.
Indygreg
source share