Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Will never returning from an event handler cause a StackOverflowException?

$
0
0

Hello,

My Web app does not return from an EventHandler.  Does this cause a StackOverflowException?

The reason is to maintain a Reverse-Ajax Comet control connection for dynamic updates of a text editor web control from an AsyncPostBack.

Here is my code:

       protected void EnterButton_Click(object sender, EventArgs e)
        {
            bool bHandleEvent = true;

            //never leave event handler
            while (true)
            {
                Run(bHandleEvent);

                Thread.Sleep(500);

                bHandleEvent = false;
            }
        }

The Run method contains the actual EventHandler code.  (Which includes client calls via the Comet control.)

Again, will a StackOverflowException occur after a lengthy session?

Any suggestions on a solution?

williamj


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>