mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-18 18:43:10 +08:00
Merge branch 'master' into interceptor-undelivered
This commit is contained in:
@@ -127,7 +127,14 @@ namespace MQTTnet.Implementations
|
||||
// Workaround for: https://github.com/dotnet/corefx/issues/24430
|
||||
using (cancellationToken.Register(Dispose))
|
||||
{
|
||||
return await _stream.ReadAsync(buffer, offset, count, cancellationToken).ConfigureAwait(false);
|
||||
var stream = _stream;
|
||||
|
||||
if (stream == null)
|
||||
{
|
||||
throw new ObjectDisposedException(nameof(stream));
|
||||
}
|
||||
|
||||
return await stream.ReadAsync(buffer, offset, count, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
catch (ObjectDisposedException)
|
||||
@@ -157,7 +164,14 @@ namespace MQTTnet.Implementations
|
||||
// Workaround for: https://github.com/dotnet/corefx/issues/24430
|
||||
using (cancellationToken.Register(Dispose))
|
||||
{
|
||||
await _stream.WriteAsync(buffer, offset, count, cancellationToken).ConfigureAwait(false);
|
||||
var stream = _stream;
|
||||
|
||||
if (stream == null)
|
||||
{
|
||||
throw new ObjectDisposedException(nameof(stream));
|
||||
}
|
||||
|
||||
await stream.WriteAsync(buffer, offset, count, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
catch (ObjectDisposedException)
|
||||
|
||||
Reference in New Issue
Block a user