On Tue, Jul 03, 2018 at 04:25:32PM +0100, Luca Boccassi wrote:
> On Tue, 2018-07-03 at 16:08 +0200, Charles Bouillaguet wrote:
> > I'm facing a reliability problem that I couldn't solve by myself so
> > far.
> > ...

> 1) Don't close/reopen the socket, you can avoid blocking with DONTWAIT
> by itself
> 2) Enable the heartbeat options for faster automated disconnects and
> reconnects

I tried the approach you suggested, to no avail (but I may have done it wrong).

Long story short : the "client" connects a PUSH socket and the "server" binds a
PULL socket. The client then pushes messages.

When everything gets stuck, I observed that restarting either the server or the
client re-establishes the flow. I tried to do this on the client (only):

       socket = zmq_socket(zmq_ctx, ZMQ_PUSH);
       int heartbeat_interval = 1000; // milliseconds
       int heartbeat_timeout = 5000; // milliseconds
       zmq_setsockopt(socket, ZMQ_HEARTBEAT_IVL, &heartbeat_interval, 
sizeof(heartbeat_interval));
       zmq_setsockopt(socket, ZMQ_HEARTBEAT_TIMEOUT, &heartbeat_timeout, 
sizeof(heartbeat_timeout));
       zmq_connect(socket, address);

and then:

       zmq_send(socket, &msg, sizeof(msg), ZMQ_DONTWAIT);

But alas! The server still stops receiving messages at some point. Should I also
setup Heartbeating on the server?

Thanks,
-- 
Charles BOUILLAGUET
Université de Lille - Sciences et Technologies
[email protected] | www.univ-lille1.fr
Laboratoire CRIStAL - Bât M3 - Bureau 332 - 59655 Villeneuve d'Ascq
Tél. +33 (0)3 28 77 85 84
homepage:  http://cristal.univ-lille.fr/~bouillag/

Attachment: signature.asc
Description: PGP signature

_______________________________________________
zeromq-dev mailing list
[email protected]
https://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to