From: Kurt D. Z. <Ku...@Op...> - 2000-07-27 15:03:57
|
At 12:20 PM 7/27/00 +0100, Chris Ridd wrote: >Jonathan Leto <jon...@le...> wrote: >>If I had problem with timeouts, you would just have to come up with a >>heuristic of checking if the server is alive ( I dont' think anything >>like $ldap->ping exists, THAT would be cool ) and then do a check at the >>beginning of every function. I suggest you attempt an anonymous bind. This should always return a result (possibly indicating an error). If you want to force an error, select version MAXINT. >The best (ie cheapest in terms of protocol) way to do that in LDAPv3 would be to read a specific attribute (eg supportedLDAPVersions) from the root DSE, and throw away the results. Or ask for attribute "1.1"... (you'll have less to throw away). >I can't think of a simple and portable way to do this in LDAPv2. Anonymous bind. In fact, I suggest as a cheap general solution for all versions of LDAP. Anonymous binds are generally quite cheap... in fact may be even cheaper than accessing the LDAPv3 root DSE (depending on implementation). Kurt |