DS Server

Javascript: WebSocketClosedEventArgs.reason Property

Property|Introduced in 24.0

Description

The reason the server closed the connection. This is specific to the particular server and sub-protocol.

Syntax

<string> WebSocketClosedEventArgs.reason

Examples

The following example demonstrates WebSocketClosedEventArgs.reason in a practical document-editing workflow. The reason the server closed the connection. This is specific to the particular server and sub-protocol.

function inspectReason(webSocketClosedEventArgs) {
    const reason = webSocketClosedEventArgs.reason;
    console.log("reason:", reason);
}