Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

explicit disconnect in Net::LDAP

by amphiplex (Monk)
on Nov 11, 2002 at 17:02 UTC ( [id://211972]=perlquestion: print w/replies, xml ) Need Help??

amphiplex has asked for the wisdom of the Perl Monks concerning the following question:

Hi !

I have just experienced some problems with too many open connections to an LDAP server.
It looks like some script of mine is responsible for that, because I have never called unbind() but the script is running in mod_perl Registry mode.

Running some tests against netcat I saw that unbind() does not disconnect the socket, the network connection stays open.
I believe that this will only occur if the LDAP-server has a problem, but I would really like to make sure that the connection is closed.

Does anyone know of a way to close the socket using Net::LDAP ? I couldn't find anything in the docs.

Thanks,

---- amphiplex

Replies are listed 'Best First'.
Re: explicit disconnect in Net::LDAP
by mojotoad (Monsignor) on Nov 11, 2002 at 17:48 UTC
      Thank you, but I couldn't really find anything there either.
      Fortunately, a friend of mine looked into the code and found an undocumented method socket() which returns the socket used.

      So in case someone else has got troubles with buggy LDAP servers:
      my $ldap = Net::LDAP->new(...) .... $ldap->unbind() my $socket = $ldap->socket(); close $socket if $socket;

      ---- amphiplex

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://211972]
Approved by krisahoch
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (2)
As of 2024-04-25 21:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found