Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

onclose event

Fires when a WebSocket connection is closed.

Syntax

Event Property object.onclose = handler;
addEventListener Method object.addEventListener("close", handler, useCapture)

 

Event handler parameters

handler [in]

Type: Function

Event handler to call when the WebSocket is closed..

Remarks

When a WebSocket is closed, the onclose event will return three attributes:

  • wasClean - boolean - When true, the connection closed normally and as expected.
  • code - unsigned long - Status code from the server. For more info on the codes, see RFC 6455 section 7.4.1.
  • reason - text - reason provided by the server.

See also

WebSocket
close

 

 

Show:
© 2017 Microsoft