WebSocket

WebSocket.Send

Sends text or binary data through an open WebSocket connection.

Syntax

WebSocket.Send(socket: WebSocket, message: string, isBinary?: boolean)

Arguments

NameTypeDescription
socketWebSocketOpen WebSocket handle returned by WebSocket.connect.
messagestringText or binary payload to send through the socket.
isBinary?booleanWhen true, sends the payload as binary data; otherwise sends a text message.

Description

Sends text or binary data through an open WebSocket connection.

Call it with 3 parameter(s): socket, message, isBinary. The argument table explains which values are required and which ones only refine the behavior.

It does not return data. Treat the call as an action and handle errors around the call site when needed.

Example

Example call with placeholder values.

WebSocket.Send(nil, "example", true)