When a client send a request to IIS, there is a connection between the client and the server. If client requests the a.aspx, the code in a.aspx as below.
protected void Page_Load(object sender, EventArgs e)
{
for (int i = 0; i < 10; i++)
{
Thread.Sleep(1000);
Response.Write(i+"<br>");
Response.Flush();
}
}
So it means that the connection keeps alive for 10s. is it right?【question 1】
10 seconds later, the connection will be closed?【question 2】
if I edit the code with 'while(true)', as below:
while(true)
{
Thread.Sleep(1000);
Response.Write(i+"<br>");
Response.Flush();
}
The connection is always alive?? or when will it be timeout?【question 3】
These are my questions.