Fix packet identifier which is sent from the server.

This commit is contained in:
Christian
2018-03-25 14:41:12 +02:00
parent 447b2aa2c6
commit 7a9ddfc2b5
14 changed files with 100 additions and 79 deletions
@@ -53,10 +53,10 @@ namespace MQTTnet.Server
var connectReturnCode = ValidateConnection(connectPacket);
if (connectReturnCode != MqttConnectReturnCode.ConnectionAccepted)
{
await clientAdapter.SendPacketsAsync(_options.DefaultCommunicationTimeout, cancellationToken, new MqttConnAckPacket
await clientAdapter.SendPacketsAsync(_options.DefaultCommunicationTimeout, cancellationToken, new[] { new MqttConnAckPacket
{
ConnectReturnCode = connectReturnCode
}).ConfigureAwait(false);
}}).ConfigureAwait(false);
return;
}
@@ -64,11 +64,11 @@ namespace MQTTnet.Server
var result = await GetOrCreateClientSessionAsync(connectPacket).ConfigureAwait(false);
clientSession = result.Session;
await clientAdapter.SendPacketsAsync(_options.DefaultCommunicationTimeout, cancellationToken, new MqttConnAckPacket
await clientAdapter.SendPacketsAsync(_options.DefaultCommunicationTimeout, cancellationToken, new[] { new MqttConnAckPacket
{
ConnectReturnCode = connectReturnCode,
IsSessionPresent = result.IsExistingSession
}).ConfigureAwait(false);
}}).ConfigureAwait(false);
ClientConnectedCallback?.Invoke(new ConnectedMqttClient
{