How to send a query to the browser from time to time?

A

Admin

I am creating a chat application like Messenger for the web (using the
browser) and I'm wondering if there is a way to
receive new messages from time to time from the server other than
refreshing the page each 5 sec.

If there were a way to have the server-side application send new messages
to the browser this would be awesome because it
would save dramatically on bandwidth. The application would consume
bandwidth only when there are new messages. There
would be no communication client-server until people write a new message.

Do you know if it's possible?
 
A

A. Sinan Unur

Admin said:
I am creating a chat application like Messenger for the web (using the
browser) and I'm wondering if there is a way to
receive new messages from time to time from the server other than
refreshing the page each 5 sec.

Please note that this is not a Perl question.
If there were a way to have the server-side application send new
messages to the browser this would be awesome because it
would save dramatically on bandwidth. The application would consume
bandwidth only when there are new messages. There
would be no communication client-server until people write a new
message.

If you want, you can search for "server push" using Google.

I do not see what bandwidth has anything to do with any of this.

Anyway, none of this is topical here.

Sinan
 
I

ioneabu

Admin said:
I am creating a chat application like Messenger for the web (using the
browser) and I'm wondering if there is a way to
receive new messages from time to time from the server other than
refreshing the page each 5 sec.

If there were a way to have the server-side application send new messages
to the browser this would be awesome because it
would save dramatically on bandwidth. The application would consume
bandwidth only when there are new messages. There
would be no communication client-server until people write a new message.

Do you know if it's possible?

Probably not practical. Try Lincoln Stein's book, 'Network Programming
with Perl' to see what is possible with Perl regarding what you want to
do.

-wana
 
J

Joe Smith

Subject: How to send a query to the browser from time to time?
Answer: You don't. Queries come from the browser, not to it.
I am creating a chat application like Messenger for the web (using the
browser) and I'm wondering if there is a way to
receive new messages from time to time from the server other than
refreshing the page each 5 sec.

The HTTP protocol is not interactive.
The usual way of getting updates like that is to have an HTML
page with an embedded Java applet running. There are many
IRC clients written in Java that run inside a browser window.
This is not a perl-specific question.
-Joe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top