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.



On Thu, Apr 24, 2014 at 6:11 PM, Pieter Hintjens <[email protected]> wrote:

> This is indeed lacking in the client side use of ZMQ_STREAM. However
> most conventional TCP protocols don't return arbitrary data from the
> server without a request from the client first. That is, if the server
> is sending 10K bytes and the connection is broken, the client will get
> nothing more until it decides the connection is "dead" and then
> reconnects.
>
> -Pieter
>
> On Thu, Apr 24, 2014 at 3:09 AM, KIU Shueng Chuan <[email protected]>
> wrote:
> > I am trying out ZMQ_STREAM and it's great that (re)-connects are handled
> > asynchronously. However...
> >
> > Say a TCP server sends out 10000-byte messages such that multiple recv()s
> > are required to get the whole message. A ZMQ_STREAM client receives 1500
> > bytes and then the connection gets broken. (E.g. server gets killed and
> > restarted) How would the client know to reset its message assembling
> state
> > if it doesn't know about the disconnection?
> >
> >
> > On Sat, Oct 12, 2013 at 11:49 PM, Pieter Hintjens <[email protected]> wrote:
> >>
> >> Indeed... ZMQ_STREAM like all sockets will reconnect opportunistically
> >> so you don't get a formal notification of a closed socket.
> >>
> >> On Fri, Oct 11, 2013 at 9:03 PM, Charles Remes <[email protected]>
> >> wrote:
> >> > Via a timeout.
> >> >
> >> > On Oct 11, 2013, at 12:15 PM, [email protected] wrote:
> >> >
> >> >> How can I detect, that the server has closed a stream client socket ?
> >> >>
> >> >> Marten
> >> >> _______________________________________________
> >> >> zeromq-dev mailing list
> >> >> [email protected]
> >> >> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
> >> >
> >> > _______________________________________________
> >> > zeromq-dev mailing list
> >> > [email protected]
> >> > http://lists.zeromq.org/mailman/listinfo/zeromq-dev
> >> _______________________________________________
> >> zeromq-dev mailing list
> >> [email protected]
> >> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
> >
> >
> >
> > _______________________________________________
> > zeromq-dev mailing list
> > [email protected]
> > http://lists.zeromq.org/mailman/listinfo/zeromq-dev
> >
> _______________________________________________
> zeromq-dev mailing list
> [email protected]
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to