code: ServerSessionManager unregisterConnection(Connection connection) {
      Iterator<Map.Entry<String, Connection>> iterator = connections.entrySet().iterator();
      while (iterator.hasNext()) {
        Map.Entry<String, Connection> entry = iterator.next();
        if (entry.getValue().equals(connection)) {
          ServerSessionContext session = clients.get(entry.getKey());
          if (session != null) {
            session.setConnection(null);
          }
          iterator.remove();
        }
      }
      return this;
    }
docs: Unregisters a connection.