Skip to main content

Windows Dev Center

MessageWebSocket.Closed | closed event

Occurs when a close frame is received on the MessageWebSocket object as part of the close handshake.

Syntax


function onClosed(eventArgs) { /* Your code */ }
 
// addEventListener syntax
messageWebSocket.addEventListener("closed", onClosed);
messageWebSocket.removeEventListener("closed", onClosed);
 
- or -

messageWebSocket.onclosed = onClosed;

public event TypedEventHandler<IWebSocket, WebSocketClosedEventArgs> Closed

Public Event Closed As TypedEventHandler(Of IWebSocket, WebSocketClosedEventArgs)

public:
event TypedEventHandler<IWebSocket, WebSocketClosedEventArgs>^ Closed {
   Windows::Foundation::EventRegistrationToken add(TypedEventHandler<IWebSocket, WebSocketClosedEventArgs>^ value);
   void remove(Windows::Foundation::EventRegistrationToken token);
}

Event information

Delegate TypedEventHandler<IWebSocket, WebSocketClosedEventArgs>

Requirements (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Networking.Sockets
Windows::Networking::Sockets [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.Networking.Sockets
Windows::Networking::Sockets [C++]

Metadata

Windows.winmd

See also

MessageWebSocket
WebSocketClosedEventArgs