import { Channel } from "https://deno.land/x/snel@v0.7.1/imports/wocket.ts";
Channel represents channels, also known as "rooms". This class describes open channels, and is used to place clients into
Properties
callbacks: Array<((packet: Packet) => void)>
The callbacks for listening
function handleChannel1 (...) { ... }
socketServer.on("channel 1", handleChannel1)
handleChannel1
is now registered as a callback.
listeners: Map<number, WebSocket>
Acts as the list of clients connected to the channel. A listener would contain the clients socket id and and the socket connection sent across
new Channel("channel 1").listeners.set(
2, // clients socket id
incomingSocketConnection
})