Fixed bug in deletion of valid conn descriptor once different clients with same ID connects (issues #116 and #124)
This commit is contained in:
@@ -73,4 +73,20 @@ public class NettyChannel implements ServerChannel {
|
||||
String clientID = (String) getAttribute(ATTR_KEY_CLIENTID);
|
||||
return "session [clientID: "+ clientID +"]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
NettyChannel that = (NettyChannel) o;
|
||||
|
||||
return !(m_channel != null ? !m_channel.channel().equals(that.m_channel.channel()) : that.m_channel != null);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return m_channel != null ? m_channel.channel().hashCode() : 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ public class NettyMQTTHandler extends ChannelInboundHandlerAdapter {
|
||||
if (stolenAttr != null && stolenAttr == Boolean.TRUE) {
|
||||
stolen = stolenAttr;
|
||||
}
|
||||
m_processor.processConnectionLost(clientID, stolen);
|
||||
m_processor.processConnectionLost(clientID, stolen, new NettyChannel(ctx));
|
||||
}
|
||||
ctx.close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user