473,325 Members | 2,860 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,325 software developers and data experts.

reconnect after lost connection (googletalk style?)

Hi,
I'm working a web application using comet (Orbited) for real-time
status updates and messaging. The messaging system works great, but
I've noticed that if I disconnect my laptop internet connection, and
then reconnect it the messaging does not reload with the connection.

It seems that gmail/googletalk implement a feature whereby the chat
section attempts to reconnect every 60s or so even when the internet
connection is down. When the connection comes back up it then
automatically reconnects.

Is there an simple, concise way of implementing this sort of
reconnection in client-side javascript? Is gmail/googletalk even
accomplishing this via javascript? Do I perhaps only need to set a
simple timed refresh?

I spent a bit of time searching this list and google/yahoo for
things like "javascript refresh lost connection" but wasn't able to
come up with much.

Cheers
Jun 27 '08 #1
3 2694
On Jun 19, 6:43 am, joes.mailing.li...@gmail.com wrote:
Hi,
I'm working a web application using comet (Orbited) for real-time
status updates and messaging. The messaging system works great, but
I've noticed that if I disconnect my laptop internet connection, and
then reconnect it the messaging does not reload with the connection.

It seems that gmail/googletalk implement a feature whereby the chat
section attempts to reconnect every 60s or so even when the internet
connection is down. When the connection comes back up it then
automatically reconnects.

Is there an simple, concise way of implementing this sort of
reconnection in client-side javascript? Is gmail/googletalk even
accomplishing this via javascript? Do I perhaps only need to set a
simple timed refresh?

I spent a bit of time searching this list and google/yahoo for
things like "javascript refresh lost connection" but wasn't able to
come up with much.

Cheers
You might want to search for something like "check network connection"
or "ping"...
You can use Ajax calls to check the connection status periodically.
Jun 27 '08 #2
On Jun 18, 10:43*pm, joes.mailing.li...@gmail.com wrote:
* It seems that gmail/googletalk implement a feature whereby the chat
section attempts to reconnect every 60s or so even when the internet
connection is down. *When the connection comes back up it then
automatically reconnects.

* Is there an simple, concise way of implementing this sort of
reconnection in client-side javascript? *Is gmail/googletalk even
accomplishing this via javascript? *Do I perhaps only need to set a
simple timed refresh?
You don't refresh the entire page, you just use "setTimeout" to call a
JavaScript function that initiates an Ajax call to do something useful.
Jun 27 '08 #3
On Jun 19, 12:54*pm, "david.karr" <davidmichaelk...@gmail.comwrote:

You don't refresh the entire page, you just use "setTimeout" to call a
JavaScript function that initiates an Ajax call to do something useful.
Definitely use setTimeout but rather than the standard httpRequest
object, the OP should use the Orbited library call Orbited.connect().
I'm interested in comet so I looked up the docs on this daemon. Seems
okay but 1) there hasn't been a release in over a year (not a good
sign) and 2) the project is server-side centric to the point that
there is absolutely no javascript documentation on the site. If you
look on the little google group there are a few posts about
javascript.

I think the idea of a web server plugin to implement comet is a great
idea, I just hope the OP is a python expert because it looks like he
is now in charge.

Bob
Jun 27 '08 #4

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

Similar topics

2
by: Damjan | last post by:
Does MySQLdb automatically reconnect if the connection to the database is broken? I'm asking this since I have a longrunning Python precess that is connected to Mysql-4.1.11, and I execute "set...
2
by: Abram | last post by:
I have an ODBC 3.0 Application on Windows NT Server maintaining a connection to a SQL Server 2000 database on the same machine. When an error occurs, I'd like to be able to determine whether the...
10
by: lauren quantrell | last post by:
I'm using Access 2K's built-in connection method (FILE>CONNECTION) with the Windows NT Integrated Security login option to establish my server connection. Is there a way in code to refresh or...
3
by: William | last post by:
Hi I have an ASP.NET application that connects to an Access database. Everything works fine except for the Session object. Data in the session object is lost after I've made a call to the...
1
by: John | last post by:
When I ping my server over the internet connection and the server isn't responding due to the connection not working properly is it possible in .Net to reconnect the connection if the ping is...
0
by: mkahn | last post by:
Fater leaving my computer for a few minutes. I tried to continue working with the page am on. Seems to be that after my connection timed out, am not able to reconnect to the data base getting the...
2
by: Robert Dufour | last post by:
My functions or subs that connect to my databases are always using the following code pattern (Vs2003) Private Mysub () Dim MyConn as new Odbc.connection MyConn.ConnectionString = g_ODBCConnStr...
0
by: Robert Avery | last post by:
In VBA/VB6, I had a class (incomplete sample below) that watched and displayed for the user all connection events, so that I could easily see what SQL was taking a long time, and when it freezes, I...
0
by: Dreea | last post by:
Hello everybody I am working on a client application that connects to a C# server using the Socket class. I am trying to handle the case in which the server goes offline, and I would like the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.