fixed rebase

This commit is contained in:
JanEggers
2018-06-16 17:20:00 +02:00
parent c758ae89f4
commit 7a7fab0907
2 changed files with 37 additions and 33 deletions
@@ -48,7 +48,8 @@ namespace MQTTnet.AspNetCore
while (!cancellationToken.IsCancellationRequested)
{
ReadResult readResult;
ReadingPacketStarted?.Invoke(this, EventArgs.Empty);
var readTask = input.ReadAsync(cancellationToken);
if (readTask.IsCompleted)
{
@@ -84,6 +85,7 @@ namespace MQTTnet.AspNetCore
// We mark examined as buffer.End so that if we didn't receive a full frame, we'll wait for more data
// before yielding the read again.
input.AdvanceTo(consumed, observed);
ReadingPacketCompleted?.Invoke(this, EventArgs.Empty);
}
}
@@ -106,6 +108,10 @@ namespace MQTTnet.AspNetCore
}
private int messageId;
public event EventHandler ReadingPacketStarted;
public event EventHandler ReadingPacketCompleted;
public Task PublishAsync(MqttPublishPacket packet)
{
if (!packet.PacketIdentifier.HasValue && packet.QualityOfServiceLevel > MQTTnet.Protocol.MqttQualityOfServiceLevel.AtMostOnce)