Skip to content

Commit 4f53ac6

Browse files
authored
Merge branch 'master' into perfAuto
2 parents 77514f2 + b2963ca commit 4f53ac6

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

iothub/device/src/Transport/Mqtt/MqttIotHubAdapter.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public override async Task WriteAsync(IChannelHandlerContext context, object dat
143143
{
144144
if (this.IsInState(StateFlags.Closed))
145145
{
146-
return;
146+
throw new IotHubCommunicationException("MQTT is disconnected.");
147147
}
148148

149149
var message = data as Message;
@@ -534,11 +534,6 @@ async void ProcessMessage(IChannelHandlerContext context, Packet packet)
534534
{
535535
if (Logging.IsEnabled) Logging.Enter(this, context.Name, packet.PacketType, nameof(ProcessMessage));
536536

537-
if (this.IsInState(StateFlags.Closed))
538-
{
539-
return;
540-
}
541-
542537
try
543538
{
544539
switch (packet.PacketType)
@@ -622,7 +617,7 @@ void ProcessPublish(IChannelHandlerContext context, PublishPacket packet)
622617

623618
if (this.IsInState(StateFlags.Closed))
624619
{
625-
return;
620+
throw new IotHubCommunicationException("MQTT is disconnected.");
626621
}
627622

628623
switch (packet.QualityOfService)

0 commit comments

Comments
 (0)