Socket
import { Socket } from "https://raw.githubusercontent.com/takker99/scrapbox-userscript-std/0.14.10/mod.ts";
§Type Parameters
§Constructors
§Properties
Called upon forced client/server side disconnections, this method ensures the manager stops tracking us and that reconnections don't get triggered for this.
Whether the Socket will try to reconnect when its Manager connects or reconnects
Sets a modifier for a subsequent event emission that the event message will be dropped when this socket is not ready to send messages.
§Methods
Sets the compress flag.
- if
true
, compresses the sending data
self
Override emit
.
If the event is in events
, it's emitted normally.
self
Returns an array of listeners that are listening for any event that is specified. This array can be manipulated, e.g. to remove listeners.
Removes the listener that will be fired when any event is emitted.
Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the callback.