Table of Contents

IWebSocket Interface

Interface for managing WebSocket communication, including sending and receiving messages, and handling connection states.

Syntax

Unit: Sparkle.WebSocket

IWebSocket = interface(IInterface);

Methods

Name Description
Abort Aborts the WebSocket connection immediately without sending a close frame.
Close Initiates the WebSocket close handshake by sending a close frame and waiting for the other side to acknowledge with its own close frame.
GetCloseStatus Gets the status code indicating the reason for the WebSocket connection closure.
GetCloseStatus​Description Gets the description of the WebSocket connection closure status.
GetState Gets the current state of the WebSocket connection.
Receive Receives a full message from the WebSocket connection, automatically handling any fragments.
ReceiveFrame Receives a WebSocket frame from the connection. Allows receiving individual frames with control over fragmentation.
Send Overloaded
Send(string)
Send(TArray<Byte>)
SendClose Sends a close frame in response to a close frame received from the other side, finishing the close handshake without waiting for a response.
SendFrame Sends a WebSocket frame to the connection. Allows sending individual frames with control over fragmentation.

Properties

Name Description
CloseStatus The status code indicating the reason for the WebSocket connection closure.
CloseStatusDescription The description of the WebSocket connection closure status.
State The current state of the WebSocket connection.