Table of Contents | Previous | Next | Index

Netscape Directory SDK 3.0 for C Programmer’s Guide
     Chapter 18 Functions

ldap_unbind()

The ldap_unbind() function unbinds from the directory, terminates the current association, and frees the resources contained in the LDAP structure. The ldap_unbind() routine works just like ldap_unbind_s(); both routines are synchronous.

For additional information, see "Closing the Connection to the Server" on page 66.

Syntax

#include <ldap.h>
int ldap_unbind( LDAP *ld );

Parameters

This function has the following parameters:

ld

Connection handle, which is a pointer to an LDAP structure containing information about the connection to the LDAP server.

Returns

For a list of possible result codes for an LDAP unbind operation, see the result code documentation for the ldap_unbind_s() function.

Example

The following code closes the current connection with the LDAP server:

#include <ldap.h>
...
LDAP *ld;
...
/* After completing your LDAP operations with the server, close the connection. */ 
if ( ldap_unbind( ld ) != LDAP_SUCCESS ) {
   ldap_perror( ld, "Error while unbinding from the directory" );
   return( 1 );
}
...

See Also

ldap_unbind_s().


Table of Contents | Previous | Next | Index

Last Updated: 10/01/98 17:06:23