<?xml version="1.0"?>
<doc>
<assembly>
<name>HslCommunication</name>
</assembly>
<members>
<member name="T:HslCommunication.Algorithms.ConnectPool.DeviceCommConnector">
<summary>
基于设备通信的连接池信息<br />
Connection pool information based on device communication
</summary>
</member>
<member name="M:HslCommunication.Algorithms.ConnectPool.DeviceCommConnector.#ctor(HslCommunication.Core.Device.DeviceCommunication)">
<summary>
使用指定的设备来实例化一个对象<br />
Use the specified device to instantiate an object
</summary>
<param name="device">指定的设备通信</param>
</member>
<member name="P:HslCommunication.Algorithms.ConnectPool.DeviceCommConnector.Device">
<summary>
获取当前实际的设备通信对象<br />
Gets the actual device communication object at present
</summary>
</member>
<member name="P:HslCommunication.Algorithms.ConnectPool.DeviceCommConnector.IsConnectUsing">
<inheritdoc cref="P:HslCommunication.Algorithms.ConnectPool.IConnector.IsConnectUsing"/>
</member>
<member name="P:HslCommunication.Algorithms.ConnectPool.DeviceCommConnector.GuidToken">
<inheritdoc cref="P:HslCommunication.Algorithms.ConnectPool.IConnector.GuidToken"/>
</member>
<member name="P:HslCommunication.Algorithms.ConnectPool.DeviceCommConnector.LastUseTime">
<inheritdoc cref="P:HslCommunication.Algorithms.ConnectPool.IConnector.LastUseTime"/>
</member>
<member name="M:HslCommunication.Algorithms.ConnectPool.DeviceCommConnector.Close">
<inheritdoc cref="M:HslCommunication.Algorithms.ConnectPool.IConnector.Close"/>
</member>
<member name="M:HslCommunication.Algorithms.ConnectPool.DeviceCommConnector.Open">
<inheritdoc cref="M:HslCommunication.Algorithms.ConnectPool.IConnector.Open"/>
</member>
<member name="T:HslCommunication.Algorithms.ConnectPool.ConnectPool`1">
<summary>
一个连接池管理器,负责维护多个可用的连接,并且自动清理,扩容,用于快速读写服务器或是PLC时使用。<br />
A connection pool manager is responsible for maintaining multiple available connections,
and automatically cleans up, expands, and is used to quickly read and write servers or PLCs.
</summary>
<typeparam name="TConnector">管理的连接类,需要支持IConnector接口</typeparam>
<remarks>
需要先实现 <see cref="T:HslCommunication.Algorithms.ConnectPool.IConnector"/> 接口的对象,然后就可以实现真正的连接池了,理论上可以实现任意的连接对象,包括modbus连接对象,各种PLC连接对象,数据库连接对象,redis连接对象,SimplifyNet连接对象等等。下面的示例就是modbus-tcp的实现
<note type="warning">要想真正的支持连接池访问,还需要服务器支持一个端口的多连接操作,三菱PLC的端口就不支持,如果要测试示例代码的连接池对象,需要使用本组件的<see cref="T:HslCommunication.ModBus.ModbusTcpServer"/>来创建服务器对象</note>
</remarks>
<example>
下面举例实现一个modbus的连接池对象,先实现接口化的操作
<code lang="cs" source="HslCommunication_Net45.Test\Documentation\Samples\Algorithms\ConnectPool.cs" region="IConnector Example" title="IConnector示例" />
然后就可以实现真正的连接池了
<code lang="cs" source="HslCommunication_Net45.Test\Documentation\Samples\Algorithms\ConnectPool.cs" region="ConnectPoolExample" title="ConnectPool示例" />
当然在V12版本以上的,可以使用统一的设备基类来实现连接池,也是一样的效果。
<code lang="cs" source="HslCommunication_Net45.Test\Documentation\Samples\Algorithms\ConnectPool.cs" region="ConnectPoolExample" title="ConnectPool示例" />
</example>
</member>
<member name="M:HslCommunication.Algorithms.ConnectPool.ConnectPool`1.#ctor(System.Func{`0})">
<summary>
实例化一个连接池对象,需要指定如果创建新实例的方法<br />
To instantiate a connection pool object, you need to specify how to create a new instance
</summary>
<param name="createConnector">创建连接对象的委托</param>
</member>
<member name="M:HslCommunication.Algorithms.ConnectPool.ConnectPool`1.GetAvailableConnector">
<summary>
获取一个可用的连接对象,如果已经达到上限,就进行阻塞等待。当使用完连接对象的时候,需要调用<see cref="M:HslCommunication.Algorithms.ConnectPool.ConnectPool`1.ReturnConnector(`0)"/>方法归还连接对象。<br />
Get an available connection object, if the upper limit has been reached, block waiting. When the connection object is used up,
you need to call the <see cref="M:HslCommunication.Algorithms.ConnectPool.ConnectPool`1.ReturnConnector(`0)"/> method to return the connection object.
</summary>
<returns>可用的连接对象</returns>
</member>
<member name="M:HslCommunication.Algorithms.ConnectPool.ConnectPool`1.ReturnConnector(`0)">
<summary>
使用完之后需要通知连接池的管理器,本方法调用之前需要获取到连接对象信息。<br />
After using it, you need to notify the manager of the connection pool, and you need to get the connection object information before calling this method.
</summary>
<param name="connector">连接对象</param>
</member>
<member name="M:HslCommunication.Algorithms.ConnectPool.ConnectPool`1.ResetAllConnector">
<summary>
将目前连接中的所有对象进行关闭,然后移除队列。<br />
Close all objects in the current connection, and then remove the queue.
</summary>
</member>
<member name="P:HslCommunication.Algorithms.ConnectPool.ConnectPool`1.MaxConnector">
<summary>
获取或设置最大的连接数,当实际的连接数超过最大的连接数的时候,就会进行阻塞,直到有新的连接对象为止。<br />
Get or set the maximum number of connections. When the actual number of connections exceeds the maximum number of connections,
it will block until there is a new connection object.
</summary>
</member>
<member name="P:HslCommunication.Algorithms.ConnectPool.ConnectPool`1.ConectionExpireTime">
<summary>
获取或设置当前连接过期的时间,单位秒,默认30秒,也就是说,当前的连接在设置的时间段内未被使用,就进行释放连接,减少内存消耗。<br />
Get or set the expiration time of the current connection, in seconds, the default is 30 seconds, that is,
if the current connection is not used within the set time period, the connection will be released to reduce memory consumption.
</summary>
</member>
<member name="P:HslCommunication.Algorithms.ConnectPool.ConnectPool`1.UsedConnector">
<summary>
当前已经使用的连接数,会根据使用的频繁程度进行动态的变化。<br />
The number of currently used connections will dynamically change according to the frequency of use.
</summary>
</member>
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
HslCommunicationDemo-v11.7.0.zip (11个子文件)
DynamicExpresso.Core.dll 98KB
Upgrade.exe 58KB
HslCommunicationDemo.exe 3.19MB
HslControls.dll 2.45MB
WeifenLuo.WinFormsUI.Docking.ThemeVS2015.dll 237KB
WeifenLuo.WinFormsUI.Docking.dll 308KB
HslCommunication.dll 4.02MB
libssl-3-x64.dll 760KB
HslCommunication.xml 3.83MB
Newtonsoft.Json.dll 686KB
libcrypto-3-x64.dll 5.8MB
共 11 条
- 1
资源评论
ylsqa
- 粉丝: 0
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于javaweb的网上拍卖系统,采用Spring + SpringMvc+Mysql + Hibernate+ JSP技术
- polygon-mumbai
- Chrome代理 switchyOmega
- GVC-全球价值链参与地位指数,基于ICIO表,(Wang等 2017a)计算方法
- 易语言ADS指纹浏览器管理工具
- 易语言奇易模块5.3.6
- cad定制家具平面图工具-(FG)门板覆盖柜体
- asp.net 原生js代码及HTML实现多文件分片上传功能(自定义上传文件大小、文件上传类型)
- whl@pip install pyaudio ERROR: Failed building wheel for pyaudio
- Constantsfd密钥和权限集合.kt
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功