Share via


Closing a Connection

When an LDAP client has finished communicating with a server, and all necessary memory cleanup is complete, call ldap_unbind or ldap_unbind_s to unbind from the directory, close the connection, and dispose of the session handle. Call one of these functions whenever you have finished with a connection, even if you have not explicitly called a bind function to open the connection.

Both ldap_unbind and ldap_unbind_s work synchronously. There is no server response to an unbind operation. Make sure that you do not inadvertently call either unbind function more than once on a session handle because doing so can free resources that you did not intend to release.

See Also

Using the LDAP API

 Last updated on Friday, April 09, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.