Slapi_Ldap_Unbind() - Netscape DIRECTORY SERVER 7.0 - PLUG-IN Manual

For plug-in
Table of Contents

Advertisement

If you specify a non-zero value for the
server's threading functions and allows multiple threads to share this session (the
returned
separate thread. When handling multiple requests, it is possible for the server to
call your plug-in function concurrently for different threads.
If you initialize a session by calling this function, make sure to call the

slapi_ldap_unbind()

functions provided with the Directory Server SDK) when you are done with the
session.
As the
LDAP C SDK connect timeout feature for plug-ins. That is, when connecting to an
external LDAP server from a plug-in, you can specify a time limit for establishing
the connection. To specify the timeout, call
LDAP_X_OPT_CONNECT_TIMEOUT
illustrated in the sample code below:
void
my_ldap_function( void )
{
LDAP *ld;
int to = 5000;
if (( ld = slapi_ldap_init( host, port, 0, 1 )) == NULL ) {
}
if ( ldap_set_option( ld, LDAP_X_OPT_CONNECT_TIMEOUT, &to ) != 0 ) {
}
/* use the handle, e.g., call ldap_search_ext() */
slapi_ldap_unbind( ld );
return 0;
}
slapi_ldap_unbind()
Unbinds from another LDAP server and frees the resources contained in the LDAP
structure.
structure). The Directory Server processes each request in a
LDAP
function (not the
slapi_ldap_init()
/* 5000 milliseconds == 5 second timeout */
/* error trying to create an LDAP session */
return -1;
/* error setting timeout */
slapi_ldap_unbind( ld );
return -1;
argument, this function installs the
shared
ldap_unbind()
function returns a regular
ldap_set_option()
option after calling
Functions for Thread-Safe LDAP Connections
or
ldap_unbind_s()
, you can use the
LDAP *
with the
slapi_ldap_init()
Chapter 15
Function Reference
, as
381

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the NETSCAPE DIRECTORY SERVER 7.0 - PLUG-IN and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Netscape directory server 7.0

Table of Contents