blic boolean isConnected() {
    return myConnected;
  }


  @Override
  public void waitForConnect() throws Exception {
    try {
      //noinspection SocketOpenedButNotSafelyClosed
      myServerSocket.setSoTimeout(myConnectionTimeout);
      synchronized (mySocketObject) {
        mySocket = myServerSocket.accept();
        myConnected = true;
      }
    }
    finally {
      //it is closed in close() method on process termination
    }

    if (myConnected) {
      try {
        myDebuggerReader = createReader();
      }
      catch (Exception e) {
        synchronized (mySocketObject) {
          mySocket.close();
        }
        throw e;
      }
    }
  }

  @Override
  public String handshake() throws PyDebuggerException {
    final VersionCommand command = new VersionCommand(this, LOCAL_VERSION, SystemInfo.isUnix ? "UNIX" : "WIN");
    command.execute();
    String version = command.getRemoteVersion();
    if (version != null) {
      version = version.trim();
    }
    return version;
  }

  @Over