一款简单易用的基础网络通讯组件库。

WebSocketFeature 类

基于Http的WebSocket的扩展。

此组件只能挂载在HttpService

Definition

命名空间: TouchSocket.Http.WebSockets
程序集: TouchSocket.Http (在 TouchSocket.Http.dll 中) 版本:3.0.0+ccaf96084d09f972257496d1dd63b8ba3c1e44f0
C#
[PluginOptionAttribute(Singleton = true)]
public sealed class WebSocketFeature : PluginBase
Inheritance
Object    DisposableObject    PluginBase    WebSocketFeature

构造函数

WebSocketFeature WebSocketFeature

属性

AutoClose 是否默认处理Close报文。
AutoPong 当收到ping报文时,是否自动回应pong。
DisposedValue 标识该对象是否已被释放
(继承自 DisposableObject。)
PluginManager 插件管理器
(继承自 PluginBase。)
VerifyConnection 验证连接
WSUrl 用于WebSocket连接的路径,默认为“/ws”

如果设置为null或空,则意味着所有的连接都将解释为WS

方法

Dispose 释放资源。内部已经处理了SuppressFinalize(Object)
(继承自 DisposableObject。)
EqualsDetermines whether the specified object is equal to the current object.
(继承自 Object。)
GetHashCodeServes as the default hash function.
(继承自 Object。)
GetTypeGets the Type of the current instance.
(继承自 Object。)
NoAutoClose 不处理Close报文。
SetVerifyConnection(FuncIHttpSessionClient, HttpContext, Boolean) 验证连接
SetVerifyConnection(FuncIHttpSessionClient, HttpContext, TaskBoolean) 验证连接
SetWSUrl 用于WebSocket连接的路径,默认为“/ws”

如果设置为null或空,则意味着所有的连接都将解释为WS

ToStringReturns a string that represents the current object.
(继承自 Object。)
UseAutoPong 当收到ping报文时,自动回应pong。

字段

AutoCloseProperty 自动响应Close报文
AutoPongProperty 自动响应Ping报文

扩展方法

Map
(由 Mapper 定义。)
Map
(由 Mapper 定义。)
MapTTarget
(由 Mapper 定义。)
ToJsonString 转换为Json
(由 SerializeConvert 定义。)

参见