StreamWebSocket.Close 方法

定義

多載

Close()

關閉 StreamWebSocket ,並將空的關閉框架傳送至伺服器。

Close(UInt16, String)

關閉 StreamWebSocket ,並指出關閉的原因。

Close()

關閉 StreamWebSocket ,並將空的關閉框架傳送至伺服器。

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

實作

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

備註

Close 方法是由 Windows 應用程式使用 JavaScript 使用。 對於使用 C# .NET Framework 4.5 撰寫的應用程式,VB.NET,Close 方法會公開為StreamWebSocket上的 方法。 針對以 C++ 撰寫的應用程式,會在物件上使用 delete 關鍵字時呼叫 Close 方法。

另請參閱

適用於

Close(UInt16, String)

關閉 StreamWebSocket ,並指出關閉的原因。

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)

參數

code
UInt16

unsigned short

uint16_t

狀態碼,指出關閉的原因。

reason
String

Platform::String

winrt::hstring

選擇性 UTF-8 編碼的資料,其中包含有關關閉的其他資訊。

實作

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)
屬性

另請參閱

適用於