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

ModbusTcpSlaveSessionClient 类

具有调试显示属性的抽象基类,用于TCP会话客户端。

Definition

命名空间: TouchSocket.Modbus
程序集: TouchSocketPro.Modbus (在 TouchSocketPro.Modbus.dll 中) 版本:3.0.0+ccaf96084d09f972257496d1dd63b8ba3c1e44f0
C#
public abstract class ModbusTcpSlaveSessionClient : TcpSessionClientBase
Inheritance
Object    DisposableObject    DependencyObject    ConfigObject    ResolverConfigObject    TcpSessionClientBase    ModbusTcpSlaveSessionClient

备注

此类提供了基础结构,用于支持TCP会话的客户端,包括ID、IP和端口信息。 它实现了与TCP会话、客户端标识和解析器配置相关的接口。

构造函数

ModbusTcpSlaveSessionClient初始化 ModbusTcpSlaveSessionClient 类的一个新实例

属性

Config 配置项
(继承自 TcpSessionClientBase。)
DataHandlingAdapter 数据处理适配器
(继承自 TcpSessionClientBase。)
DisposedValue 标识该对象是否已被释放
(继承自 DisposableObject。)
Id 用于索引的Id
(继承自 TcpSessionClientBase。)
IP IP地址
(继承自 TcpSessionClientBase。)
IsClient 表示是否为客户端终端。当为时,表示是客户端。否则为服务器通讯终端。
(继承自 TcpSessionClientBase。)
LastReceivedTime 最后一次接收到数据的时间
(继承自 TcpSessionClientBase。)
LastSentTime 最后一次发送数据的时间
(继承自 TcpSessionClientBase。)
ListenOption 监听配置。

注意:一般情况下不要随意修改该值。


(继承自 TcpSessionClientBase。)
Logger 日志记录器
(继承自 ConfigObject。)
MainSocket 主通信器
(继承自 TcpSessionClientBase。)
Online 判断是否在线
(继承自 TcpSessionClientBase。)
PluginManager 插件管理器
(继承自 TcpSessionClientBase。)
Port 端口号
(继承自 TcpSessionClientBase。)
Protocol 终端协议
(继承自 TcpSessionClientBase。)
Resolver 获取解析器实例。
(继承自 TcpSessionClientBase。)
Service 包含此辅助类的主服务器类
(继承自 TcpSessionClientBase。)
ServiceIP 接收此客户端的服务器IP地址
(继承自 TcpSessionClientBase。)
ServicePort 接收此客户端的服务器端口
(继承自 TcpSessionClientBase。)
UseSsl 使用Ssl加密
(继承自 TcpSessionClientBase。)

方法

Abort 中止当前操作。
(继承自 TcpSessionClientBase。)
CloneTo 将当前对象的依赖项克隆到目标对象中
(继承自 DependencyObject。)
CloseAsync 关闭客户端。
(继承自 TcpSessionClientBase。)
Dispose 释放资源。内部已经处理了SuppressFinalize(Object)
(继承自 DisposableObject。)
Dispose(Boolean) 处置资源
(继承自 TcpSessionClientBase。)
EqualsDetermines whether the specified object is equal to the current object.
(继承自 Object。)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(继承自 Object。)
GetHashCodeServes as the default hash function.
(继承自 Object。)
GetTypeGets the Type of the current instance.
(继承自 Object。)
GetValueTValue 获取依赖注入的值,当没有注入时,会返回默认行为的值。
(继承自 DependencyObject。)
HasValueTValue 判断在当前对象中是否有已设置的属性值。
(继承自 DependencyObject。)
IdChanged 当Id更新的时候触发
(继承自 TcpSessionClientBase。)
MemberwiseCloneCreates a shallow copy of the current Object.
(继承自 Object。)
OnInitialized 当初始化完成时,执行在OnTcpConnecting(ConnectingEventArgs)之前。
(继承自 TcpSessionClientBase。)
OnTcpClosed 客户端已断开连接。

覆盖父类方法,将不会触发ITcpClosedPlugin插件。


(继承自 TcpSessionClientBase。)
OnTcpClosing 即将断开连接(仅主动断开时有效)。

覆盖父类方法,将不会触发ITcpClosingPlugin插件。


(继承自 TcpSessionClientBase。)
OnTcpConnected 当客户端完整建立Tcp连接时触发。

覆盖父类方法,将不会触发ITcpConnectedPlugin插件。


(继承自 TcpSessionClientBase。)
OnTcpConnecting 客户端正在连接。

覆盖父类方法,将不会触发ITcpConnectingPlugin插件。


(重写 TcpSessionClientBaseOnTcpConnecting(ConnectingEventArgs))
OnTcpReceived 当收到适配器处理的数据时。
(继承自 TcpSessionClientBase。)
OnTcpReceiving 当收到原始数据
(继承自 TcpSessionClientBase。)
OnTcpSending 在数据即将通过TCP发送时触发,此方法用于通过插件机制拦截发送行为。 如果子类覆盖了此方法,则不会触发插件。
(继承自 TcpSessionClientBase。)
ProtectedClearReceiver 清除接收器对象。
(继承自 TcpSessionClientBase。)
ProtectedCreateReceiver 创建或获取接收器对象。
(继承自 TcpSessionClientBase。)
ProtectedDefaultSendAsync 异步发送数据,保护方法。 此方法用于在已建立的TCP连接上异步发送数据。 它首先检查当前实例是否已被处置,然后检查客户端是否已连接。 如果这些检查通过,它将调用OnTcpSending事件处理程序进行预发送处理, 最后通过TCP核心组件实际发送数据。
(继承自 TcpSessionClientBase。)
ProtectedResetIdAsync 直接重置内部Id。
(继承自 TcpSessionClientBase。)
ProtectedSendAsync(IListArraySegmentByte) 异步发送字节传输列表。
(继承自 TcpSessionClientBase。)
ProtectedSendAsync(IRequestInfo) 异步发送请求信息。
(继承自 TcpSessionClientBase。)
ProtectedSendAsync(ReadOnlyMemoryByte) 异步发送只读内存数据。
(继承自 TcpSessionClientBase。)
ProtectedTryGetClient 尝试通过Id获得对应的客户端
(继承自 TcpSessionClientBase。)
RemoveValueTValue 移除属性值。
(继承自 DependencyObject。)
ResetIdAsync 重新设置Id
(继承自 TcpSessionClientBase。)
SetAdapter 设置数据处理适配器。
(继承自 TcpSessionClientBase。)
SetValueTValue 设置依赖注入的值,如果值已经存在,将被覆盖。
(继承自 DependencyObject。)
ThrowIfConfigIsNull 如果Config为空,则抛出ArgumentNullException的异常。
(继承自 ConfigObject。)
ThrowIfDisposed 判断当前对象是否已经被释放。 如果已经被释放,则抛出ObjectDisposedException异常。
(继承自 DisposableObject。)
ToStringReturns a string that represents the current object.
(继承自 Object。)
TryGetValueTValue 尝试获取依赖注入的值,当没有注入时,会返回
(继承自 DependencyObject。)
TryRemoveValueTValue 尝试重置属性值,如果没有这个值,则返回
(继承自 DependencyObject。)

扩展方法

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

参见