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

Makes the matching socket instances leave the specified rooms.

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 leave the "room1" room myNamespace.socketsLeave("room1");

// make all socket instances in the "room1" room leave the "room2" and "room3" rooms myNamespace.in("room1").socketsLeave(["room2", "room3"]);

Parameters

room: Room | Room[]
  • a room, or an array of rooms