[zeromq-dev] Socket connect status via getsockopt

1,656 views
Skip to first unread message

Mattias de Zalenski

unread,
Jan 27, 2012, 7:44:14 AM1/27/12
to zerom...@lists.zeromq.org
Hi,

I am wondering whether there is any way to check, for a zeromq socket using tcp, whether the underlying tcp connection/s is/are currently connected.

Could this be done with a zmq_getsockopt, specific to tcp zmq sockets? I would like something like ZMQ_NCONNECTED, to return the transient number of underlying sockets currently in a connected state.

The use case is for request routing. We will use heartbeats and load statistics, but for the simple case where an endpoint is explicitly shut down we would like to send incoming requests to other endpoints primarily, without waiting for HWM, heartbeats or other measures to react.

Best regards,
Mattias


--
Mattias de Zalenski
Software Developer
Spotify

This e-mail (including any attachments) may contain information that is
confidential and/or privileged. It is intended only for the recipient(s).
If you have reason to believe that you are not the intended recipient of
this e-mail, please contact the sender immediately and delete the e-mail
from your computer.

Chuck Remes

unread,
Jan 27, 2012, 8:45:36 AM1/27/12
to ZeroMQ development list
On Jan 27, 2012, at 6:44 AM, Mattias de Zalenski wrote:

> Hi,
>
> I am wondering whether there is any way to check, for a zeromq socket using tcp, whether the underlying tcp connection/s is/are currently connected.
>
> Could this be done with a zmq_getsockopt, specific to tcp zmq sockets? I would like something like ZMQ_NCONNECTED, to return the transient number of underlying sockets currently in a connected state.
>
> The use case is for request routing. We will use heartbeats and load statistics, but for the simple case where an endpoint is explicitly shut down we would like to send incoming requests to other endpoints primarily, without waiting for HWM, heartbeats or other measures to react.

No, this information is not exposed. YOu will need to wait for your other measures to react.

cr


_______________________________________________
zeromq-dev mailing list
zerom...@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply all
Reply to author
Forward
0 new messages