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

TcpClientFactoryTClient

适用于Tcp客户端的连接工厂。

Definition

命名空间: TouchSocket.Sockets
程序集: TouchSocket (在 TouchSocket.dll 中) 版本:3.0.0+ccaf96084d09f972257496d1dd63b8ba3c1e44f0
C#
public abstract class TcpClientFactory<TClient> : ConnectableClientFactory<TClient>
where TClient : class, ITcpClient
Inheritance
Object    DisposableObject    DependencyObject    ClientFactoryTClient    ConnectableClientFactoryTClient    TcpClientFactoryTClient
Derived

类型参数

TClient
表示Tcp客户端的类型参数,必须实现ITcpClient接口。

构造函数

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

属性

AvailableCount 获取可用的客户端数量。

该值指示了当前空闲的客户端数量和未创建的客户端数量。


(继承自 ClientFactoryTClient。)
ConnectTimeout 连接超时设定
(继承自 ConnectableClientFactoryTClient。)
CreatedClients 已创建的客户端安全列表,一般不要直接操作。
(继承自 ClientFactoryTClient。)
CreatedCount 获取已经创建的客户端数量。
(继承自 ClientFactoryTClient。)
DisposedValue 标识该对象是否已被释放
(继承自 DisposableObject。)
FreeClients 空闲客户端的安全队列,一般不要直接操作。
(继承自 ClientFactoryTClient。)
FreeCount 获取空闲的客户端数量。
(继承自 ClientFactoryTClient。)
GetConfig 获取传输的客户端配置
(继承自 ConnectableClientFactoryTClient。)
MaxCount 最大客户端数量。默认10。
(继承自 ClientFactoryTClient。)
MinCount 池中维护的最小客户端数量。默认0。
(继承自 ClientFactoryTClient。)

方法

Clear 清理池中的所有客户端。
(继承自 ClientFactoryTClient。)
CloneTo 将当前对象的依赖项克隆到目标对象中
(继承自 DependencyObject。)
CreateClient 创建客户端
(继承自 ConnectableClientFactoryTClient。)
CreateClient(TouchSocketConfig) 创建客户端。
(继承自 ConnectableClientFactoryTClient。)
Dispose 释放资源。内部已经处理了SuppressFinalize(Object)
(继承自 DisposableObject。)
Dispose(Boolean) 处置资源
(继承自 ClientFactoryTClient。)
DisposeClient 处理Tcp客户端的释放操作。
(重写 ClientFactoryTClientDisposeClient(TClient))
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。)
GetClient 获取一个指定客户端,默认情况下等待1秒。
(继承自 ClientFactoryTClient。)
GetClient(TimeSpan) 获取用于传输的客户端结果。可以支持IDisposable
(继承自 ClientFactoryTClient。)
GetHashCodeServes as the default hash function.
(继承自 Object。)
GetTypeGets the Type of the current instance.
(继承自 Object。)
GetValueTValue 获取依赖注入的值,当没有注入时,会返回默认行为的值。
(继承自 DependencyObject。)
HasValueTValue 判断在当前对象中是否有已设置的属性值。
(继承自 DependencyObject。)
IsAlive 判断客户端是不是存活状态。
(继承自 ConnectableClientFactoryTClient。)
MemberwiseCloneCreates a shallow copy of the current Object.
(继承自 Object。)
OnGetConfig 获取配置。
(继承自 ConnectableClientFactoryTClient。)
RemoveValueTValue 移除属性值。
(继承自 DependencyObject。)
RentClient 租赁客户端
(继承自 ClientFactoryTClient。)
ReturnClient 放回使用完成的客户端
(继承自 ClientFactoryTClient。)
SetValueTValue 设置依赖注入的值,如果值已经存在,将被覆盖。
(继承自 DependencyObject。)
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 定义。)

参见