点击或拖拽改变大小

WebSocketServer 属性

WebSocketServer 类型公开以下成员。

属性
  名称说明
公共属性EnableIPv6
获取或设置服务器是否支持IPv6的地址协议信息
Get or set whether the server supports IPv6 address protocol information
(继承自 NetworkServerBase。)
公共属性IsStarted
服务器引擎是否启动
Whether the server engine is started
(继承自 NetworkServerBase。)
公共属性IsTopicRetain
获取或设置当前的服务器是否对订阅主题信息缓存,方便订阅客户端立即收到结果,默认开启
Gets or sets whether the current server caches the topic information of the subscription, so that the subscription client can receive the results immediately. It is enabled by default.
公共属性KeepAlivePeriod
设置的参数,最小单位为1s,当超过设置的时间间隔必须回复PONG报文,否则服务器认定为掉线。默认120秒
Set the minimum unit of the parameter is 1s. When the set time interval is exceeded, the PONG packet must be returned, otherwise the server considers it to be offline. 120 seconds by default
公共属性KeepAliveSendInterval
获取或是设置用于保持连接的心跳时间的发送间隔。默认30秒钟,需要在服务启动之前设置
Gets or sets the sending interval of the heartbeat time used to keep the connection. 30 seconds by default, need to be set before the service starts
公共属性代码示例LogNet
组件的日志工具,支持日志记录,只要实例化后,当前网络的基本信息,就以DEBUG等级进行输出
The component's logging tool supports logging. As long as the instantiation of the basic network information, the output will be output at DEBUG
(继承自 NetworkBase。)
公共属性OnlineCount
获取当前的在线的客户端数量
Get the current number of online clients
公共属性OnlineSessions
获取当前的在线的客户端信息,可以用于额外的分析或是显示。
公共属性Port
获取或设置服务器的端口号,如果是设置,需要在服务器启动前设置完成,才能生效。
Gets or sets the port number of the server. If it is set, it needs to be set before the server starts to take effect.
(继承自 NetworkServerBase。)
公共属性SocketKeepAliveTime
获取或设置客户端的Socket的心跳时间信息,这个是Socket底层自动实现的心跳包,不基于协议层实现。默认小于0,不开启心跳检测,如果需要开启,设置 60_000 比较合适,单位毫秒
Get or set the heartbeat time information of the Socket of the client. This is the heartbeat packet automatically implemented by the bottom layer of the Socket, not based on the protocol layer. The default value is less than 0, and heartbeat detection is not enabled. If you need to enable it, it is more appropriate to set 60_000, in milliseconds.
(继承自 NetworkServerBase。)
公共属性代码示例Token
网络类的身份令牌,在hsl协议的模式下会有效,在和设备进行通信的时候是无效的
Network-type identity tokens will be valid in the hsl protocol mode and will not be valid when communicating with the device
(继承自 NetworkBase。)
公共属性TopicWildcard
获取或设置是否启用订阅主题通配符的功能,默认为 False
Gets or sets whether to enable the function of subscribing to the topic wildcard, the default is False
Top
参见