@Override
 public void disconnect() {
   for (ProcessDebugger d : allDebuggers()) {
     d.disconnect();
   }
   disposeAcceptor();
 }
  @Override
  public void waitForConnect() throws Exception {
    try {
      //noinspection SocketOpenedButNotSafelyClosed
      final Socket socket = myServerSocket.accept();

      ApplicationManager.getApplication()
          .executeOnPooledThread(
              new Runnable() {
                @Override
                public void run() {
                  try {
                    // do we need any synchronization here with myMainDebugger.waitForConnect() ???
                    // TODO
                    sendDebuggerPort(socket, myDebugServerSocket, myDebugProcess);
                  } catch (Exception e) {
                    throw new RuntimeException(e);
                  }
                }
              });

      myMainDebugger.waitForConnect();

      disposeAcceptor();

      myDebugProcessAcceptor = new DebuggerProcessAcceptor(this, myServerSocket);
      ApplicationManager.getApplication().executeOnPooledThread(myDebugProcessAcceptor);
    } finally {

    }
  }
  @Override
  public void close() {
    for (ProcessDebugger d : allDebuggers()) {
      d.close();
    }
    disposeAcceptor();

    if (!myServerSocket.isClosed()) {
      try {
        myServerSocket.close();
      } catch (IOException e) {
        LOG.warn("Error closing socket", e);
      }
    }
  }