Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/socket_io/mod.ts>Server#socketsLeave

Socket.IO server for Deno
Latest
method Server.prototype.socketsLeave
import { Server } from "https://deno.land/x/socket_io@0.2.0/mod.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

// make all socket instances leave the "room1" room io.socketsLeave("room1");

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

Parameters

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