From: Chris R. <chr...@me...> - 2002-02-28 17:59:30
|
Graham Barr <gb...@po...> wrote: > On Thu, Feb 28, 2002 at 05:00:55PM +0100, Michael Frankl wrote: >> Hi, >> >> I am using Net::LDAP under a mod_perl environment and have one Problem: >> the Socket is alive as long as the apache-child is alive. > > Sounds like you are storing $ldap in a global variable. > >> I tried several things to fix it: >> >> - calling unbind at finalization does not help (netstat-status >> CLOSE_WAIT). > > CLOSE_WAIT is the normal thing to happen. > > The kernel puts all sockets into CLOSE_WAIT upon close. THis is to > prevent reuse of the port number and then getting some rouge packets Rouge, or rogue? ;-) > from the net that were actually sent to the previous process. > > Graham. Some LDAP servers treat an unbind as a request to close the socket, but others do not. I suspect you need to close the socket in the client, and you would do that by setting $ldap to undef; or letting $ldap go out of scope so that the destructor gets called, as it is the destructor that closes the socket. (If memory serves.) Cheers, Chris |