Quanah Gibson-Mount wrote:
--On Sunday, April 01, 2007 12:52 AM -0400 Brandon McCombs
<bmccombs(a)ma.rr.com> wrote:
> Hello,
>
> Can anyone tell me whether OpenLDAP has provisions for a client to
> determine whether a connection has timed out proactively instead of
> alerting a user that the connection has been closed due to timeout only
> after they attempt an operation? If not then I'll know I will have to
> roll my own method of keeping the connection alive through a periodic
> query of some sort.
You might look at the persistent search function in my
Stanford::Directory perl module:
<
http://www.stanford.edu/services/directory/clients/perl.html>
which tests to see if the connection has closed, and if it has,
reopens it, before performing a search.
Well I couldn't use the Perl module directly since my app is coded in
Java but looking at the script seems to suggest the ability to test for
an error code of -1 which would indicate the need for another connection
handle. If that is correct, then I am basically already doing that
because that method is still attempting a query and checking the return
code to determine if the query needs to be resent to the server.
Without performing some type of client-side polling using a query to
keep the connection open, there probably isn't any other way anyway.
thanks