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

Leif K-Brooks eurleif at ecritters.biz
Tue Jul 19 19:04:22 EDT 2005


Admin wrote:
> 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.

Here's a pretty basic example I wrote a while ago using Twisted:
<http://tw.ecritters.biz/files/twistedchat.py>. The server keeps the
connection open and sends messages when they occur, with the side effect
of keeping the browser's page-loading indicator alive indefinitely.



More information about the Python-list mailing list