...
This commit is contained in:
parent
5eb0184bd4
commit
ee1d2550d3
|
@ -76,10 +76,10 @@ public class WebSocketServer {
|
|||
* @param message 消息内容
|
||||
*/
|
||||
public void sendMessage(Long userId, MessageData<?> message) {
|
||||
servers.values().forEach(info -> {
|
||||
if (userId.equals(info.getUserId())) {
|
||||
sendMessage(info.getSession(), message);
|
||||
}
|
||||
servers.values().stream()
|
||||
.filter(index -> userId.equals(index.getUserId()))
|
||||
.forEach(index -> {
|
||||
sendMessage(index.getSession(), message);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue