Hi. Broadcasting uses connections without synchronization:
/**
* Send a text to all connected endpoints
* @param text the text to send to the endpoints
*/
public void broadcast(String text) {
broadcast( text, connections );
}
even trying to override this method with:
override void broadcast(String: text) = {
broadcast( text, getConnections() );
}
will lead to
java.util.ConcurrentModificationException: null
at java.util.HashMap$HashIterator.nextNode(HashMap.java:1445)
at java.util.HashMap$KeyIterator.next(HashMap.java:1469)
at java.util.AbstractCollection.toArray(AbstractCollection.java:141)
at java.util.ArrayList.<init>(ArrayList.java:178)
at org.java_websocket.server.WebSocketServer.getConnections(WebSocketServer.java:282)
Hi. Broadcasting uses connections without synchronization:
even trying to override this method with:
will lead to