TTMSFNCCustomWebSocketServer Class
Base class for the WebSocket server component. Listens on a configurable port, performs the protocol handshake, tracks active connections, and raises events as messages and control frames are received. Supports secure connections, broadcasting, and targeted sends.
API unit family: TMSFNCWebSocketServer
Inherits from: TTMSFNCCustomComponent
Syntax
TTMSFNCCustomWebSocketServer = class(TTMSFNCCustomComponent)
Properties
| Name | Description |
|---|---|
| BindingIP | The local IP address the server binds to. Leave empty to listen on all available addresses. |
Methods
| Name | Description |
|---|---|
| BroadcastData | Sends binary data to every connection whose handshake has completed. |
| BroadcastMessage | Sends a text message to every connection whose handshake has completed. |
| DisconnectClient | Sends a close frame to the connections accepted by the selector, disconnecting them. |
| SendDataTo | Sends binary data to the connections accepted by the selector. |
| SendMessageTo | Sends a text message to the connections accepted by the selector. |
| TransformCloseData | Extracts the status code and optional reason text from the payload of a received close frame. |