How to disconnect all sockets serve side using socket.io? -
how can disconnect/close sockets on server side ?
maybe restarting socket.io module server side ?
(using lateste socket.io)
assuming io
socket.io server object, can server-side disconnect connected clients:
io.sockets.sockets.foreach(function(s) { s.disconnect(true); });
depending upon client configuration, clients may try reconnect.
fyi, there lot of different answers similar problems in question: socket.io - how list of connected sockets/clients?, have pay attention answers apply socket.io versions greater 1.0 since changed v1.0.
Comments
Post a Comment