code: protected void unregister(IConnection conn, boolean deleteIfNoConns) {
          log.debug("Unregister connection ({}:{}) client id: {}", conn.getRemoteAddress(), conn.getRemotePort(), id);
          // remove connection from connected scopes list
          connections.remove(conn);
          // If client is not connected to any scope any longer then remove
          if (deleteIfNoConns && connections.isEmpty()) {
              // TODO DW dangerous the way this is called from BaseConnection.initialize(). Could we unexpectedly pop a Client out of the registry?
              removeInstance();
          }
      }
docs: Removes client-connection association for given connection
  
  @param conn
  Connection object
  @param deleteIfNoConns
  Whether to delete this client if it no longer has any connections