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