Hello,

I have to implement an LDAP client in C for Unix, which has to submit
several LDAP requests in parallel and consequently to process their
responses asynchronously.
Given the specific requirements of my application, the ideal situation for
this LDAP client would be to be notified when a request is completed (e.g.
when all searchResultEntries, searchResultReferences and searchResultDone of
a given search request are received). For instance, the notification could
be the call of a callback function with the messageId of the request as a
parameter.

I looked at the Netscape SDK 4.1 Programmer's Guide, but there is no notion
of "end-of-request" notifications. The only way to check if a request is
completed is to call the "ldap_result()" function for the messageId of each
outstanding request, in a waiting or polling mode.

I also spotted that the application could get the "socket descriptor
underlying the main LDAP connection" with the "ldap_get_option()" function
(see pages 395 and 396 of the Programmer's Guide).
Can this socket descriptor be used in a "poll" or "select" statement, so
that the application is waken up when something is available for reading on
this socket, i.e. when some LDAP results come back from the LDAP server?
Can the results be retrieved by the ldap_result() function at that time?
Are there any traps and/or tricks related to this approach (or is it simply
unfeasible?) ?

All remarks and suggestions are very welcome.

Thank you


Laurent




Reply via email to