[zeromq-dev] Server/Client: Like a duplex connection

Michel Pelletier pelletier.michel at gmail.com
Fri Aug 24 19:20:36 CEST 2012

I would suggest you use two sockets, one a XPUB->XSUB for the one to
many broadcast and subscription sending information and the second a
DEALER->DEALER for the bi/unidirectional one to one communication.
You could use threads to service each socket, or an event loop
approach with zmq_poll, or whatever event support your particular
language binding implements.  For example the python zmq library comes
with a simple event loop library and support for gevent.


On Fri, Aug 24, 2012 at 8:14 AM, Ricardo Wickel
<ricardo.wickel at gmail.com> wrote:
> Hallo Community,
> I have read several times the sections "Core Messaging Patterns" in the
> Guide and "socket types" in zmq_socket (3), but I don't get the stuff  :)
> Once before thank you for your help!
> I have the following scenario
> - 1 server, n clients
> - each client can send requests to server (both types: two-way and one-way)
> - each client can subscribe to server with specific "filter" (maybe
> prefix?!)
> - server responds to client requests (if two-way requests)
> - server publish messages to specific subscribed clients (for specific
> filter/prefix)
> Unfortunately I still do not know how I can do this duplex connection.
> Do you have an idea or recommendation?
> Maybe the solution is the double of "PUB and SUB" and "REQ and REP".
> And how should I manage the two threads on both sides?
> If you have any code for me C#, C++, C is fine.
> Thanks,
> Ricardo
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev

More information about the zeromq-dev mailing list