By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,747 Members | 1,482 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,747 IT Pros & Developers. It's quick & easy.

reconnect after lost connection (googletalk style?)

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.