[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: error handling in async functions



At 11:36 PM 4/4/00 +0300, Adrian Pavlykevych wrote:
>I'm writing LDAP client application using OpenLDAP 2.0-dev, my application
>should handle server failures, so I'm implementing rebinding routines around
>calls to ldap_search(), which poses following question:
>Where I can find list of connection related errors reported by asynchronous
>ldap_search(), and which are handled by ldap_result()?

If ldap_search() returns an error, it's unlikely that the request
was sent to the server.  Hence, you'd likely not bother to call ldap_result()
for response.

>I need to catch all possible server failures while operating  asyncronously -
>ldap_result() is in polling mode.
>
>I've read RFC1823, but it doesn't cover the topic which errors are reported on
>which stage folowing execution path:
>ldap_init()
>ldap_bind()
>ldap_search()
>while(ldap_result()) {
>        [ ... processing ... ]
>}

Since you're toying with devel codes, you should read the ldap-c-api
I-D in the docs/drafts directory.

>Could someone tell, when connection errors could be reported (e.g. whenever
>socket operation errors will be reported by ldap_search() or ldap_result()?

You should avoid worrying about socket
errors and just deal with LDAP result codes.