[zeromq-dev] Problem with lost clients

Diego Fons diego.fons at intraway.com
Wed Apr 22 17:01:57 CEST 2015


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20150422/10081f00/attachment.htm>


More information about the zeromq-dev mailing list