[zeromq-dev] Problem with lost clients

Michel Pelletier pelletier.michel at gmail.com
Wed Apr 22 18:10:28 CEST 2015


There's good information in the guide about solving these kinds of
problems.  In particular:

http://zguide.zeromq.org/hx:chapter7#State-Machines

But read the whole chapter, it will explain credit based flow control and
heartbeating as well.

-Michel

On Wed, Apr 22, 2015 at 8:01 AM, Diego Fons <diego.fons at intraway.com> wrote:

> Hi,
>
> I'm building an application that consists of several clients using DEALER
> sockets which connects to one server using ROUTER socket.
>
> The communication is quite simple:
>   - Client sends a START message to server.
>   - Server sends back an OK message to client.
>   - Server starts sending a stream of data to server (until client asks to
> stop it).
>   - Client sends a STOP message to server.
>   - Server sends back an OK message to client.
>
> The problem:
>   - Client sends a START message to server.
>   - Client crashes.
>   - Server sends back an OK message to client.
>   - Server starts sending a stream of data to server (until client asks to
> stop it).
>
> The client never sends the STOP an the server will continue sending
> messages until the HWM is reached. The problem is not how to know when a
> client dies, I'm able to know it. The problem is how to release all the
> resources used by ZMQ in order to handle the dead client, I mean, all those
> enqueued messages.
>
> The only solution I see untill now, is to close the ROUTER and re-bind it,
> but I face the problem that another client (several ones) could be
> perfectly working ans if I close the ROUTER, may be some data could be lost.
>
> So, I have two options:
>   1) Wait untill no clients are active and close the ROUTER.
>   2) Try to change the pattern (possibly use a pattern with two
> communication channels).
>
> Any comments about his?
>
> Regards.
>
> --
> Diego Andrés Fons
> Intraway Corp.
> Solution Developer
> AR Office: +54 (11) 6040 4000
> US Office: +1 (516) 620 3890
> Email: diego.fons at intraway.com
>
> Visit our website at http://www.intraway.com
> Proud to be an ISO 9001:2008 certified company
>
> _______________________________________________
> 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/20150422/71d4a78f/attachment.htm>


More information about the zeromq-dev mailing list