mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-30 10:42:48 +08:00
fixed packet reader
This commit is contained in:
@@ -19,7 +19,7 @@ namespace MQTTnet.Serializer
|
|||||||
|
|
||||||
while (totalBytesRead < buffer.Length)
|
while (totalBytesRead < buffer.Length)
|
||||||
{
|
{
|
||||||
var bytesRead = await channel.ReadAsync(buffer, 0, buffer.Length - totalBytesRead, cancellationToken).ConfigureAwait(false);
|
var bytesRead = await channel.ReadAsync(buffer, totalBytesRead, buffer.Length - totalBytesRead, cancellationToken).ConfigureAwait(false);
|
||||||
if (bytesRead <= 0)
|
if (bytesRead <= 0)
|
||||||
{
|
{
|
||||||
if (cancellationToken.IsCancellationRequested)
|
if (cancellationToken.IsCancellationRequested)
|
||||||
|
|||||||
Reference in New Issue
Block a user