socket.io - Socket IO v1.4.5 disconnect issue -


i'm working on socket room , try disconnect client side when refresh page, problem in console receive message socket id disconnected, , socket id generated old socket still active

here code in client side :

    var roomsocket = io.connect("http://mysitehere.com:5001", {'forcenew': true}); var room = port; roomsocket.on('connect', function () {     roomsocket.emit('starting', room);     console.log('emit connection room'); }); roomsocket.on('connected', function () {     console.log('connected user'); }); roomsocket.on('message', function (data) {     console.log('incoming message:' + data); }); $(document).unload(function () {     roomsocket.disconnect(); }); 

my code in server js

socket.on('disconnect', function (data) { console.log('------------------------------------'); console.log("disconnection : " + socket.id); console.log('------------------------------------'); 

});

and result : enter image description here

enter image description here enter image description here


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -