Initializes an LDAP session with another LDAP server.
Syntax
#include "slapi-plugin.h"
LDAP *slapi_ldap_init( char *ldaphost, int ldapport, int secure,
int shared );
Parameters
The function has the following parameters:
Returns. One of the following values:
Description. This function initializes an LDAP session with another LDAP server. If you want
to connect to another LDAP server over SSL or if you want to allow multiple
threads to use the same connection, call this function instead of the
ldap_init() function provided with the Netscape Directory SDK.
This function allocates an LDAP structure containing information about the session, including the host name and port of the LDAP server, preferences for the session (such as the maximum number of entries to return in a search), and the error code of the last LDAP operation performed.
You can specify a list of LDAP servers that you want to attempt to connect to. Your client will attempt to connect to the first LDAP server in the list. If the attempt fails, your client will attempt to connect to the next LDAP server in the list.
If you specify a non-zero value for the secure argument, this function initializes the plug-in for SSL and installs the I/O routines for SSL.
If you specify a non-zero value for the shared argument, this function installs the server's threading functions and allows multiple threads to share this session (the returned LDAP structure). Note that the Netscape Directory Server processes each request in 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() function (not the ldap_unbind() or ldap_unbind_s() functions provided with the Netscape Directory SDK) when you are done with the session.
Example
[To be added]
See Also