ldap_unbind_s() function unbinds from the directory, terminates the current association, and frees the resources contained in the LDAP structure. The ldap_unbind_s() routine works just like ldap_unbind(); both routines are synchronous.
For additional information, see "Closing the Connection to the Server" on page 66.
#include <ldap.h>
int ldap_unbind_s( LDAP *ld );
ld |
Connection handle, which is a pointer to an |
LDAP_SUCCESS if successful. LDAP_ENCODING_ERROR if an error occurred when BER-encoding the request. LDAP_SERVER_DOWN if the LDAP server did not receive the request or if the connection to the server was lost. LDAP_NO_MEMORY if memory cannot be allocated. LDAP_NOT_SUPPORTED if controls are included in your request (for example, as a session preference) and your LDAP client does not specify that it is using the LDAP v3 protocol. Make sure that you set the version of your LDAP client to version 3 before calling this function. (For details, see "Specifying the LDAP Version of Your Client" on page 54.) #include <ldap.h>
...
LDAP *ld;
...
/* After completing your LDAP operations with the server, close the connection. */
if ( ldap_unbind_s( ld ) != LDAP_SUCCESS ) {ldap_perror( ld, "Error while unbinding from the directory" );
return( 1 );
}
...
ldap_unbind().
Last Updated: 10/01/98 17:06:23