ASP.Net connection maintains long running server side

I have an ASP.Net C # web application running on IIS that I maintain, which involves generating text documents. Some of these text documents take a very long time (i.e. over 20-30 minutes) to generate. What I notice when testing on my dev server is that the server closes the connection long before the process finishes, the server side ASP.Net code itself enters a loop and updates the boolean state when the doc word is generated.

My workaround for this is to keep communication online by implementing a dynamically animated wait screen (using jquery and ajax) on the client side, which is updated with a repeated asynchronous AJAX call to the server that checks the status of the operation from a web method on the server side. I ask this in another question .

Is the solution I am considering when implementing the best approach to this problem? Are there any better or more common methods to stay connected during extended server-side work? Any help or insight is appreciated, thanks.


I tried Brian's suggestion, unfortunately I still get the same error from Chrome that no data is being sent from the server and the whole error is as follows:

No data. The web page could not be loaded because the server did not send data.

Here are some tips: reload this page later.

Error 324 (net :: ERR_EMPTY_RESPONSE): The server closed the connection without sending any data.

I'll try again by setting the connection timeout in the website's advanced settings as described and increasing the connection idle setting.


source to share

2 answers

Ideally, you should use a socket to notify the client when the process has finished. Have a look at or native websockets implementations on how to do this.



You can control latency in IIS 7. This is done by switching to IIS management; select application pools; then right click on the pool you are using for your website. Click "Presets" here, you can control the downtime and some other settings for your site. Hope this is what you are looking for.



All Articles