StreamWebSocket.Close 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| 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
備註
關閉方法則由 Windows 應用程式使用 JavaScript 使用。 對於使用 .NET Framework 4.5 在 C# 和 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)
- 屬性