MessageWebSocketInput
Message events supplied by a native WebSocket runtime.
Message events supplied by a native WebSocket runtime. Control events are supplied only when the runtime exposes them; they must never be synthesized.
Import#
ts
import type { MessageWebSocketInput } from "@shadow-js/dusk/server";
Signature#
ts
interface MessageWebSocketInput {
/** Delivers one decoded text or binary message. */
message(message: string | Uint8Array): void;
/** Records a native ping (the runtime already sends its pong). */
ping(): void;
/** Records a native pong. */
pong(): void;
/** Ends the session with the transport's actual close code and reason. */
closed(code?: number, reason?: string): void;
/** Closes for server shutdown with code 1001. */
shutdown(): void;
}
Members#
| Name | Type | Description |
|---|---|---|
message |
message(message: string | Uint8Array): void |
Delivers one decoded text or binary message. |
ping |
ping(): void |
Records a native ping (the runtime already sends its pong). |
pong |
pong(): void |
Records a native pong. |
closed |
closed(code?: number, reason?: string): void |
Ends the session with the transport's actual close code and reason. |
shutdown |
shutdown(): void |
Closes for server shutdown with code 1001. |