From: Chris F. <cf...@vi...> - 2002-01-10 17:18:27
|
On Thu, 10 Jan 2002 08:34:04 -0800 "Eric Parusel" wrote: +------------------ | Hi, | | I'm trying to get a perl script I've written to stay connected to | my LDAP server between searches... | This works great, until I take the LDAP server offline for a moment... | What happens is that I the next $ldaps->search comes around, which | results in a "Broken Pipe" and the program exiting. | I'd obviously prefer if, before that point, a check could be done, and | if the connection was dropped, try reconnecting. | | So basically, is it possible to have a persistent ldap connection & | bind that will re-connect if disconnected? | | I was unable to find anything in the archives with a clear solution... +------------------ If $ldap = Net::LDAP then the underlying IO::Socket is available as $ldap->socket. You can check this for connected status with something on the lines of if (!$ldap->socket->connected) { # ... } It'd be nice if this method were documented. -- |