Table of Contents

TTMSFNCWebSocketConnection Class

Represents a single peer connection, handling incoming frames and providing methods to send text, binary, and control data over the protocol.

API unit family: TMSFNCWebSocketCommon

Syntax

TTMSFNCWebSocketConnection = class

Remarks

This is an abstract base; the transport-specific peer details are supplied by descendants.

Properties

Name Description
CloseSent Indicates whether a close frame has already been sent on this connection.
HandshakeCompleted Indicates whether the upgrade handshake has completed.
HandshakeRequest Parsed request received during the upgrade handshake.
Options Behavioral options in effect for this connection.
PeerIP IP address of the remote peer.
PeerPort Port of the remote peer.
WebSocketVersion Protocol version expected for this connection.

Methods

Name Description
GetFrameClass Returns the frame class used when creating outgoing frames.
Send Sends a text message as a single final text frame.
SendBytes Sends binary data as a single final binary frame.
SendBytesInMultipleFrames Sends binary data split across multiple fragmented frames.
SendClose Sends a close control frame with optional payload data.
SendFrame Sends a fully prepared frame over the connection without further validation.
SendInMultipleFrames Sends a text message split across multiple fragmented frames.
SendSimpleFrame Sends a control frame such as ping, pong, or close.

Events

Name Description
OnBinaryDataReceived Occurs when binary data is received.
OnClose Occurs when a close control frame is received.
OnMessageReceived Occurs when a complete text message is received.
OnPing Occurs when a ping control frame is received.
OnPong Occurs when a pong control frame is received.