Refactor thread management for incoming packets.

This commit is contained in:
Christian Kratky
2018-06-04 22:19:07 +02:00
parent afe25db0d3
commit 39edd22a9d
8 changed files with 31 additions and 81 deletions
@@ -135,9 +135,10 @@ namespace MQTTnet.Adapter
{
var fixedHeader = await MqttPacketReader.ReadFixedHeaderAsync(channel, cancellationToken).ConfigureAwait(false);
ReadingPacketStarted?.Invoke(this, EventArgs.Empty);
try
{
ReadingPacketStarted?.Invoke(this, EventArgs.Empty);
var bodyLength = await MqttPacketReader.ReadBodyLengthAsync(channel, cancellationToken).ConfigureAwait(false);
if (bodyLength == 0)
{