Re: Getting results ONE at a time?

Tim Howes (
Fri, 12 Apr 1996 15:51:27 -0400

> From: Nils Andreas Thommesen <>
> To:

> Does any of you know (if it is possible) the preffered way to
> get the results of a search one at a time?
> Instead of letting the user wait until *all* the entries are returned,
> I'd like to start presenting the results as soon as they start "ticking
> in."
> I know I can flag ldap_result to wait for the first entry after an
> asynchronous search, but how do I go from there to read the next and the
> next and the next ...?

You keep calling ldap_result(), asking for LDAP_RES_ANY entries. Each
time it returns, it will give you a single entry, and finally the
result. Take a look at the code for the ldapsearch tool in
clients/tools/ldapsearch.c. That should give you a good example of how
it works. -- Tim