On Fri, May 30, 2003 at 05:19:56PM +0100, Chris Ridd wrote: > On 30/5/03 5:00 pm, Neil McBennett <[EMAIL PROTECTED]> wrote: > > > Hi, I have a perl script which is using Net::LDAPS. > > The script sits in a loop, and each time round it binds to a directory > > server on port 636. At the end of the loop it does a unbind. > > The problem is that if I run netstat -a I see CLOSE_WAIT for each time it > > does this... i.e the code is not closing the socket. If I stop the script, > > the sockets get closed immediately. Am I doing something wrong here or > > could this be a bug somewhere in the Net:LDAPS code? > > > > Regards > > /Neil > > The unbind method just sends an unbind operation to the server. Socket > opening and closing is not part of the LDAP protocol, although some servers > treat an unbind as permission to close the socket. > > To close the connection, call $ldap->disconnect(), or just destroy the $ldap > object.
Best to call ->disconnect. There are situation where the can be a reference loop, which would cause issues. ->disconnect will make sure things are done properly. I am working on a fix for the reference loop. Graham.
