Partager via


ldap_connect (Compact 2013)

3/26/2014

This function establishes a connection with the server.

Syntax

ULONG ldap_connect(
  LDAP* ld,
  PLDAP_TIMEVAL* timeout
);

Parameters

  • ld
    [in] Session handle.
  • timeout
    [in] Number of seconds to spend in an attempt to establish a connection before timing out.

Return Value

If this function succeeds, the return value is LDAP_SUCCESS.

If this function fails, it returns an error code. See the LDAP_RETCODE enumeration for a list of possible return values.

Remarks

Ordinarily a client does not call this function to establish a connection to the server. If the connection does not already exist, other functions make the call internally. However, there may be times when you want to specify additional options on the connection block. For example, a client can call ldap_init to initialize a session, and then call ldap_set_option to set a time-out on the connection block. The client then calls ldap_connect to connect to the server with a specified time-out.

Requirements

Header

winldap.h

Library

wldap32.lib

See Also

Reference

LDAP Session Functions
LDAP_RETCODE
ldap_init
ldap_set_option