DS Server

WebSocketClosedEventArgs Object

Object|Introduced in 24.0

Description

The event argument object for the webSocketClosed event.

Syntax

{
   code: <number>,
   reason: <string>,
   wasClean: <boolean>
}

Examples

The following example demonstrates WebSocketClosedEventArgs in a practical document-editing workflow. The event argument object for the webSocketClosed event.

function handleWebSocketClosed(args) {
    console.log("code:", args.code);
    console.log("reason:", args.reason);
    console.log("was clean:", args.wasClean);
}

Members

Properties

PropertyDescription
codeThe close code sent by the server.
reasonThe reason the server closed the connection. This is specific to the particular server and sub-protocol.
wasCleanIndicates whether or not the connection was cleanly closed.