473,796 Members | 2,826 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Timeout call back in asynchronous web request.

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

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.

Sep 18 '06 #1
2 4113
"archana" <tr************ **@yahoo.comwro te in message
I am processing asynchronous web request with setting timeout using
RegisterWaitFor SingleObject.

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(a r)
- When you call EndWEbRequest, you'll get your TimeoutExceptio n

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

--
Chris Mullins, MCSD.NET, MCPD:Enterprise
http://www.coversant.net/blogs/cmullins
Sep 18 '06 #2
Hi,

thanks for your reply.

Ideally whatever callback i specified in BeginGetRespons e, 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 BeginGetRespons e gets
fired.

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

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.

Chris Mullins wrote:
"archana" <tr************ **@yahoo.comwro te in message
I am processing asynchronous web request with setting timeout using
RegisterWaitFor SingleObject.

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(a r)
- When you call EndWEbRequest, you'll get your TimeoutExceptio n

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

--
Chris Mullins, MCSD.NET, MCPD:Enterprise
http://www.coversant.net/blogs/cmullins
Sep 19 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
9471
by: news.microsoft.com | last post by:
Hello I try to implement "retry" if connection to web ends with "time out". I want to give a chance to prolong waiting for response. The following code is taken from WebRequest.GetResponse() implementation. All I need to do is to modify line with "to change". My client uses derrived HttpWebRequest. I tried to implement new class MyHttpWebRequest and override GetResponse for it, but how can I create instance of this class. In .Net there...
2
1606
by: JMax | last post by:
Hello! I have a question that I really can’t think of an answer for, but thought I might as well give a shot here. I have a web service, created by the VS web service creator. I have another class, clsWebservice, which provides easy asynchronous access to each method in the web service. However, the problem is sometimes a web service call might be dropped, and I want to watch for that, with a timeout to tell the user that there’s a...
10
6875
by: greenb | last post by:
Our asp.net web app uses a .NET component (DLL) in the bin directory to call several stored procedures back to back to perform updates. They don't return any data. Sometimes the total execution time can take 2-3 minutes, but even though I have set the executionTimeout in web.config to a high number of seconds (2400), the request will still time out after 90 seconds. The user sees a Request timed out error. The app logs a ThreadAborted...
2
430
by: Chakravarti Mukesh | last post by:
Hi all, I have put some queries on the page that takes too much time to execute. Thus at the time of peak load it gives the following error. Server Error in '/ge' Application. -------------------------------------------------------------------------------- Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. Description: An unhandled exception occurred during the execution of...
12
17832
by: Jens Jensen | last post by:
I try to set the timeout property on my HttpWebRequest object before lunching the request. It seems like any value above 100 seconds is discarded. Has anyone observered malfunctional with this class? Thanks
0
5148
by: Morgan Cheng | last post by:
In the doc http://msdn2.microsoft.com/en-us/library/system.net.httpwebrequest.timeout.aspx, it reads, "A Domain Name System (DNS) query may take up to 15 seconds to return or time out. If your request contains a host name that requires resolution and you set Timeout to a value less than 15 seconds, it may take 15 seconds or more before a WebException is thrown to indicate a timeout on your request." The words doesn't appear in .Net 1.1...
4
20466
by: =?Utf-8?B?R2Vvcmdl?= | last post by:
Hello everyone, I am wondering if I am using TCPClient class in C#, how to setup timeout value? Timeout I mean, when connects to server for the 1st time, and during <timeoutinterval, if no server response is received, the GetStream method will return will return other than wait forever. thanks in advance,
4
9170
by: Burton Roberts | last post by:
I'm new to this. I'm developing a simple WCF service with a Winforms application on my laptop (2008). It seems to run okay accepting inserts, updates and deletes and sending datasets back through the service. Then the system will hang up. Here is the beginning of the error message: System.TimeoutException was unhandled Message="The request channel timed out while waiting for a reply after 00:00:59.9990000. Increase the timeout value passed...
7
7855
by: Microsoft Newsserver | last post by:
Hi Folks. I have an issue I need some help with if thats OK. I am running Framework 2.0 using Windows Integrated Security. For most of the application we manage session timeouts without the user knowing anything about it by ensuring all the essential objects ( only a few ) are in place during session start. For performance, there are some parts of the application which use static
0
9673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10169
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9050
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7546
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5440
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5569
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4115
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.