Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

onopen event

Fires when a WebSocket is connected.

Syntax

Event Property object.onopen = handler;
addEventListener Method object.addEventListener("open", handler, useCapture)

Event handler parameters

handler [in]

Type: Function

Event handler to call when a WebSocket connect is made.

Remarks

This event fires only when a connection is made. To determine if a connection is still open, use readyState. If you provide a protocol when opening a WebSocket, it is recommended that the app check the protocol property to ensure the protocol was accepted by the server.

See also

WebSocket
readyState
WebSockets in Windows
WebSockets RFC 6455
The WebSocket API

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.