09-12-netty发送房间确认信息逻辑优化
This commit is contained in:
@ -425,14 +425,17 @@ public class ChatServerHandler extends SimpleChannelInboundHandler<TextWebSocket
|
|||||||
if (channelHandlerContexts == null||channelHandlerContexts.isEmpty()){
|
if (channelHandlerContexts == null||channelHandlerContexts.isEmpty()){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (ChannelHandlerContext channelHandlerContext : channelHandlerContexts) {
|
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
jsonObject.put("type", "5");
|
jsonObject.put("type", "5");
|
||||||
jsonObject.put("roomInfo", chatGroup);
|
jsonObject.put("roomInfo", chatGroup);
|
||||||
|
|
||||||
|
for (ChannelHandlerContext channelHandlerContext : channelHandlerContexts) {
|
||||||
sendMessage(channelHandlerContext, String.valueOf(jsonObject));
|
sendMessage(channelHandlerContext, String.valueOf(jsonObject));
|
||||||
|
}
|
||||||
|
|
||||||
log.info("发送房间创建确认消息:{}",jsonObject);
|
log.info("发送房间创建确认消息:{}",jsonObject);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user