mirror of
https://github.com/RRQM/TouchSocket.git
synced 2025-12-17 17:06:45 +08:00
fix(TcpCore): 修复发送数据未切片问题 (#85)
* fix(TcpCore): 修复发送数据未切片问题 * refactor: 精简代码使用 range 语法
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user