fix(TcpCore): 修复发送数据未切片问题 (#85)

* fix(TcpCore): 修复发送数据未切片问题

* refactor: 精简代码使用 range 语法
This commit is contained in:
Argo Zhang
2025-09-23 11:55:32 +08:00
committed by GitHub
parent 783410c339
commit 73660592eb

View File

@@ -420,7 +420,7 @@ internal sealed class TcpCore : DisposableObject
var offset = 0;
while (length > 0 && !this.m_cancellationToken.IsCancellationRequested)
{
var result = await this.m_socketSender.SendAsync(this.m_socket, memory).ConfigureAwait(EasyTask.ContinueOnCapturedContext);
var result = await this.m_socketSender.SendAsync(this.m_socket, memory[offset..]).ConfigureAwait(EasyTask.ContinueOnCapturedContext);
if (result.SocketError != null)
{
throw result.SocketError;