[zeromq-dev] Looking for the best server/client layout

Greg Ward greg at gerg.ca
Thu Jul 24 20:44:31 CEST 2014

On 24 July 2014, Mike Zupan said:
> I'm new to zeromq on the dev side and looking for the best layout to use
> for a server/client setup where the server can send commands to clients and
> also the clients can send data back to the server without being told to run
> a command. Pretty much like the client checking in with some data it found
> on the server as it happens instead of waiting for the server to say ok run
> this command give me data back.

I believe you need a DEALER/ROUTER pair. REQ/REP is limited in that
it's a strict back-and-forth communication pattern: 1 request, 1
reply, 1 request, ad infinitum. So REQ/REP is not terribly useful in
real-world apps like yours.

DEALER/ROUTER is the real-world version of REQ/REP -- either peer can
send a message at any time.

IIUC, the typical usage is DEALER for the client connected to ROUTER
on the server.


More information about the zeromq-dev mailing list