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

Makes the matching socket instances join 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 join the "room1" room myNamespace.socketsJoin("room1");

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

Parameters

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