语言

ServerStreamWebSocket.Close 方法

定义

重载

名称 说明
Close()

关闭 ServerStreamWebSocket 并将空的关闭帧发送到服务器。

Close(UInt16, String)

关闭 ServerStreamWebSocket 对象,并指示关闭的原因。

Close()

关闭 ServerStreamWebSocket 并将空的关闭帧发送到服务器。

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 要求

要求 说明
应用功能
internetClientServer privateNetworkClientServer

适用于

Close(UInt16, String)

关闭 ServerStreamWebSocket 对象,并指示关闭的原因。

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

指示关闭原因的状态代码。 相应的代码列表位于 IANA(Internet 分配号码颁发机构)WebSocket 协议 注册表 上,也记录在 MDN 上。

reason
String

Platform::String

winrt::hstring

可选的 UTF-8 编码数据,其中包含有关关闭的其他信息。

属性

Windows 要求

要求 说明
应用功能
internetClientServer privateNetworkClientServer

适用于