reconnect after lost connection (googletalk style?)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • joes.mailing.lists@gmail.com

    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
  • GArlington

    #2
    Re: reconnect after lost connection (googletalk style?)

    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.

    Comment

    • david.karr

      #3
      Re: reconnect after lost connection (googletalk style?)

      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.

      Comment

      • beegee

        #4
        Re: reconnect after lost connection (googletalk style?)

        On Jun 19, 12:54 pm, "david.karr " <davidmichaelk. ..@gmail.comwro te:

        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

        Comment

        Working...