Skip to content

Commit

Permalink
probable race condition?..
Browse files Browse the repository at this point in the history
  • Loading branch information
Oshi41 committed Dec 8, 2024
1 parent b896242 commit 5cb1ed3
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions source/NetCoreServer/TcpSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -338,16 +338,16 @@ public virtual bool SendAsync(ReadOnlySpan<byte> buffer)

// Update statistic
BytesPending = _sendBufferMain.Size;

// Avoid multiple send handlers
if (_sending)
return true;
else
_sending = true;

// Try to send the main buffer
TrySend();
}

// Avoid multiple send handlers
if (_sending)
return true;

_sending = true;

// Try to send the main buffer
TrySend();

return true;
}
Expand Down

0 comments on commit 5cb1ed3

Please sign in to comment.