[zeromq-dev] Server Socket Initiate Communication

Justin Karneges justin at karneges.com
Sat Feb 10 19:50:16 CET 2018


Assuming you're talking about route IDs with respect to ROUTER sockets,
it is possible to use predetermined IDs when sending messages.
For example, a client can create a ROUTER socket and connect it to
multiple servers. As long as it also knows the ZMQ_IDENTITY used by each
of these servers (you'd need to obtain this information out-of-band
somehow), the client can send a message to a specific server by
including the server's ZMQ_IDENTITY as the first message part.
On Sat, Feb 10, 2018, at 7:29 AM, Matthew Harrigan wrote:
> 
> I apologize in advance if this is a dumb question, but would still
> appreciate knowing why.  So, why can't a server socket initiate
> communication? I am focused on this documentation
> http://api.zeromq.org/4-2:zmq-socket. AFAICT the only state change
> that happens in a server socket when a client socket connects to it is
> that the map that relates addresses to routing id's get updated.
> Suppose a machine with a server socket knows what address it want to
> communicate with, whether hard coded, from a beacon, service locator,
> whatever.  Why can't it just tell the server socket to make a routing
> id to that address and then start communicating?  Note I am working on
> a toy educational project where a gaggle of peers uses raft to get a
> leader and formally join or leave (different from crashing or network
> partitions).  In such a peer to peer network the symmetry of each peer
> binding a server socket to itself and talking to other peers seems
> appealing.  Thank you> _________________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> https://lists.zeromq.org/mailman/listinfo/zeromq-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20180210/04db766e/attachment.htm>


More information about the zeromq-dev mailing list