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

Re: ldap_result returns 0 before exceeding timeout



----- Original Message ----- 
From: "Kurt D. Zeilenga" <Kurt@OpenLDAP.org>
To: <xin@autograf.pl>
Cc: <OpenLDAP-software@OpenLDAP.org>
Sent: Thursday, March 24, 2005 12:20 AM
Subject: Re: ldap_result returns 0 before exceeding timeout


> At 07:07 AM 3/23/2005, xin@autograf.pl wrote:
>>Hey,
>>
>>I'm performing ldap_modify operation and than getting result by calling ldap_result.
>>
>>If I set timeout to 1s mostly it executes correctly, but sometimes ldap_results returns 0 after 5ms as it would have exceeded timeout. If I set timeout to 500ms it always returns 0 after very short time (~5ms). If I set timeout to 1.1s it executes always correctly.
>>
>>Anyone have any idea why is it happening? I would like to have this timeout shorter than 1s.
> 
> There are a number of reasons why ldap_result() will return
> sooner than the timeout (as well as a number of reasons why
> the return will be longer than the timeout).  Your program
> needs to deal with these possibilities in some appropriate
> manner.
> 
> Kurt


Im using OpenLdap-2.2.24 on Linux. Ldap server is running on remote host and my client is coded with C API.

I'm only changing timeout value and with 500ms it doesn't work while with 1100 ms it works. Maybe there is problem with two ways of specifying timeouts? Im setting LDAP_OPT_NETWORK_TIMEOUT and Im also using timeout parameter in ldap_result functions. Just before this modify operation Im also doing ldap_search (with following ldap_result with also timeout set).

Tomas