[zeromq-dev] Idea: custom encoder/decoder for STREAM sockets

Pieter Hintjens pieterh at gmail.com
Sat Feb 1 21:34:30 CET 2014


That's how I implemented UDP for ZeroMQ years ago (project was called vtx).
Doable. A bit slow.
On Feb 1, 2014 5:52 PM, "Goswin von Brederlow" <goswin-v-b at web.de> wrote:

> On Sat, Feb 01, 2014 at 04:00:57PM +0100, Diego Duclos wrote:
> > I'm not sure this fits into zmq itself ? It should already be possible to
> > build this on top of a ØMQ socket without too much issues (any socket
> type,
> > really).
> >
> >
> > On Sat, Feb 1, 2014 at 3:44 PM, Goswin von Brederlow <goswin-v-b at web.de
> >wrote:
> >
> > > On Sat, Feb 01, 2014 at 08:32:08AM -0500, Lindley French wrote:
> > > > This approach might allow seamless integration of forward error
> > > correction libraries as well.
> > >
> > > Wouldn't you want to use that with any socket type? That would mean
> > > encoding/decoding gets stacked one on top of the other. Probably a
> > > larger change.
> > >
> > > MfG
> > >         Goswin
>
> I think it is possible by creating an aggregation thread and handle
> this on the application side.
>
> The aggregation thread would have 2 sockets, one STREAM and one DEALER
> or ROUTER I think. It would read from the STREAM socket, parse the
> incoming data and buffer it, one buffer per connection. Then, in the
> HTTP case, when it finds the \r\n\r\n that ends a request is would
> send the request as single message to the DEALER socket.
>
> But that adds quite a bit of overhead and needs a lot of error
> handling. Not to mention handling connection and disconnection
> notification and the faking a monitoring socket.
>
> MfG
>         Goswin
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20140201/5f8566a7/attachment.htm>


More information about the zeromq-dev mailing list