fix 修复 多线程对同一个session发送ws消息报错问题

2.X
疯狂的狮子Li 5 months ago
parent 678e20f2ec
commit 8acff0a698

@ -113,7 +113,7 @@ public class WebSocketUtils {
* @param session WebSocket
* @param message WebSocket
*/
private static void sendMessage(WebSocketSession session, WebSocketMessage<?> message) {
private synchronized static void sendMessage(WebSocketSession session, WebSocketMessage<?> message) {
if (session == null || !session.isOpen()) {
log.warn("[send] session会话已经关闭");
} else {

Loading…
Cancel
Save