Table of Contents | Previous | Next | Index

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

ldap_unbind_s()

The 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.

Syntax

#include <ldap.h>
int ldap_unbind_s( 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

One of the following values:

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_s( ld ) != LDAP_SUCCESS ) {
   ldap_perror( ld, "Error while unbinding from the directory" );
   return( 1 );
}
...

See Also

ldap_unbind().


Table of Contents | Previous | Next | Index

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