Timeout call back in asynchronous web request.

A

archana

Hi all,
I am processing asynchronous web request with setting timeout using
RegisterWaitForSingleObject.

On beginwebrequest i am sending address of one callback which i want to
execute when asynchronous web request complete.

My doubt is if timeout error occured while processing asynchronous
webrquest, will call back i set on beginwebreqest gets executed or not.

Please correct me if i am wrong.

thanks in advance.
 
C

Chris Mullins

archana said:
I am processing asynchronous web request with setting timeout using
RegisterWaitForSingleObject.

On beginwebrequest i am sending address of one callback which i want to
execute when asynchronous web request complete.

My doubt is if timeout error occured while processing asynchronous
webrquest, will call back i set on beginwebreqest gets executed or not.

I'm not familure with BeginWebRequest, but the general Async pattern is
pretty much the same.

If you get an error, the flow is likley to be:
- You callback will fire
- You'll call EndWebRequest(ar)
- When you call EndWEbRequest, you'll get your TimeoutException

This is how almost all of the Async stuff in .Net works...
 
A

archana

Hi,

thanks for your reply.

Ideally whatever callback i specified in BeginGetResponse, that should
get called if timeout occured.

This is not happening in my case.

I have created log file in which i am writing data when timeout
callback fired and when callback specified in BeginGetResponse gets
fired.

When timeout callback fired entry gets added into log file but it is
not firing callback which i specified in BeginGetResponse.

Can you tell me why this is happneing. Or am i executing more
asychronos callback. Means is there any limit on number of asynchronous
callback to be executed.

Please correct me if i am wrong.

Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top