Skip to content

Commit d4d76e4

Browse files
ArgoZhangRRQM
andauthored
feat(ITcpSocketClient): add TouchSocket extensions (#6268)
* chore: 更新解决方案增加扩展包 * feat: 增加 ReceivedCallBack 回调方法 * test: 增加单元测试 * doc: 更新示例文档 * test: 增加 TouchSocket 单元测试 实现功能后单元测试应该可以通过的 * doc: 更新粘包分包文档 * feat: 增加 SendAsync 扩展方法 * test: 增加单元测试 * feat(tcp): 替换同步关闭方法为异步方法 将 `Close` 方法替换为异步的 `CloseAsync` 方法,以支持异步关闭操作并释放资源。`CloseAsync` 方法接受一个消息和一个可选的取消令牌作为参数,并返回一个 `ValueTask<bool>`,指示关闭操作的结果。原有的 `Close` 方法被移除,相关的资源释放逻辑被整合到新的异步方法中。 * refactor(tests): 使用异步方法关闭连接 在 TcpSocketFactoryTest.cs 和 TouchSocketTest.cs 中,将连接关闭逻辑从 client.Close() 更改为 await client.CloseAsync(string.Empty),以支持异步关闭连接并提高性能 * doc: 更新数据处理器相关文档 * refactor: 增加 ConnectAsync 扩展方法 * refactor: 更改关闭方法为同步方法 * test: 更新单元测试 * doc: 增加数据适配器文档 * doc: 增加新服务标记 * refactor: 更新 ITcpSocketFactory 接口定义 * feat: 增加 GetOrCreate 扩展方法 * test: 更新单元测试 * test: 增加单元测试 * refactor: 更改 GetOrCreate 签名 * test: 更新单元测试 * refactor: 根据最新设计重构 TouchSocket 实现 * refactor: 整理项目文件 * wip: 临时移除稍后再开分支合并到另外分支上 * chore: bump version 9.7.4-beta08 Co-Authored-By: 若汝棋茗 <[email protected]> --------- Co-authored-by: 若汝棋茗 <[email protected]>
1 parent 0df17f5 commit d4d76e4

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/BootstrapBlazor/BootstrapBlazor.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<Version>9.7.4-beta09</Version>
4+
<Version>9.7.4-beta08</Version>
55
</PropertyGroup>
66

77
<ItemGroup>

src/BootstrapBlazor/Services/TcpSocket/DefaultTcpSocketClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace BootstrapBlazor.Components;
1313

1414
[UnsupportedOSPlatform("browser")]
15-
class DefaultTcpSocketClient(IPEndPoint endPoint) : ITcpSocketClient
15+
sealed class DefaultTcpSocketClient(IPEndPoint endPoint) : ITcpSocketClient
1616
{
1717
private TcpClient? _client;
1818
private IDataPackageHandler? _dataPackageHandler;

src/BootstrapBlazor/Services/TcpSocket/DefaultTcpSocketFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace BootstrapBlazor.Components;
1313

1414
[UnsupportedOSPlatform("browser")]
15-
class DefaultTcpSocketFactory(IServiceProvider provider) : ITcpSocketFactory
15+
sealed class DefaultTcpSocketFactory(IServiceProvider provider) : ITcpSocketFactory
1616
{
1717
private readonly ConcurrentDictionary<string, ITcpSocketClient> _pool = new();
1818

0 commit comments

Comments
 (0)