Skip to main content
StreamWebSocket.Closed | closed event

Applies to Windows and Windows Phone

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

Syntax


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

streamWebSocket.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

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

StreamWebSocket
WebSocketClosedEventArgs