title: websocket send message from the server to all clients
body: <p>I want to send a message to all active clients.</p>
  
  <pre><code>@OnMessage
  public void onMessage(String message, Session session) {
      switch (message) {
      case "latencyEqualize":
  
          for (Session otherSession : session.getOpenSessions()) {
              RemoteEndpoint.Basic other = otherSession.getBasicRemote();
              String data = "Max latency = "
                      + LatencyEqualizer.getMaxLatency(latencies);            
              try {
                  other.sendText(data);
              } catch (IOException e) {
                  throw new RuntimeException(e);
              }
          }
          break;
      default:
  
          RemoteEndpoint.Basic other = session.getBasicRemote();          
          try {
              other.sendText(message);
          } catch (IOException e) {
              throw new RuntimeException(e);
          }
      }
  }
  </code></pre>
  
  <p>Something is wrong with this code. When i send message "latencyEqualize" from the first client the server answers only to the same client. Other clients don't receive message "Max latency = 15". But when the second client sends to server any message, he recieves back "Max latency = 15". And all future calls to server return the message from previous call.</p>
  
  <p>Is there a way to avoid this. I want all clients get "Max latency" message when one of them send "latencyEqualize" message to the server.</p>