Netscape DIRECTORY SERVER 6.1 - PLUG-IN Manual page 371

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
a 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, after calling
ldap_set_option()
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). Note that the Directory Server processes each request in
LDAP
function (not the
slapi_ldap_init()
with the
/* 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_X_OPT_CONNECT_TIMEOUT
Functions for Thread-Safe LDAP Connections
or
ldap_unbind_s()
, you can use the
LDAP *
slapi_ldap_init()
option as illustrated
Chapter 15
Function Reference
, call
371

Advertisement

Table of Contents
loading

This manual is also suitable for:

Directory server 6.1

Table of Contents