private static void sendDebuggerPort(
     Socket socket, ServerSocket serverSocket, IPyDebugProcess processHandler) throws IOException {
   int port = processHandler.handleDebugPort(serverSocket.getLocalPort());
   PrintWriter writer = new PrintWriter(socket.getOutputStream());
   writer.println(99 + "\t" + -1 + "\t" + port);
   writer.flush();
   socket.close();
 }
 private void writeToConsole(PyIo io) {
   ConsoleViewContentType contentType;
   if (io.getCtx() == 2) {
     contentType = ConsoleViewContentType.ERROR_OUTPUT;
   } else {
     contentType = ConsoleViewContentType.NORMAL_OUTPUT;
   }
   myDebugProcess.printToConsole(io.getText(), contentType);
 }
  // todo: change variable in lists doesn't work - either fix in pydevd or format var name
  // appropriately
  private void setTempVariable(
      final String threadId, final String frameId, final PyDebugValue var) {
    final PyDebugValue topVar = var.getTopParent();
    if (!myDebugProcess.canSaveToTemp(topVar.getName())) {
      return;
    }
    if (myTempVars.contains(threadId, frameId, topVar.getTempName())) {
      return;
    }

    topVar.setTempName(generateTempName());
    try {
      doChangeVariable(threadId, frameId, topVar.getTempName(), topVar.getName());
      myTempVars.put(threadId, frameId, topVar.getTempName());
    } catch (PyDebuggerException e) {
      LOG.error(e);
      topVar.setTempName(null);
    }
  }