Skip to content

Commit 29298c9

Browse files
committed
refactor: 根据最新设计更改实现类
1 parent 8b42331 commit 29298c9

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/extensions/BootstrapBlazor.TouchSocket/Services/DefaultTcpSocketClient.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ public void SetDataHandler(IDataPackageHandler handler)
4242
_dataPackageHandler = handler;
4343
}
4444

45-
public Task<bool> ConnectAsync(string host, int port, CancellationToken token = default)
45+
public ValueTask<bool> ConnectAsync(string host, int port, CancellationToken token = default)
4646
{
4747
var endPoint = new IPEndPoint(GetIPAddress(host), port);
4848
return ConnectAsync(endPoint, token);
4949
}
5050

51-
public async Task<bool> ConnectAsync(IPEndPoint endPoint, CancellationToken token = default)
51+
public async ValueTask<bool> ConnectAsync(IPEndPoint endPoint, CancellationToken token = default)
5252
{
5353
var ret = false;
5454
try
@@ -78,7 +78,7 @@ public async Task<bool> ConnectAsync(IPEndPoint endPoint, CancellationToken toke
7878
return ret;
7979
}
8080

81-
public async Task<bool> SendAsync(Memory<byte> data, CancellationToken token = default)
81+
public async ValueTask<bool> SendAsync(ReadOnlyMemory<byte> data, CancellationToken token = default)
8282
{
8383
if (_client is not { Connected: true })
8484
{

0 commit comments

Comments
 (0)