0

My browser is defaulting to "polling" method, causing me not to get the disconnect event on the server side.

I've tried the solution covered in socket.io force a disconnect over XHR-polling but this didn't do the trick for me:

Server.socket = io.connect("https://somedomain:8443", {"sync disconnect on unload":true, secure:true});

How can I track users leaving my server with polling?

Community
  • 1
  • 1
trueicecold
  • 820
  • 10
  • 23

1 Answers1

0

so, apparently for some reason the heartbeat timeout was too long for me to think the disconnect mechanism was working.

I changed the timings:

var io = require('socket.io')(server, {'pingInterval': 4000, 'pingTimeout': 8000});

In the server, and after 8 seconds, sure thing, I get the disconnect event. The low numbers are because I'm creating a multiplayer game...

trueicecold
  • 820
  • 10
  • 23