[zeromq-dev] 0MQ newbie - architecture question

Mike Turner sudochown at hotmail.com
Fri Apr 1 02:58:36 CEST 2011


Hi all,

I'm a trying to build more skills around networking, something I have little to none experience with. I'm writing a tiny application in my spare time using 0MQ and enjoying the learning experience thus far.

So far I've had success writing a simple single threaded host and client 1-to-1 application using one REQ-REP socket where the host messages the client and the client calls an appropriate function RPC-style.

Now, I'm trying to do a little more and wanted to request some architectural advice. I apologize in advance if this isn't the correct mailing list to be asking these types of questions.

Ideally what I would like is to retain this host-client relationship, but 1-to-N where there are N number of clients for 1 host. While N is going to remain relatively small (no more than 10, say). I'd like the host to be able to tell when a new client has connected and when an old client has dropped off. I would also like the host to be able to differentiate the clients and control messaging to them on an individual basis, i.e. not PUB-SUB since the host might want to send message 1 to client A and message 2 to client B. The host doesn't know the value of N, and N can change.

Additionally, I would like the host to be able to do step-wise calls. For instance, the host would want to wait until all clients respond to completing step 3 before telling clients to start on step 4. It would also be nice to know if 5 clients are on step 3, and a 6th client joins the party, for the host to be able to tell this information and have the 5 old clients wait while the 6th client catches up to step 3 before telling everyone to continue to step 4.

To support this, would the host need to have one thread with one REQ-REP socket per client? How would the host know when a new client connected? Would another separate thread on the host be needed with a PULL sink that each client will PUSH a message to? How would the host know when all N clients are done with each step?

Before I start heavily playing around with this, I wanted to bring these questions and my ideas up to see if I'm on the right track or way off base. I'm using 0MQ 2.1.3, writing C++ on Windows, for fun =). Thanks in advance for your comments.

-Mike
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20110331/c562f4bd/attachment.htm>


More information about the zeromq-dev mailing list