[zeromq-dev] 0MQ 4 - how to detect closed stream socket ?
KIU Shueng Chuan
nixchuan at gmail.com
Sat Apr 26 03:47:58 CEST 2014
Being informed about both connects and disconnects might be useful for
other use cases.
Looks like one could practically avoid using bsd tcp sockets now.
On 26 Apr 2014 07:27, "Pieter Hintjens" <ph at imatix.com> wrote:
> Is that what you'd expect? It seems a good minimal solution.
>
> On Fri, Apr 25, 2014 at 11:52 PM, KIU Shueng Chuan <nixchuan at gmail.com>
> wrote:
> > It turns out that this functionality was added in January to libzmq.
> > An empty message is sent both on connect and also upon disconnect.
> >
> > The net effect for my use case is that one receives 2 empty messages when
> > the connection breaks and then when it gets reconnected.
> >
> >
> > A pair of python scripts that demonstrate the behavior (A tcp publisher
> > subscribed using zmq_stream):
> > https://github.com/pijyoi/test_zmqstream
> >
> >
> >
> > On Thu, Apr 24, 2014 at 6:40 PM, Pieter Hintjens <ph at imatix.com> wrote:
> >>
> >> On Thu, Apr 24, 2014 at 12:35 PM, KIU Shueng Chuan <nixchuan at gmail.com>
> >> wrote:
> >>
> >> > Sadly, I am dealing with "publisher" TCP-servers that start sending
> data
> >> > upon client connection. The protocol is some small fixed header
> followed
> >> > by
> >> > a variable length message.
> >> >
> >> > A ZMQ_STREAM server already uses sending of an empty message in order
> to
> >> > disconnect a client. Would be nice if an empty message could be
> received
> >> > by
> >> > the ZMQ_STREAM client upon disconnection.
> >>
> >> This sounds familiar, so may already be implemented. I've not used
> >> ZMQ_STREAM much. Signaling the end of a connection with an empty
> >> message is definitely a decent idea.
> >>
> >> -Pieter
> >> _______________________________________________
> >> zeromq-dev mailing list
> >> zeromq-dev at lists.zeromq.org
> >> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
> >
> >
> >
> > _______________________________________________
> > zeromq-dev mailing list
> > zeromq-dev at lists.zeromq.org
> > http://lists.zeromq.org/mailman/listinfo/zeromq-dev
> >
> _______________________________________________
> 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/20140426/db968317/attachment.htm>
More information about the zeromq-dev
mailing list