Skip to content
Snippets Groups Projects
Commit ddd67e9d authored by Davide Pianca's avatar Davide Pianca
Browse files

Fix onDisconnect client callback call on broker termination

parent d7572fbd
No related branches found
No related tags found
No related merge requests found
......@@ -329,7 +329,13 @@ public class MQTTClient(
}
}
val data = socket?.read()
val data = try {
socket?.read()
} catch (e: Exception) {
close()
onDisconnected(null)
throw e
}
if (data != null) {
try {
......@@ -341,7 +347,6 @@ public class MQTTClient(
}
} catch (e: MQTTException) {
lastException = e
e.printStackTrace()
disconnect(e.reasonCode)
close()
onDisconnected(null)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment