why socket.disconnect() on client side doesn't fire disconnect event on the server?
See original GitHub issuehere’s my code:
client-side
var socket = io.connect('http://' + serverAddress ,{ reconnection: false, forceNew: true } );
socket.emit('monitorAddedNotify' , { video: sourceVideo , socketId: socket.id});
socket.on('disconnectThatSoc', function(){
socket.disconnect();
});
server-side:
io.on('connection', function (socket) {
console.log('a user connected');
socket.on('disconnect', function () {
console.log('user disconnected');
});
});
the socket.disconnect() method doesn’t work why?
Issue Analytics
- State:
- Created 8 years ago
- Comments:24 (3 by maintainers)
Top Results From Across the Web
node.js - why socket.disconnect() on client side doesn't fire ...
Your use of this inside a far arrow function inside a static method is really, really confusing. The this value will likely be...
Read more >The Socket instance (client-side)
This event is fired upon disconnection. ... In the first two cases (explicit disconnection), the client will not try to reconnect and you...
Read more >[Solved]-why socket.disconnect() on client side doesn't fire ...
Coding example for the question why socket.disconnect() on client side doesn't fire disconnect event on the server?-node.js.
Read more >Can you explain why socket.io disconnect doesn't work?
According to the socket.io docs the disconnect function automatically leaves all rooms. I even checked on the server side, if the disconnect ...
Read more >Socket.IO, React and Node.js: Going Real-Time
We can listen for a connection event, fire up a function when a new user ... IO client will not be able to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
are you dumb? you are waiting for an emit on client but no emit on server. fuck out of here
That’s some real negative energy, Ehsan666x.