点击或拖拽改变大小

ToledoTcpServer 类

托利多电子秤的TCP服务器,启动服务器后,等待电子秤的数据连接。
继承层次
SystemObject
  HslCommunication.Core.NetCommunicationTcpServer
    HslCommunication.Core.NetCommunicationServer
      HslCommunication.Profinet.ToledoToledoTcpServer

命名空间:  HslCommunication.Profinet.Toledo
程序集:  HslCommunication (在 HslCommunication.dll 中) 版本:12.0.0.0 (12.0.0.0)
语法
public class ToledoTcpServer : CommunicationServer

ToledoTcpServer 类型公开以下成员。

构造函数
  名称说明
公共方法ToledoTcpServer
实例化一个默认的对象
Top
属性
  名称说明
公共属性CheckSerialDataComplete
检查串口接收到的数据是否完整
(继承自 CommunicationServer。)
公共属性CreateNewMessage
获取一个新的消息对象的方法,需要在继承类里面进行重写
The method to get a new message object needs to be overridden in the inheritance class
(继承自 CommunicationServer。)
公共属性CreatePipeSession
创建会话状态的委托对象,也就可以自己指定创建自定义的会话
(继承自 CommunicationServer。)
公共属性EnableIPv6
获取或设置服务器是否支持IPv6的地址协议信息
Get or set whether the server supports IPv6 address protocol information
(继承自 CommunicationTcpServer。)
公共属性ForceSerialReceiveOnce
获取或设置当前的服务器接收串口数据时候,是否强制只接收一次数据,默认为false,适合点对点通信,如果你总线形式的连接,则需要设置 True
Get or set whether to force the data to be received only once when the current server receives serial port data. The default value is false, which is suitable for point-to-point communication. If you have a bus connection, you need to set True
(继承自 CommunicationServer。)
公共属性HasChk
获取或设置当前的报文否是含有校验的,默认为含有校验
公共属性IsStarted
服务器引擎是否启动
Whether the server engine is started
(继承自 CommunicationTcpServer。)
公共属性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。)
公共属性SerialReceiveAtleastTime
获取或设置串口模式下,接收一条数据最短的时间要求,当设备发送的数据非常慢的时候,或是分割发送数据的时候,就需要将本值设置的大一点,默认为20ms
Get or set the shortest time required to receive a piece of data in serial port mode. When the data sent by the device is very slow, or when the data is divided and sent, you need to set this value to a larger value, the default is 20ms
(继承自 CommunicationServer。)
公共属性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。)
公共属性ThreadPoolLoginAfterClientCheck
当线程检查后,进行登录之前的检查,通常用于自定义的握手包校验操作。仅对TCP通信的时候有效。
(继承自 CommunicationServer。)
公共属性UdpBufferSize
获取或设置一次接收时的数据长度,默认2KB数据长度,特殊情况的时候需要调整
Gets or sets the length of data received at a time. The default length is 2KB
(继承自 CommunicationServer。)
Top
方法
  名称说明
公共方法AddSession
新增加一个管道会话信息
(继承自 CommunicationServer。)
受保护的方法CheckSerialReceiveDataComplete
检查串口接收的数据是否完成的方法,如果接收完成,则返回True
(继承自 CommunicationServer。)
公共方法CloseSerialSlave
关闭提供从机服务的串口对象
Close the serial port object that provides slave services
(继承自 CommunicationServer。)
公共方法ConnectHslAlientClient
创建一个指定的异形客户端连接,使用Hsl协议来发送注册包
Create a specified profiled client connection and use the Hsl protocol to send registration packets
(继承自 CommunicationServer。)
公共方法ConnectRemoteServer
新增一个主动连接的请求,将不会收到是否连接成功的信息,当网络中断及奔溃之后,会自动重新连接。
A new active connection request will not receive a message whether the connection is successful. When the network is interrupted and crashed, it will automatically reconnect.
(继承自 CommunicationServer。)
公共方法Equals (继承自 Object。)
受保护的方法ExtraOnClose
关闭的时候额外执行的功能代码
(继承自 CommunicationServer。)
受保护的方法ExtraOnStart
服务器启动的时候额外执行的功能代码
(继承自 CommunicationTcpServer。)
受保护的方法Finalize (继承自 Object。)
公共方法GetHashCode (继承自 Object。)
受保护的方法GetNewNetMessage
获取一个新的消息对象的方法,需要在继承类里面进行重写
The method to get a new message object needs to be overridden in the inheritance class
(继承自 CommunicationServer。)
公共方法GetPipeSessions
获取管道会话的列表
(继承自 CommunicationServer。)
公共方法GetTrustedClients
获取受信任的客户端列表
Get a list of trusted clients
(继承自 CommunicationTcpServer。)
公共方法GetType (继承自 Object。)
受保护的方法LogDebugMsg
记录当前的日志信息
(继承自 CommunicationTcpServer。)
受保护的方法MemberwiseClone (继承自 Object。)
公共方法RemoveSession(TimeSpan)
指定超时时间移除当前的会话列表,只有是TCP的管道(PipeTcpNet)才需要被移除。
Specify a timeout to remove the current session list. Only TCP pipe (PipeTcpNet) need to be removed.
(继承自 CommunicationServer。)
公共方法RemoveSession(PipeSession, String)
移除一个管道会话
(继承自 CommunicationServer。)
公共方法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。)
公共方法ServerStart(Int32, Boolean)
指定端口号来启动服务器的引擎
Specify the port number to start the server's engine
(继承自 CommunicationServer。)
公共方法SetNetMessage
设置当前的服务器接收的消息信息
(继承自 CommunicationServer。)
公共方法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。)
公共方法StartSerialSlave(ActionSerialPort)
启动串口的从机服务,使用自定义的初始化方法初始化串口的参数
Start the slave service of serial and initialize the parameters of the serial port using a custom initialization method
(继承自 CommunicationServer。)
公共方法StartSerialSlave(String)
启动串口的从机服务,使用默认的参数进行初始化串口,9600波特率,8位数据位,无奇偶校验,1位停止位
Start the slave service of serial, initialize the serial port with default parameters, 9600 baud rate, 8 data bits, no parity, 1 stop bit
(继承自 CommunicationServer。)
公共方法StartSerialSlave(String, Int32)
启动串口的从机服务,使用默认的参数进行初始化串口,8位数据位,无奇偶校验,1位停止位
Start the slave service of serial, initialize the serial port with default parameters, 8 data bits, no parity, 1 stop bit
(继承自 CommunicationServer。)
公共方法StartSerialSlave(String, Int32, Int32, Parity, StopBits)
启动串口的从机服务,使用指定的参数进行初始化串口,指定数据位,指定奇偶校验,指定停止位
(继承自 CommunicationServer。)
受保护的方法ThreadPoolLogin
当客户端连接到服务器,并听过额外的检查后,进行回调的方法
Callback method when the client connects to the server and has heard additional checks
(继承自 CommunicationServer。)
公共方法ToString (重写 CommunicationServerToString.)
Top
事件
  名称说明
公共事件OnPipeMessageReceived
当管道接收到消息时触发
(继承自 CommunicationServer。)
公共事件OnToledoStandardDataReceived
当接收到一条新的托利多的数据的时候触发
Top
字段
  名称说明
受保护的字段socketServer
核心的socket服务器
(继承自 CommunicationTcpServer。)
Top
扩展方法
  名称说明
公共扩展器方法ToJsonString
获取当前对象的JSON格式表示的字符串。
Gets the string represented by the JSON format of the current object.
(由 HslExtension 定义。)
Top
参见