Table of Contents

TTMSFNCWebSocketServerConnection Class

Represents a single client connection accepted by the server. Stores per-connection state such as user data and handshake status, and exposes events to control acceptance and react to a completed handshake.

API unit family: TMSFNCWebSocketServer Inherits from: TTMSFNCWebSocketConnection

Syntax

TTMSFNCWebSocketServerConnection = class(TTMSFNCWebSocketConnection)

Properties

Name Description
HandshakeResponseSent Indicates whether the handshake response has already been sent to the client. When True the handshake completed and the connection can exchange messages.
OwnsUserData Determines whether the object assigned to UserData is owned by the connection. When True the user data object is freed together with the connection.
UserData An arbitrary object that the application can associate with this connection, for example to track session or user state.

Events

Name Description
OnAllow Occurs after a valid set of request headers has been received, so the handler can decide whether the connection is allowed. Set the event's allow parameter to False to reject the connection.
OnHandshakeResponseSent Occurs after the handshake response has been sent to this connection, signalling that it is ready for message exchange.

Used by