[Date Prev][Date Next] [Chronological] [Thread] [Top]

RE: test if the ldap connection is alive



> -----Original Message-----
> From: owner-openldap-software@OpenLDAP.org
> [mailto:owner-openldap-software@OpenLDAP.org]On Behalf Of Francois Beretti

> Hello all
>
> I am writing a program using libldap
> I would like to write a function to test if the LDAP
> connection I use is
> still alive (eg if the user hasn't unplugged its network cable, or if
> the server hasn't been shutdown)
>
> Has anyone already done this ? I have no idea about how to write it.

You can't. If the remote server's network cable has been unplugged, or the
machine has had a power failure, you have no way to discover this directly on
the client. All you can do is use the connection as normal and wait for TCP
to give up trying to retransmit the last data you sent. If the server was on
the same physical network as the client you may get ICMP error messages
telling you the address is no longer responding, but that still takes a
couple minute delay to be detected.

  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun
  http://www.symas.com               http://highlandsun.com/hyc
  Symas: Premier OpenSource Development and Support