It's not documented, but you can use socket.disconnect();
to send a disconnect message to the client (graceful disconnection) or you can call socket.disconnect(true);
to provide a forceful/abrupt disconnection.
How to create one ws-connection from one ip-address?
質問
I want to create only one connection from one ip-address? If there is a connection in the first window, but the user creates a new connection in a second window, then make the change and return to the old connection. Is it possible?
var sessions = {};
io.sockets.on('connection', function (socket) {
var address = socket.handshake.address.address;
if (sessions[address]) {
// what can I do here?
}
}
解決
所属していません StackOverflow