[zeromq-dev] multiplexer pattern

Jakub Witkowski jpw at jabster.pl
Sun Sep 18 19:30:03 CEST 2011


2011/9/18 Martin Sustrik <sustrik at 250bpm.com>:
> On 09/18/2011 06:31 PM, Jakub Witkowski wrote:
>
>> Yes, I gathered that from the thread. Still, does this mean that with
>> 4.x we will have this event exposed?
>> This will make some of the most compelling use cases (Like the Titanic
>> pattern) of ZMQ a lot less appealing.
>
> Yes. It's already there.
>
> How it works is that certain messages are marked as commands. In pseudocode:
>
> bool cmd = s.getsockopt (ZMQ_RCVCMD);
>
> The command is either "connect" event (1) of "disconnect" event (2) -- the
> command ID is encoded as the first byte of payload. In both cases it is
> followed by connection ID.
>
> The API is only a strawman so far. Comments are welcome.
>

I won't pretend I know C well enough to comment. (I'm using clrzmq2
right now, but I will probably use Go and Python/Ruby bindings soon,
too)

This made me actually aware that I was exposing my gateway to
potential memory exhaustion attack via persistent buffers to
non-existant backends. Oh well, better now than after deployment.

> Martin
>

Jakub.



More information about the zeromq-dev mailing list