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

ReconnectionPluginTClient

重连插件

Definition

命名空间: TouchSocket.Sockets
程序集: TouchSocket (在 TouchSocket.dll 中) 版本:3.0.0+ccaf96084d09f972257496d1dd63b8ba3c1e44f0
C#
public abstract class ReconnectionPlugin<TClient> : PluginBase
where TClient : IDisposableObject, IConnectableClient, IOnlineClient, ILoggerObject
Inheritance
Object    DisposableObject    PluginBase    ReconnectionPluginTClient
Derived

类型参数

TClient

[缺少 "T:TouchSocket.Sockets.ReconnectionPlugin`1" 的 <typeparam name="TClient"/> 文档]

构造函数

属性

ActionForCheck 每个周期可执行的委托。用于检验客户端活性。返回true表示存活,返回
ActionForConnect ActionForConnect
DisposedValue 标识该对象是否已被释放
(继承自 DisposableObject。)
PluginManager 插件管理器
(继承自 PluginBase。)
Tick 检验时间间隔

方法

Dispose 释放资源。内部已经处理了SuppressFinalize(Object)
(继承自 DisposableObject。)
Dispose(Boolean) 处置资源
(重写 DisposableObjectDispose(Boolean))
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。)
Loaded 在插件被成功添加在IPluginManager时执行。
(重写 PluginBaseLoaded(IPluginManager))
MemberwiseCloneCreates a shallow copy of the current Object.
(继承自 Object。)
SetActionForCheck(FuncTClient, Int32, NullableBoolean) 设置每个周期执行的委托。用于判断客户端是否存活。如果返回True,表示客户端存活。返回False,表示客户端失活,需要立即重连。返回null,则表示跳过此次检查。
SetActionForCheck(FuncTClient, Int32, TaskNullableBoolean) 设置一个周期性执行的委托,用于检查客户端状态。
SetConnectAction(FuncTClient, Boolean) 设置连接动作
SetConnectAction(FuncTClient, TaskBoolean) 设置连接动作
SetConnectAction(TimeSpan, FuncTClient, Int32, Exception, Boolean, ActionTClient) 设置连接动作
SetConnectAction(Int32, Boolean, Int32, ActionTClient) 设置连接动作
ThrowIfDisposed 判断当前对象是否已经被释放。 如果已经被释放,则抛出ObjectDisposedException异常。
(继承自 DisposableObject。)
ToStringReturns a string that represents the current object.
(继承自 Object。)
Unloaded 在插件被Remove(IPlugin)时执行。
(继承自 PluginBase。)
UsePolling 使用轮询保持活性。

扩展方法

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

参见