Cisco Knowledge Suite Cisco SystemsCisco Press

Cutting Edge
Core Reference
Guided Learning
Networking Architecture
Internet Protocols (IP)
Network Protocols
Transport and Application Protocols
Desktop Protocols
Security and Troubleshooting
Network Resources and Management
Integrated Services

Overview of the LDAP C API

by Timothy A. Howes, Ph.D., and Mark C. Smith - May 30, 2000

Overview of the

Synopsis and Objectives


The Core LDAP Functions


Typical Use of the LDAP Library


Synchronous Versus Asynchronous Use of the LDAP C API






Synchronous Versus Asynchronous Use of the LDAP C API

The LDAP protocol is completely asynchronous in that multiple operations can be underway at the same time, and the directory server can perform the operations and return results in any order. Each message that is passed in the protocol is tagged with a number, called the message ID, which is unique within a given session. This feature of LDAP supports complex applications that want to initiate several operations at once, without opening multiple connections to the server.

After an asynchronous operation is initiated, the application must call ldap_result() to check on the status of the operation and retrieve the result(s) sent by the LDAP server. This interaction is shown in Figure 1.1.

Figure 1.1

Asynchronous LDAP API interaction.

The LDAP C API supports this asynchronous paradigm with the core API functions, but it also provides a simpler set of synchronous functions. These functions are named so that they end in s—for example, ldap_search_s() instead of ldap_search(). The synchronous functions combine initiating a request and waiting for the server's response, and eliminate any need to worry about message IDs and other details. This interaction is shown in Figure 1.2.

Figure 1.2

Synchronous LDAP API interaction.

Using the synchronous LDAP operation functions has the disadvantage that the application will block (wait) until the server completes the request and returns all entries and the final result message to the application.

By using the asynchronous API functions, you can ensure that your application (and its users) will not be locked out of the opportunity to do other work while the directory server is handling a request. On the other hand, for simple applications, you will find it much easier to use the synchronous calls.


Previous | Next



Breaking News

One of the primary architects of OpenCable, Michael Adams, explains the key concepts of this initiative in his book OpenCable Architecture.

Expert Advice

Ralph Droms, Ph.D., author of The DHCP Handbook and chair of the IETF Dynamic Host Configuration Working Group, guides you to his top picks for reliable DHCP-related information.

Just Published

Residential Broadband, Second Edition
by George Abe

Introduces the topics surrounding high-speed networks to the home. It is written for anyone seeking a broad-based familiarity with the issues of residential broadband (RBB) including product developers, engineers, network designers, business people, professionals in legal and regulatory positions, and industry analysts.


From the Brains at InformIT


Contact Us


Copyright, Terms & Conditions


Privacy Policy


© Copyright 2000 InformIT. All rights reserved.