MessageWebSocket.Close Method (UInt16, String)

Closes the MessageWebSocket object and indicates a reason for the closure.

Syntax

public:
void Close(
         uint16 code,
         String^ reason
)  

Parameters

code
Type: uint16 

  Status code indicating the reason for closure.The following values are supported:

Status codes in the range 0-999 are not used.

Status codes in the range 1000-2999 are reserved for definition by the WebSocket protocol.

Status codes in the range 3000-3999 are reserved for use by libraries, frameworks, and applications. These status codes are registered directly with IANA. The interpretation of these codes is undefined by the WebSocket protocol.

Status codes in the range 4000-4999 are reserved for private use and cannot be registered. Such codes can be used by prior agreements between WebSocket applications. The interpretation of these codes is undefined by the WebSocket protocol.

reason
Type: String 

  Optional UTF-8-encoded data with additional information about the closure.

Requirements

Namespace: Windows.Networking.Sockets

Metadata: windows.winmd

See also

Reference

MessageWebSocket Class

MessageWebSocket Members

Windows.Networking.Sockets Namespace