ldapsdk
ldapsdk copied to clipboard
SocketException: Socket closed if Debug.setEnabled(true)
Hello! I'm trying to debug Active Directory persistent search and enabled debug via Debug.setEnabled(true). I've noticed that for very basic example (open connection, close connection without pool) no exception occurs in main thread, but connection reader daemon thread finishes with exception: java.net.SocketException: Socket closed ... at com.unboundid.ldap.protocol.LDAPMessage.readLdapResponseFrom(LDAPMessage.java:1198)
As I understand daemon thread waits for response from server, but if connection closed it should terminate gracefully. You should catch SocketException and determine if it's an expected outcome (set some boolean flag before actually closing connection in LDAPConnection.close)
Please fix this otherwise it's very inconvenient to debug my functionality. When exception occurs I don't know if it's flaw in my code (or server response) or it's an expected scenario