点击或拖拽改变大小

DTUServer 类

DTU的服务器信息,本服务器支持任意的hsl支持的网络对象,包括plc信息,modbus设备等等,通过DTU来连接, 然后支持多个连接对象。如果需要支持非hsl的注册报文,需要重写相关的方法
DTU server information, the server supports any network objects supported by hsl, including plc information, modbus devices, etc., connected through DTU, and then supports multiple connection objects. If you need to support non-HSL registration messages, you need to rewrite the relevant methods
继承层次
SystemObject
  HslCommunication.Core.NetCommunicationTcpServer
    HslCommunication.Core.NetNetworkAlienClient
      HslCommunication.DTUDTUServer

命名空间:  HslCommunication.DTU
程序集:  HslCommunication (在 HslCommunication.dll 中) 版本:12.0.0.0 (12.0.0.0)
语法
public class DTUServer : NetworkAlienClient

DTUServer 类型公开以下成员。

构造函数
属性
  名称说明
公共属性EnableIPv6
获取或设置服务器是否支持IPv6的地址协议信息
Get or set whether the server supports IPv6 address protocol information
(继承自 CommunicationTcpServer。)
公共属性IsCheckPwd
是否统一检查密码,如果每个会话需要自己检查密码,就需要设置为false
Whether to check the password uniformly, if each session needs to check the password by itself, it needs to be set to false
(继承自 NetworkAlienClient。)
公共属性IsResponseAck
是否返回响应,默认为 True
The default is True
(继承自 NetworkAlienClient。)
公共属性IsStarted
服务器引擎是否启动
Whether the server engine is started
(继承自 CommunicationTcpServer。)
公共属性Item
根据DTU信息获取设备的连接对象
Obtain the connection object of the device according to the DTU information
公共属性LogDebugMessage
记录一些调试日志的委托,将会进行输出调试文本。
The delegate that records some debug logs will output debug text.
(继承自 CommunicationTcpServer。)
公共属性代码示例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
(继承自 CommunicationTcpServer。)
公共属性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.
(继承自 CommunicationTcpServer。)
公共属性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.
(继承自 CommunicationTcpServer。)
Top
方法
  名称说明
公共方法Dispose (继承自 NetworkAlienClient。)
受保护的方法Dispose(Boolean)
释放当前的对象
(继承自 NetworkAlienClient。)
公共方法Equals (继承自 Object。)
受保护的方法ExtraOnClose
关闭的时候额外执行的功能代码
(重写 CommunicationTcpServerExtraOnClose.)
受保护的方法ExtraOnStart
服务器启动的时候额外执行的功能代码
(继承自 CommunicationTcpServer。)
受保护的方法Finalize (继承自 Object。)
公共方法GetAlienSessions
获取所有的会话信息,是否在线,上线的基本信息
Get all the session information, whether it is online, online basic information
公共方法GetDevices
获取所有的设备的信息,可以用来读写设备的数据信息
Get all device information, can be used to read and write device data information
公共方法GetHashCode (继承自 Object。)
公共方法GetTrustedClients
获取受信任的客户端列表
Get a list of trusted clients
(继承自 CommunicationTcpServer。)
公共方法GetType (继承自 Object。)
公共方法IsClientOnline
检测当前的DTU是否在线
(重写 NetworkAlienClientIsClientOnline(AlienSession).)
受保护的方法LogDebugMsg
记录当前的日志信息
(继承自 CommunicationTcpServer。)
受保护的方法MemberwiseClone (继承自 Object。)
公共方法ServerClose
关闭服务器的引擎
Shut down the server's engine
(继承自 CommunicationTcpServer。)
公共方法ServerStart
指定端口号来启动服务器的引擎
Specify the port number to start the server's engine
(继承自 CommunicationTcpServer。)
公共方法ServerStart(Int32)
指定端口号来启动服务器的引擎
Specify the port number to start the server's engine
(继承自 CommunicationTcpServer。)
公共方法SetPassword
设置密码,需要传入长度为6的字节数组
To set the password, you need to pass in an array of bytes of length 6
(继承自 NetworkAlienClient。)
公共方法SetTrustClients
设置可信任的客户端列表,传入一个DTU的列表信息
Set up the list of trusted clients, passing in the list information for a DTU
(继承自 NetworkAlienClient。)
公共方法SetTrustedIpAddress
设置并启动受信任的客户端登录并读写,如果为null,将关闭对客户端的ip验证
Set and start the trusted client login and read and write, if it is null, the client's IP verification will be turned off
(继承自 CommunicationTcpServer。)
受保护的方法SocketAcceptExtraCheck
当客户端的socket登录的时候额外检查的操作,并返回操作的结果信息。
The operation is additionally checked when the client's socket logs in, and the result information of the operation is returned.
(继承自 CommunicationTcpServer。)
受保护的方法ThreadPoolLogin
当接收到了新的请求的时候执行的操作
An action performed when a new request is received
(继承自 NetworkAlienClient。)
公共方法ToString (重写 NetworkAlienClientToString.)
Top
事件
  名称说明
公共事件OnClientConnected
当有服务器连接上来的时候触发
Triggered when a server is connected
(继承自 NetworkAlienClient。)
Top
字段
  名称说明
受保护的字段socketServer
核心的socket服务器
(继承自 CommunicationTcpServer。)
Top
扩展方法
  名称说明
公共扩展器方法ToJsonString
获取当前对象的JSON格式表示的字符串。
Gets the string represented by the JSON format of the current object.
(由 HslExtension 定义。)
Top
备注
针对异形客户端进行扩展信息
参见