Deutsch | English | Español | Français |
Italiano | 日本語 | 한국어 | Português |
Pусский | 简体中文 | 繁體中文 |
Closes the MessageWebSocket object and indicates a reason for the closure.
Syntax
messageWebSocket.close(code, reason);
public void Close(
ushort code,
string reason
)
Public Sub Close(
code As UShort,
reason As String
)
public:
void Close(
unsigned short code,
String^ reason
)
Parameters
- code
-
Type: Number [JavaScript] | System.UInt16 [.NET] | uint16 [C++]
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 [JavaScript] | System.String [.NET] | Platform::String [C++]
Optional UTF-8-encoded data with additional information about the closure.
Requirements (Windows 10 device family)
| |
API contract |
|
Namespace |
|
Metadata |
|
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 |
|
Metadata |
|
See also