[zeromq-dev] Why doesn't 0mq save fd by merging sockets connecting to the same address?
Yichao Zhang
echaozh at gmail.com
Mon Oct 17 09:03:50 CEST 2011
Won't some 0mq socket types benefit from multiplexing over TCP, say the
receivers connecting to a load balancing sender? Say you have 100 PULL
sockets all connecting to the same PUSH socket, any PULLer can wake up and
read the first packet out. The problem you describes doesn't affect this
case.
I know it's easy to set up a STREAMER device for this case, but this pattern
may be common enough to be worth a solution inside the core library. It's
easier for the library users and more efficient. I think the fds are also
worth saving, along with the implicitly bound local ports.
-- Yichao
On Sat, Oct 15, 2011 at 12:56 PM, Martin Sustrik <sustrik at 250bpm.com> wrote:
> On 10/15/2011 09:52 PM, Yichao Zhang wrote:
>
>> Hi all,
>>
>> If you create N sockets from the same context and connect them all to
>> the same remote address, there will be N file descriptors opened by the
>> 0mq library. Am I wrong to assume that it is possible for the library to
>> use only 1 fd and multiplex incoming messages to socket mailboxes based
>> on their identifies?
>>
>
> I've wrote an whitepaper on that one. See here:
>
> http://www.250bpm.com/**multiplexing <http://www.250bpm.com/multiplexing>
>
> Martin
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20111017/3508fb9b/attachment.htm>
More information about the zeromq-dev
mailing list