On Thu, 2018-03-22 at 21:53 -0400, Jasper Jaspers wrote:
> In my application (C++ / Linux / zeromq 4.2)  there are several
> sockets
> within a single context.  Some of the REQ-REP sockets have transient
> servers and the clients need to be reconnected gracefully and quickly
> when
> the servers change.  I'm having problems reconnecting the client side
> of
> the REQ-REP socket when the server side changes.  The client's REQ
> socket
> is stuck waiting for a reply from the server's REP socket that it
> never
> gets.
> 
>  I have a way of notifying the client that the server has changed and
> it
> needs to reconnect, however I don't know how to unblock the client's
> receive call ( waiting for the reply).  I do have a timeout set on
> receive
> call but I'd like to have the client reconnect a lot sooner than
> waiting
> for the timeout to expire before reconnecting.  I see that calling
> zmq_term() on the context should unblock the receive call, but I
> can't use
> that since I have other connected sockets within the context that I
> don't
> want to disrupt.  Does anyone have a suggestion on how to resolve
> this?

If the endpoint stays the same look at the heartbeats options.
If the endpoint changes, you'll need to zmq_disconnect and zmq_connect

-- 
Kind regards,
Luca Boccassi

Attachment: signature.asc
Description: This is a digitally signed message part

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

Reply via email to