This commit is contained in:
wangliwen 2022-07-28 10:44:11 +08:00
parent 5eb0184bd4
commit ee1d2550d3
1 changed files with 5 additions and 5 deletions

View File

@ -76,10 +76,10 @@ public class WebSocketServer {
* @param message 消息内容 * @param message 消息内容
*/ */
public void sendMessage(Long userId, MessageData<?> message) { public void sendMessage(Long userId, MessageData<?> message) {
servers.values().forEach(info -> { servers.values().stream()
if (userId.equals(info.getUserId())) { .filter(index -> userId.equals(index.getUserId()))
sendMessage(info.getSession(), message); .forEach(index -> {
} sendMessage(index.getSession(), message);
}); });
} }