Jaa


MessageWebSocket.Close Method

Definition

Overloads

Close()

Closes the MessageWebSocket object and sends an empty close frame to the server.

Close(UInt16, String)

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

Close()

Closes the MessageWebSocket object and sends an empty close frame to the server.

public:
 virtual void Close() = Close;
void Close();
// This member is not implemented in C#
function close()
' This member is not implemented in VB.NET

Implements

M:Windows.Foundation.IClosable.Close M:System.IDisposable.Close

Remarks

The Close method is used by Windows app using JavaScript. For apps written using the .NET Framework 4.5 in C# and VB.NET, the Close method is exposed as the method on the MessageWebSocket. For apps written in C++, the Close method will be called when using the delete keyword on the object.

See also

Applies to

Close(UInt16, String)

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

public:
 virtual void Close(unsigned short code, Platform::String ^ reason) = Close;
/// [Windows.Foundation.Metadata.Overload("CloseWithStatus")]
void Close(uint16_t const& code, winrt::hstring const& reason);
[Windows.Foundation.Metadata.Overload("CloseWithStatus")]
public void Close(ushort code, string reason);
function close(code, reason)
Public Sub Close (code As UShort, reason As String)

Parameters

code
UInt16

unsigned short

uint16_t

Status code indicating the reason for closure. The list of appropriate codes is on the IANA (Internet Assigned Numbers Authority) WebSocket Protocol Registry and is also documented on MDN.

reason
String

Platform::String

winrt::hstring

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

Implements

M:Windows.Networking.Sockets.IWebSocket.Close(System.UInt16,System.String) M:Windows.Networking.Sockets.IWebSocket.Close(unsigned short,Platform::String) M:Windows.Networking.Sockets.IWebSocket.Close(uint16_t,winrt::hstring)
Attributes

See also

Applies to