[RM] Feature Avoiding 'leaveGroup' call right after channel initialized.
@@ -100,25 +100,17 @@ public abstract class AbstractNettyMulticastClient extends AbstractNettyClient {
@Override
protected void initChannelCloseFuture(AbstractNettySession session, Channel channel) {
- ((DatagramChannel)channel).leaveGroup(multicastGroup, localNetworkInterface).addListener(new ChannelFutureListener() {
- @Override
- public void operationComplete(ChannelFuture future) throws Exception {
- if (!future.isSuccess()) {
- logger.error("Failed to leave multicast group [{}]", multicastGroup);
- }
- channel.close().addListener(new ChannelFutureListener() {
+ channel.closeFuture().addListener(new ChannelFutureListener() {
@Override
public void operationComplete(ChannelFuture future) throws Exception {
if (future.isSuccess()) {
- changeStatus(ServiceStatus.DISPOSED, "", null);
+ changeStatus(ServiceStatus.DISPOSED, "Service disposed", null);
} else {
changeStatus(ServiceStatus.ERROR, "Failed to close channel", future.cause());
}
}
});
}
- });
- }
@Override
protected void initDictionaryData() {
