B
Bruce W.1
I have a web page (called Page1) with an iFrame and a button on it. The
URL for the iFrame is another page, lets call it Page2. On Page1 I tack
a querystring onto the Page2 URL. The querystring tells Page2 to either
respond immediately or go into a Thread.Sleep state, which blocks the
Response.
I want another Page1 browser window to wake up the other one that's
sleeping. I do this with a querystring to Page2 which tells it to set
an Application["WakeUp"] = "true";
The thread that's sleeping actually loops once per second checking if
Application["WakeUp"] = "true". If false then it sleeps for another
second, and so on. If true then return the Response.
This isn't working the way I intended. The sleep loop seems to take
control until it times out, I check the iterations and terminate it
after 30 seconds. I don't seem to be able to set Application["WakeUp"]
= "true" (with the other browser) while the sleep loop is going. So the
loop never stops until time-out.
Is this making any sense? I know this sort of thing is not normally
done.
How can I put up an application-wide flag that tells all sleeping
responses to wake-up and complete the Response? The Application State
is the only way I can find to share anything between different browser
sessions. Rather than doing a sleep loop I'd much rather have an event
go to all sleeping responses.
Thanks for your help.
URL for the iFrame is another page, lets call it Page2. On Page1 I tack
a querystring onto the Page2 URL. The querystring tells Page2 to either
respond immediately or go into a Thread.Sleep state, which blocks the
Response.
I want another Page1 browser window to wake up the other one that's
sleeping. I do this with a querystring to Page2 which tells it to set
an Application["WakeUp"] = "true";
The thread that's sleeping actually loops once per second checking if
Application["WakeUp"] = "true". If false then it sleeps for another
second, and so on. If true then return the Response.
This isn't working the way I intended. The sleep loop seems to take
control until it times out, I check the iterations and terminate it
after 30 seconds. I don't seem to be able to set Application["WakeUp"]
= "true" (with the other browser) while the sleep loop is going. So the
loop never stops until time-out.
Is this making any sense? I know this sort of thing is not normally
done.
How can I put up an application-wide flag that tells all sleeping
responses to wake-up and complete the Response? The Application State
is the only way I can find to share anything between different browser
sessions. Rather than doing a sleep loop I'd much rather have an event
go to all sleeping responses.
Thanks for your help.