/** called when the socket is closed */
 @Override
 public void quit() {
   if (subscriptionId == -1) return;
   CommandHistoryRequestManager chrm = processor.getCommandHistoryManager();
   if (chrm != null) {
     chrm.unsubscribeCommandHistory(subscriptionId);
   }
 }
  public void switchYProcessor(YProcessor c) throws YProcessorException {
    if (subscriptionId == -1) return;

    CommandHistoryRequestManager chrm = processor.getCommandHistoryManager();
    CommandHistoryFilter filter = null;
    if (chrm != null) {
      filter = chrm.unsubscribeCommandHistory(subscriptionId);
    }

    this.processor = c;

    if (processor.hasCommanding()) {
      chrm = processor.getCommandHistoryManager();
      if (filter != null) {
        chrm.addSubscription(filter, this);
      } else {
        chrm.subscribeCommandHistory(null, 0, this);
      }
    }
  }