473,811 Members | 2,749 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

forcing an http request to sleep/delay

Hi all,

I'm trying to use asp.net to code a chat window and I would like to make the
http request delay as long as possible till the process/thread detects a new
incoming message.

basically something like the following:

while(nonewmess ages) {
nonewmessages = checkfornewmess ages();
delay(100);
}

I haven't found a delay function nor does thread.sleep works.

I understand that coding a meta tag refresh rate can resolve the problem in
a "pull" like fashion but I would like to "push" the data on the fly through
displaying existing chat messages and then holding the http request
connection until next message arrives. At that point a refresh can be made
and thus saving unnecessary amounts of requests being made to the server.

Thanks for any input into this matter.

Robert Huie
Nov 18 '05 #1
1 3391
Robert Huie wrote:
I understand that coding a meta tag refresh rate can resolve the problem in
a "pull" like fashion but I would like to "push" the data on the fly through
displaying existing chat messages and then holding the http request
connection until next message arrives. At that point a refresh can be made
and thus saving unnecessary amounts of requests being made to the server.


Robert, HTTP is structured as a request/response protocol, with the
client initiating a request, and the server sending a response. The
point being, I think you're not going to be able to do what you want
without using a Java applet or something like that - an actual program
that establishes a peer-to-peer connection between the client and
server. Point being, HTTP is not designed to accomplish what you're after.

Now, there are some "workaround s" that can give the end user the
perception that the screen is only updating when needed. For example,
you could have a hidden frame that checks back periodically, and if
there are new messages, then it refreshes the main window...

Hope this helps.

--

Scott Mitchell
mi******@4guysf romrolla.com
http://www.4GuysFromRolla.com
http://www.ASPFAQs.com
http://www.ASPMessageboard.com

* When you think ASP, think 4GuysFromRolla. com!
Nov 18 '05 #2

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

Similar topics

1
2272
by: pdectm | last post by:
I'm trying to prototype an application which runs multiple python scripts, each in its own interpreter and OS thread. I've not been able to forceable stop a script which does not respond to a request to stop. My thought was to simply call: PyThreadState_Clear(xxx); PyThreadState_Delete(xxx); // Fatal Python error: no last thread Py_EndInterpreter(xxx);
7
947
by: John | last post by:
Thanks. I am writing a C++ code on Linux and Sun OS platform. How to make a procedure sleep or delay? Thanks again. "John Carson" <donaldquixote@datafast.net.au> wrote in message news:<40455261$1@usenet.per.paradox.net.au>... > "John Carson" <donaldquixote@datafast.net.au> wrote in message > news:40455214$1@usenet.per.paradox.net.au
21
18767
by: Alo Sarv | last post by:
Hi From what I have understood from various posts in this newsgroup, writing event loops pretty much comes down to this: while (true) { handleEvents(); sleep(1); // or _sleep() or nanosleep(), depending on platform }
2
1210
by: Ford Prefect alias Armin | last post by:
Hello I have a Problem of understanding how IIS/ASPX Works..... Why can't to request run at the "same" time ?? I have a Simple ASPX Web Application. It has two Button.
1
1119
by: Robert Huie | last post by:
Hi all, I'm trying to use asp.net to code a chat window and I would like to make the http request delay as long as possible till the process/thread detects a new incoming message. basically something like the following: while(nonewmessages) { nonewmessages = checkfornewmessages();
4
21023
by: SheldonMopes | last post by:
Is there a way to force Access to pause execution for a specified period of time ? I would like a command button on a form to run it's code when clicked and then pause for 2 seconds before allowing any other user input. Thank you for any help.
13
5840
by: Charles Zhang | last post by:
Sleep() function Sleep at lease 1 millisecond, there is a way to make a thread to sleep less than a millisecond? One way I know of is using performance counter which is not really sleep ( loop and check again and again and uses CPU time). Thanks Charles Zhang
2
6183
by: virupax | last post by:
Which is the best one to use sleep or delay ( for a delay in the process ) .As i understand use of sleep, allows the kernel to schedule the process. And if a sleep of microseconds is used, and the kernel schedules at this time, will it takes care to reschedule the interrupted process, back in the requested amount of sleep the process had asked for ( as the other process which the kernel witched to may take long time to give back the...
3
4364
by: evenlater | last post by:
I have an Access application on a terminal server. Sometimes my users need to export reports to pdf, rtf or xls files and save them to their own client device hard drives. They can do that right now the way I have this set up, but it's confusing and slow. When they browse for a place to save the reports, they see all of the drives on the terminal server as well as their own client drives. So they're likely to want to choose "My...
0
9727
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10647
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9204
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7669
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6889
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5554
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5692
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4339
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3017
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.