From: Eric P. <li...@gl...> - 2002-01-10 19:29:28
|
> 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. Hmm, no such luck finding $ldap->socket->connected.... I've found that $ldap->socket exists, but I could find anything in IO::Socket::SSL or IO::Socket::INET that indicated that there is a "connected" function (or anything similar to that)... Any ideas? Thanks, Eric Parusel |