Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7061583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:29:31+00:00 2026-05-28T04:29:31+00:00

I have browser client Javascript which opens a WebSocket (using socket.io) to request a

  • 0

I have browser client Javascript which opens a WebSocket (using socket.io) to request a long-running process start, and then gets a callback when the process is done. When I get the callback, I update the web page to let the user know the process has completed.

This works ok, except on my iPad when I switch to another app and then come back (it never gets the callback, because I guess the app is not online at the time). I’m assuming the same thing will happen on a laptop or other computer that sleeps while waiting for the callback.

Is there a standard way (or any way) to deal with this scenario? Thanks.

For reference, if you want to see the problem page, it is at http://amigen.perfectapi.com/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T04:29:32+00:00Added an answer on May 28, 2026 at 4:29 am

    There are a couple of things to consider in this scenario:

    Detect the app going off/on line

    See: online and offline events

    When your app detects the online event after the computer wakes up you can get any information that you’ve missed.

    For older web browsers you’ll need to do this in a cleverer way. At Pusher we’ve added a ping – pong check between the client and server. If the client doesn’t receive a ping within a certain amount of time it knows there’s a connection problem. If the server sends a ping and doesn’t get a pong back with a certain time it knows there’s a problem.

    A ping pong mechanism is defined in the spec but a way of sending a ping or pong hasn’t been defined on the WebSocket API as yet.

    Fetching missed information

    Most realtime servers only deliver messages to connected to clients. If a client isn’t connected, maybe due to temporary network disturbance or their computer has been asleep for a while, then those clients will miss the message.

    Some frameworks do provide access to messages through a history/cache. For those that don’t you’ll need to detect the problem (as above) and then fetch any missed messages. A good way to do this is by providing a timestamp or sequence ID with each messages so you can make a call to your web server to say "give me all messages since X".

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to have XML-embedded JavaScript executed to assist in client-side (browser-based) XSL
I have a page which spawns a popup browser window. I have a JavaScript
I would like to have images, css, and javascript cached client-side on their browser
I have a page which does some intense and long lasting calculations in Javascript.
We have a simple file browser on our intranet, built using ASP/vbscript. The files
I have a strange issue from a client in that our code, which they
I'm currently writing a client-side javascript app which performs image manipulation. Some of the
Which processing is fast Client-side or Server-side? for client side processing browser need to
I have an api which uses OAuth 1.0a to authenticate applications using it. It's
I have a component which writes/generates javascript from a server side renderer. This component

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.