求解下websocket的消息通道
快乐风男� 2021-03-24 04:41:54 for (Map.Entry<String, Channel> channel : webSocketClientMaps.entrySet()) {
if (channel.getValue() == null || !channel.getValue().isOpen() || channel.getValue() == ctx.channel()) {
continue;
}
if (startsWith) {
CNNettyUtil.sendDataToTargetChannel(channel.getValue(),
CNNettyUtil.toJson(successSocketResult(jsonObject)));
}
}
}
CNNettyUtil.sendDataToTargetChannel(ctx.channel(),
CNNettyUtil.toJson(successSocketResult(1, success)));
为什么要加一个这个判断 channel.getValue() == ctx.channel() 导致一直跳过