473,399 Members | 3,603 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

How to block and release a Response?

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.
Nov 18 '05 #1
2 960
this approach will never work.

look at it from the browser point of view.

->> request (1) page 2 (sleep)

->> cancel request (1)
->> request (2) page 2 (wakeup)
<-- response request (2)

<-- server thows away request (1) response
also as the browser only supports two active connections to the same server,
its easy to lockup with this design.


-- bruce (sqlwork.com)


"Bruce W.1" <no@direct.email> wrote in message
news:40***************@direct.email...
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.

Nov 18 '05 #2
bruce barker wrote:

this approach will never work.

look at it from the browser point of view.

->> request (1) page 2 (sleep)

->> cancel request (1)
->> request (2) page 2 (wakeup)
<-- response request (2)

<-- server thows away request (1) response

also as the browser only supports two active connections to the same server,
its easy to lockup with this design.

-- bruce (sqlwork.com)

================================================== =====

Sorry, I should have mentioned, Page1 and Page2 are running off of two
separate DLL's, two projects.
Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: pcchong | last post by:
I use a free database-driven ASP guestbook. I want to add a IP address blocking filter to it( just to block one particular guest). What is the easiest way to do so? Thanks. pcchong
6
by: Páll Ólafsson | last post by:
Hi I have a problem with the Microsoft.ApplicationBlocks.ExceptionManagement? I can't get it to work in RELEASE mode? If I run the project in debug mode the block works fine but when I run the...
5
by: John Perks and Sarah Mount | last post by:
When handling resources in Python, where the scope of the resource is known, there seem to be two schools of thought: (1) Explicit: f = open(fname) try: # ... finally: f.close()
1
by: AMDRIT | last post by:
Hello Everyone, I have an application that uses the application updater block V2. The application is launched using an appStart assembly first. Everything has been working great for a few...
0
by: zhimin | last post by:
Hi, I'm writing a program to send large file(100m) through dotnet using TCPListener & TCPClient, I'm sending the file with a ask and response loop: 1. Client send a flag 1 to server indicate it...
3
by: Travis | last post by:
I am trying to prevent an exception from bubbling up from one nested Try/Catch Block to its "Parent" Try/Catch Block. Here is some example code: try{ try{ //Non-application killing code that...
4
by: ksukhonosenko | last post by:
This message was originally posted to comp.lang.c++.moderated ---------------------------------------------------------------------------------------------- Hi! I face a problem in my...
8
by: =?Utf-8?B?UmljaA==?= | last post by:
Is it possible to find the end of an If block in VB2005 -- similar to C# where in C# if you place your cursor next to a bracket and press ctrl something it highlights the ending bracket? I have...
16
by: HillBilly | last post by:
This is freaking me out. I'm using Membership and trying to determine if the database is online. The GetConnectionString( ) method returns a connection string as expected but not when used in the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.