mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-16 17:23:04 +08:00
renaming and added cast
This commit is contained in:
@@ -561,7 +561,7 @@ namespace MQTTnet.Client
|
||||
{
|
||||
await SendAsync(new MqttPingRespPacket(), cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
else if (packet is MqttDisconnectPacket disc)
|
||||
else if (packet is MqttDisconnectPacket disconnectPacket)
|
||||
{
|
||||
// Also dispatch disconnect to waiting threads to generate a proper exception.
|
||||
_packetDispatcher.Dispatch(packet);
|
||||
@@ -569,7 +569,7 @@ namespace MQTTnet.Client
|
||||
await DisconnectAsync(new MqttClientDisconnectOptions()
|
||||
{
|
||||
// todo conversion
|
||||
ReasonCode = disc.ReasonCode
|
||||
ReasonCode = (MqttClientDisconnectReason)(disconnectPacket.ReasonCode ?? MqttDisconnectReasonCode.UnspecifiedError)
|
||||
}, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
else if (packet is MqttAuthPacket authPacket)
|
||||
|
||||
@@ -391,9 +391,9 @@ namespace MQTTnet.Server
|
||||
_connections.AddOrUpdate(connectPacket.ClientId, key =>
|
||||
{
|
||||
return connection;
|
||||
}, (key, tempexistingConnection) =>
|
||||
}, (key, tempExistingConnection) =>
|
||||
{
|
||||
existingConnection = tempexistingConnection;
|
||||
existingConnection = tempExistingConnection;
|
||||
return connection;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user