Table of Contents

TTMSFNCCustomWebsocketClient Class

Base WebSocket client component. Connects to a server, performs the upgrade handshake, sends and receives text, binary, ping, pong, and close frames, and surfaces connection lifecycle events. Surface the published properties through the TTMSFNCWebsocketClient descendant for design-time use.

API unit family: TMSFNCWebSocketClient Inherits from: TTMSFNCCustomComponent

Syntax

TTMSFNCCustomWebsocketClient = class(TTMSFNCCustomComponent)

Methods

Name Description
CheckIncoming Checks the connection for incoming data and processes one frame when available, waiting up to the configured check timeout. A received close frame triggers a disconnect.
Connect Opens the connection to the configured host and port and performs the upgrade handshake. On success the connection is registered for message checking and the connect event fires; on handshake failure the connection is closed. Does nothing when already connected.
Disconnect Closes the connection. When is True, a close frame is sent first; otherwise the socket is closed immediately. Does nothing when not connected.
IsConnected Indicates whether the underlying socket is currently connected.
Ping Sends a ping control frame carrying the given text as its payload.
Pong Sends a pong control frame carrying the given text as its payload.
Send Sends raw binary data as one or more frames, splitting it when message splitting is enabled.
SendMasked Sends raw binary data with the payload masked, as required for client-to-server frames.