code: public void onClose(final Session session) {
          final Optional<SynchronizeFXWebsocketChannel> channel;
          synchronized (channels) {
              channel = getChannel(session);
              clients.remove(session);
          }
  
          // Maybe this is the response for a server side close.
          if (channel.isPresent()) {
              channel.get().connectionCloses(session);
          }
      }
docs: Pass {@link OnClose} events of the Websocket API to this method to handle the event of a disconnected client.
  
  @param session The client that has disconnected.
  @throws IllegalArgumentException If the client passed as argument isn't registered in any channel.