javascript - Socket.io specifying heartbeat -


i can't seem find out how set heartbeat options socket.io? i'd love able specify happens when "timemout" happens, , when server hasn't gotten response client time.

for reason disconnect event isn't firing, though has passed on hour without client not being connected. happens standalone java socket.io client

socket.io uses engine.io, allows specify ping interval , ping timeout, so:

var app = require('express')(); var http = require('http').server(app);  var io = require('socket.io')(http, {'pinginterval': 2000, 'pingtimeout': 5000}); 

(2 second interval , 5 second timeout example. way frequent , inefficient)


Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -