Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Latest
method Namespace.prototype.disconnectSockets
import { Namespace } from "https://deno.land/x/socket_io@0.2.0/packages/socket.io/lib/namespace.ts";

Makes the matching socket instances disconnect.

Note: this method also works within a cluster of multiple Socket.IO servers, with a compatible Adapter.

Examples

const myNamespace = io.of("/my-namespace");

// make all socket instances disconnect (the connections might be kept alive for other namespaces) myNamespace.disconnectSockets();

// make all socket instances in the "room1" room disconnect and close the underlying connections myNamespace.in("room1").disconnectSockets(true);

Parameters

optional
close = [UNSUPPORTED]
  • whether to close the underlying connection