PageAAsyncTimeout - Infinite Timeout?

I saw an implementation exampleforever iframe (cometary modeling), so I decided to test it, but with the addition of asynchronous , so that there would be no lock.

Pretty simple:

I have a page ( index.html) with a hidden iframeone that has an SRC AdminPush.aspx:

/*1*/           protected void Page_Load(object sender, EventArgs e)
/*2*/           {
/*3*/               UpdateMessage();
/*4*/           }
/*5*/   
/*6*/   
/*7*/           protected void UpdateMessage()
/*8*/           {
/*9*/               HttpContext.Current.Response.ContentType = "text/html";
/*10*/               Response.Write("<script  >parent.UpdateMessage(DateTime.Now.Second)</script>");
/*11*/               Response.Flush();
/*12*/   
/*13*/               //async part goes here  !!
/*14*/               this.RegisterAsyncTask(new PageAsyncTask(async cancellationToken =>
/*15*/                                       {
/*16*/                                            await Task.Delay(2000, cancellationToken);
/*17*/                                            UpdateMessage();
/*18*/                                       }));
/*19*/           }

On the page, AdminPush.aspxI added:

Async="true"

On the html ( index.html) page, I added:

function UpdateMessage(Message)
        {
          console.log(Message);
        }


    function setupAjax() //body Onload - calls it.
    {
        var iframe = document.createElement("iframe");
        iframe.src = "adminpush.aspx"; 
        iframe.style.display = "none";
        document.body.appendChild(iframe);
    }

So basically iframe introduces script comands, which updates the parent iframe element which is index.html.

He works.

But when I tested it, it stopped updating after 45 seconds.

I thought this was due to requestTimeout prop in web.config - but it is not.

AsyncTimeOut AdminPush.aspx.

№1:

msdn AsyncTimeout:

, , , .

:

TimeSpan, . 45 .

, "" 2

- 1 , . , , sum(all async operations)

? , - ! (), sum(tasks)

. ?

№ 2:

. ? , , . , .

, RESET ( n )?

, /, signalR, , , , .

+3
1

, IIS, , , "" , .

... ...

"" (), , 2... , , IIS . ( , )

, " (, root/main task), , , IIS , , IIS, , , IIS.

, AsyncTimeout , ( ).

- 6000 , :

#:

protected void Page_Load(object sender, EventArgs e)
{
    Page.RegisterAsyncTask(new PageAsyncTask(ProcessTask));
}

protected async Task ProcessTask()
{
    await Task.Delay(1000);
    Response.Write(DateTime.Now.ToLongTimeString() + "<br/>");
    Response.Flush();
    Page.RegisterAsyncTask(new PageAsyncTask(ProcessTask));
}

ASPX:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Sample03.Default" Async="true" AsyncTimeout="6000" %>

, .

+1

All Articles