webSocket
This commit is contained in:
+8
-6
@@ -89,11 +89,13 @@ public class WebSocket {
|
||||
public void pushMessage(String message) {
|
||||
try {
|
||||
for (WebSocket ws : webSockets) {
|
||||
try {
|
||||
ws.session.getBasicRemote().sendText(message);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
continue;
|
||||
synchronized (ws.session){
|
||||
try {
|
||||
ws.session.getBasicRemote().sendText(message);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
@@ -152,4 +154,4 @@ public class WebSocket {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user