Let's have a look at the difference between Connection timeout and ASP Script Timeout today!
1. Connection Timeout in Default Web Site
As you can see below, the Default Web Site properties on my Win 2k3 machine has Connection Timeout set to 120 seconds. This typically means that after 120 seconds your IIS server is going to disconnect an inactive user. This setting ensures that all connections are closed if the HTTP protocol fails to close a connection. Typically, most web browsers keep the connection open for multiple requests and it is known as HTTP Keep-alive. This specification allows for greatly enhanced server performance. If this setting was not there, your browser would have required to make lots of connection requests (even for pages which would have contained multiple graphics).

So, the question now is, what really happens when you have set the connection timeout to XXX seconds at the TCP level? And how do you check out what happens when you have set this connection for a low value (or high). For this exercise you will need Network Monitor 3.0 or Ethereal. I will use NetMon 3.0. Also, for brevity, I am going to change my Connection Timeout to 10 seconds.
a. Start Netmon 3.0 and click on Create New Capture button.
b. Switch to the Aliases and set the client and server addresses

c. Switch to the Display Filter and paste the following and click on Apply...
(HTTP OR TCP.Flags.Reset == 1) AND (IPv4.Address == xx.52.22.54 AND IPv4.Address == xx.52.22.254)
d. Now, open IE and browse to your server... You will notice something like the following in Frame Summary pane of Netmon. Don't browse the page again and after a few seconds you will notice something like 3rd Frame Number = 568. This will tell you what actually happened. Notice that the Client made a GET request for GetRequest.asp in frame 77. The server responded with Status Code 200 (HTML delivered). Now, since we are not making any further request you will see that the Server has sent a TCP connection reset flag (check the ..R.A... in Description) for the idle connection. I wanted to share this information so that you know that all Resets from the server are not bad and in fact a good thing since you don't need idle connections to be open for a long time. Also, you should know that IE creates ONLY 2 simultaneous connections for a browser. In plain English, it means that if you have a page which accesses multiple resources (let's say an html page with 5 different JPGs), it can't download more than 2 JPGs at a time. One more thing, if you have such an HTML file, you will see two TCP Resets in the Frame Summary instead of 1.
Okay, lets move over to ASP Script Timeout and see if they are related.
2. ASP Script timeout
Check out the figure below for ASP Script Timeout = 90 seconds. It specifies the length of time ASP allows a script to run. You can set the timeout period to a value between 1 and 2147483647. If the script does not finish running by the end of the timeout period, ASP stops the script and writes an event to the Windows event log. You can override this option in an ASP page by using the Server.ScriptTimeout method.
The badcode.asp which I am using looks like the following...
<%
Server.ScriptTimeout = 20
Response.write(now())
str= "<BR>abc"
for i= 1 to 20000000
str = str & i
next
response.write(str)
%>
Notice that I have set the ScriptTimeout = 20 seconds. But the connection timeout is still set to 10 seconds as in the previous example. My code takes quite a long time, and the simple question which I have at this moment is... will the connection be reset in 10 seconds? The answer as you might have guessed is NO. It won't reset the connection until it is idle. IIS is smart enough to ensure that it doesn't close the connection if the file is being processed. On the other hand, since Server.ScriptTimeout is set to 20 seconds here, and the loop is pretty nasty, IIS will stop executing the ASP request after 20 seconds and save you from a potential High CPU hang issue.
So, what happens to the result of executing such a long request?
Answer> You will get an error like this...
Active Server Pages error 'ASP 0113'
Script timed out
/badcode.asp
The maximum amount of time for a script to execute was exceeded. You can change this limit by specifying a new value for the property Server.ScriptTimeout or by changing the value in the IIS administration tools.
Now, lets see the Frame Summary...
The explanation to this Status Code = 500 is pretty simple. It is thrown due to the lower value of Server.ScriptTimeout. And as you can see, after we are done with throwing that error, IIS waits for a few seconds (connection Timeout) and just sends a TCP Reset Flag to reset the connection once it times out!
Until next time 
Rahul