Fixing AMQ-4892: MQTT clients disconnecting due to socket error do not publish the configured last will and testament message.

This commit is contained in:
Hiram Chirino 2013-11-15 15:51:15 -05:00
parent a46db89b2a
commit 030c2cca31
1 changed files with 4 additions and 3 deletions

View File

@ -126,9 +126,6 @@ public class MQTTInactivityMonitor extends TransportFilter {
}
ASYNC_TASKS.execute(new Runnable() {
public void run() {
if (protocolConverter != null) {
protocolConverter.onTransportError();
}
onException(new InactivityIOException("Channel was inactive for too (>" + readCheckTime + ") long: " + next.getRemoteAddress()));
}
});
@ -172,6 +169,10 @@ public class MQTTInactivityMonitor extends TransportFilter {
public void onException(IOException error) {
if (failed.compareAndSet(false, true)) {
stopMonitorThread();
if (protocolConverter != null) {
protocolConverter.onTransportError();
}
protocolConverter.onTransportError();
transportListener.onException(error);
}
}