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 8691699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:10:22+00:00 2026-06-13T00:10:22+00:00

I have mobile clients connected to a node.js server, running socket.io via xhr-polling. I

  • 0

I have mobile clients connected to a node.js server, running socket.io via xhr-polling. I have two type of clients:

  • Type A

    When the connection breaks up due to network problems (or that the
    client crashes) the default heart beat timeout is too long

  • Type B

    When the connection breaks up for this client I need to give it more
    time to recover – it is more important that the client recovers than
    the server breaks the connection/session

So my question is how to I configure (if it is possible) the heartbeat timeouts from the actual client?

  • 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-06-13T00:10:23+00:00Added an answer on June 13, 2026 at 12:10 am

    As far as I can tell, there are 2 values that matter here: the server sends heartbeats to the client every heartbeat interval seconds; the client responds directly, if there is no response, the server decides the client is dead. The client waits for a heartbeat from the server for heartbeat timeout seconds since the last heartbeat (which should obviously be higher than the heartbeat interval). If it hasn’t received word from the server in heartbeat timeout seconds, it assumes the server is dead (and will start disconnecting / reconnecting based on the other options you have set.

    Default values are heartbeat interval = 25s and heartbeat timeout = 60s. Both items are set on the server, the heartbeat timeout is sent to the client upon connecting.

    Changing the heartbeat timeout for a single client is easy:

    var socket = io.connect(url);
    socket.heartbeatTimeout = 20000; // reconnect if not received heartbeat for 20 seconds
    

    However on the server, the heartbeat interval value seems to be part of a shared object (the Manager, which is what you get back from your var io = require("socket.io").listen(server) call), which means that it can’t easily be changed for individual sockets.

    I’m sure that with some socket.io hacking you should be able to make it happen, but you might break other stuff in the process…

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

Sidebar

Related Questions

I have a REST server and a client application running on a mobile device.
I have created a simple chat server that is driven by client polling. Clients
I have a mobile site running with jQuery Mobile. I want to have standard
I have a tornado server that provide an https connection with a self signed
I'm looking to connect my WinJS app to mobile browser clients via a cloud
I have to connect to server(servlet on tomcat) always running and process the http
I have a working Ejabberd server (version 2.1.9) and my client application running just
I want to connect two clients (via TCP/IP sockets). The clients can discover each
I have a middleware in my Django application that redirects mobile clients to a
I have mobile online game and my server need user_id for the player. But

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.