LDAP connection alive?
Michael Ströder
michael at stroeder.com
Mon Feb 2 08:20:32 CET 2004
Joao S. O. Bueno wrote:
>
> I apologize to posting this usage message to the devel list, but
> it is my most handy resource right now:
It's the only mailing list for python-ldap. So you're welcome to post here.
But please use an appropriate subject line for your own topic. Thanks.
> Which is the best way to check if a given connection is still alive?
> Maybe try a search with SCOPE_BASE in a node, and check for a time
> out? I'd need it not to be expensive to the ldap server, neither to
> delay the thread.
When I'm doing LDAP programming coaching this is a frequently asked question.
My answer is always: Don't do it. It's a bad habit. Implement proper
reconnecting instead.
BTW: That's what ldap.ldapobject.ReconnectLDAPObject is for. But you have to
understand what you're doing. And you have to understand the security
implications of storing credentials in the ReconnectLDAPObject instance
especially when pickling the instance on disk.
Ciao, Michael.
More information about the python-ldap
mailing list