the problem i see with the code posted is that apart from using IO
timeout it actually does asynchronous search with another timeout.
i would try replacing asynchronous search with synchronous and see
if it change things in this particular scenario on this platform.
note that windows stack is somewhat of blackbox in that regard and
i would certainly try to tweak test variables such as amount of
data sent ie try increasing to some realistic value and of course
running under debugger and inspecting it live can shed some light.
just to add to all this, here is an interesting note found on msdn:

"Note  When issuing a blocking Winsock call, such as send, recv, select, 
accept, or connect function calls, Winsock may need to wait for a 
network event before the call can complete. Winsock performs an 
alertable wait in this situation, which can be interrupted by an 
asynchronous procedure call (APC) scheduled on the same thread, and 
thereby create unspecified results. Do not issue blocking Winsock 
function calls without being certain that the current thread is not 
waiting inside another blocking Winsock function call; doing so results 
in unpredictable behavior."

as for the option PRLDAP_OPT_IO_MAX_TIMEOUT itself it simply relies
timeout to PR_Poll() of NSPR. used it numerous times on Solaris and
always had reliable and predictable results, windows i simply dunno.

Mark Smith wrote:
> RamaKrishna Narla wrote:
>> Hi Mark,
>>
>> I moved the code snippet that sets PRLDAP_OPT_IO_MAX_TIMEOUT to a
>> finite value, before to the ldap_simple_bind_s call, as per your
>> suggestion. But, there is no difference in output when
>> PRLDAP_OPT_IO_MAX_TIMEOUT is set to either 2000 ms or 1500 ms.
>> With 50 ms, ldap_simple_bind_s itself is failing, which we are not
>> interested in. Here, we are interested in testing the behavior of
>> asynchronous search operation.
>> Comments/Suggestions are welcome.
> 
> 50ms is a very short timeout (too short, almost certainly, to be 
> useful).  In any case, it sounds like there may be a problem with the 
> PRLDAP_OPT_IO_MAX_TIMEOUT option on Windows at least.  Is anyone else 
> using it there successfully?
> 
> Ramakrishna -- can you run under a debugger and look for the problem?
_______________________________________________
dev-tech-ldap mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-ldap

Reply via email to