You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Steps to reproduce (if the current behaviour is a bug)
Note: the best way to get a quick answer is to provide a failing test case, by forking the following fiddle for example.
Expected behaviour
I'm looking for a way to disconnect a client with some reason (on the server), for example:
connection session time exceeded
user-token has become invalid
or something else
in the end I would like to have something like this:
//server
io.on('connection', (socket) => {
setTimeout(() => {
socket.disconnect(true, 'My super reason why the connection has been disconnected')
}, 5000);
});
//client
socket.on('disconnect', (reason) => {
// reason === 'My super reason why the connection has been disconnected'
});
please let me know if you are going to add the feature in future, or maybe there are any problems to implement it.
Setup
OS: any
browser: any
socket.io version: latest
Other information (e.g. stacktraces, related issues, suggestions how to fix)
The text was updated successfully, but these errors were encountered:
Note: for support questions, please use one of these channels: stackoverflow or slack
You want to:
Current behaviour
Server can disconnect a client only without reason
Steps to reproduce (if the current behaviour is a bug)
Note: the best way to get a quick answer is to provide a failing test case, by forking the following fiddle for example.
Expected behaviour
I'm looking for a way to disconnect a client with some reason (on the server), for example:
in the end I would like to have something like this:
please let me know if you are going to add the feature in future, or maybe there are any problems to implement it.
Setup
Other information (e.g. stacktraces, related issues, suggestions how to fix)
The text was updated successfully, but these errors were encountered: