|
|
|
@ -82,6 +82,7 @@ public class MessageWebSocket {
|
|
|
|
|
public static void sendMessage(Long userId, String message){
|
|
|
|
|
try {
|
|
|
|
|
MessageWebSocket websocket = webSocketSet.get(userId);
|
|
|
|
|
synchronized (websocket){
|
|
|
|
|
if(websocket != null) {
|
|
|
|
|
if (message.equals("heartBit")) {
|
|
|
|
|
websocket.session.getBasicRemote().sendText(message + "=" + sendCount);
|
|
|
|
@ -90,6 +91,7 @@ public class MessageWebSocket {
|
|
|
|
|
websocket.session.getBasicRemote().sendText(message);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|