Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PageMethod default timeout

Tags:

asp.net

is there a default timeout set when i call a PageMethod from a javascript without specifying explicitly the timeout, if yes what is it?

Thanks

like image 493
user127390 Avatar asked Jun 29 '09 16:06

user127390


1 Answers

The standard XmlHttpRequest object has no built-in timeout mechanism. Ajax requests will go on indefinitely since there is no standard way to timeout. There are ways in which you can get around this however, which I would assume is what ASP.NET does in their framework.

IE8 is the only browser with a built-in timeout property, so I'm guessing that their Ajax framework would be consistent with that. In this case, the timeout would be indefinite by default.

ASP.NET also has an AsyncTimeout property for asynchronous page tasks, so it is possible that the framework would time out (server-side) in 45 seconds, which is the default for asynchronous tasks in ASP.NET pages.

There appears to be no default timeout from what I could find. If I were you though, I wouldn't rely on the default timeout length. You should specify your own length if you're concerned about timeouts. Timeouts can be indefinitely long by default. Users won't wait indefinitely long, so you're better off defining the timeout as the maximum wait a user should have to cope with (depending on the context).

UPDATE
I created a test page with a Page Method that will take 65 minutes to load (using Thread.Sleep()). The Page Method call waited the full 65 minutes, so it appears that my assumption was correct. Page Methods have no time out by default, or if they do, the timeout is over 1 hour. Don't forget that local development machines have effectively an infinite server timeout so ASP.NET will let a script run indefinitely. By default, the ASP.NET execution timeout for production configurations is between 90 and 110 secionts seconds depending on the .NET version you're running.

like image 57
Dan Herbert Avatar answered Oct 17 '22 17:10

Dan Herbert