MCPcopy
hub / github.com/socketio/socket.io / send

Method send

packages/socket.io/lib/index.ts:943–948  ·  view source on GitHub ↗

* Sends a `message` event to all clients. * * This method mimics the WebSocket.send() method. * * @see https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/send * * @example * io.send("hello"); * * // this is equivalent to * io.emit("message", "hello"); * *

(...args: EventParams<EmitEvents, "message">)

Source from the content-addressed store, hash-verified

941 * @return self
942 */
943 public send(...args: EventParams<EmitEvents, "message">): this {
944 // This type-cast is needed because EmitEvents likely doesn't have `message` as a key.
945 // if you specify the EmitEvents, the type of args will be never.
946 this.sockets.emit("message" as any, ...args);
947 return this;
948 }
949
950 /**
951 * Sends a `message` event to all clients. Alias of {@link send}.

Callers 12

socket.tsFile · 0.45
eioPushFunction · 0.45
test-suite.jsFile · 0.45
test-suite.jsFile · 0.45
initSocketIOConnectionFunction · 0.45
test-suite.jsFile · 0.45
index.jsFile · 0.45
index.tsFile · 0.45
index.jsFile · 0.45
#sendMethod · 0.45
#mMethod · 0.45

Calls 1

emitMethod · 0.65

Tested by

no test coverage detected