socket:Send
Sends a message through the socket.
Syntax
socket:Send(message: string) -> nil
Parameters
| Parameter | Type | Description |
|---|---|---|
message | string | The message text. |
Returns
| Type | Description |
|---|---|
nil | This function does not return a value. |
Description
socket:Send is part of the WebSocket library. WebSocket helpers manage a client connection: opening, sending, polling and closing, with message callbacks.
The operation is performed immediately using the arguments supplied at the call site.
The aliases socket:send(message) resolve to the same implementation.
Example
local ws = WebSocket.open("wss://echo.websocket.events")
ws:Send("hello")
Notes
- Aliases:
socket:send(message). - Keep message callbacks short; they run on the module's networking thread.