Questions about using LDAP_OPT_RECONNECT?

"Matthew M. DeLoera" <[email protected]> Wed, 23 Sep 2009 16:45:02 -0400
Newsgroups gmane.comp.mozilla.devel.directory
Message-ID <[email protected]>
Background - I'm using AD2008 with default MaxConnIdleTime of 900 secs.

My service asynchronously binds (ldap_simple_bind / ldap_result), and at 
various times issues asynchronous queries (ldap_search_ext / 
ldap_result). My cache is configured for 30 seconds (but I don't think 
it matters with respect to my questions).

- By the way, does anyone know of a way to query values for some of 
these attributes like MaxConnIdleTime or MaxActiveQueries? I can query 
the rootDSE and see which attributes are supported on the server, but I 
can't quite find info on how to query the actual values, if possible. 
Tips would be greatly appreciated! :)

My main questions regard LDAP_OPT_RECONNECT. When I've been idle for 
longer than MaxConnIdleTime, I get the expected LDAP_SERVER_DOWN from 
ldap_search_ext. I can always unbind/rebind and then query successfully. 
But, from reading Chapter 4 of the Mozilla LDAP C SDK Programmer's Guide 
("Writing an LDAP Client"), what is the expected behavior of 
LDAP_OPT_RECONNECT?

I tried setting it (LDAP_OPT_ON) after calling ldap_init, but before 
calling ldap_simple_bind. When I hit the max idle time, each call to 
ldap_search_ext immediately returns LDAP_SERVER_DOWN. Isn't the library 
supposed to internally rebind for me? I didn't yet try running Wireshark 
to watch TCP activity, but can someone confirm what behavior I should 
expect in this situation? Will ldap_search_ext simply fail until 
successfully rebound? Just these basic questions.

Any info would be appreciated. I'm still trying a few different tests to 
better understand behavior.

Thanks!
- Matthew