[zeromq-dev] Question on Connect

Pieter Hintjens ph at imatix.com
Mon Aug 22 18:10:59 CEST 2011

On Mon, Aug 22, 2011 at 5:42 PM, Gary Davidson
<Gary.Davidson at interclick.com> wrote:

> How do I tell if I am connected to nothing? Bind throws an exception.
> If ops changes an IP on the (Bind) server, how would the (Connect) server know it was no longer connected or worse starts up and is connected to nothing.

So there is no default way to know whether a connect is alive or not.
There are a few techniques to eliminate the risk of bogus connects.

You can use a name resolution service running on a fixed DNS name,
that turns service names into IP address/port strings. Then, services
would register with their current IP address and port, and clients can
look those up. Alternatively, use DNS names for all services (that

Second technique is to heartbeat connections, so that clients know
when servers disappear and/or aren't running at all.


More information about the zeromq-dev mailing list