[zeromq-dev] 0MQ 2.0 Model Question
tom schuring
tomschuring at gmail.com
Thu Oct 8 13:23:53 CEST 2009
> The most functionality is on the replier side. Instead of handling
> 10000 connections being created and dropping of asynchronously,
> sending requests and waiting for replies, all you have to do is:
>
> socket_t s (ctx, ZMQ_REP);
> s.bind ("tcp://eth0:5555");
> while (true) {
> message_t request, reply;
> s.recv (&request);
> ... process the request ...
> s.send (reply);
> }
>
> NB that this code is handling many simultaneous connections not only
> a single pair of peers.
>
> As for reliability, there are some advantages there (like setting a
> connection identity so that when reconnection happens, the system
> knows it's the 'same' connection and handles the queue limits and
> other associated issues accordingly). However, these features are
> not fully implemented so I'm not going to detail here.
>
> Martin
Hello Martin,
thank you for taking time to explain this to me. It is much
appreciated by me.
Best Regards,
tom
More information about the zeromq-dev
mailing list