void () { try (Socket accept = socket.accept(); DataInputStream stream = new DataInputStream(accept.getInputStream())) { int read = stream.readInt(); while (read != -1) { final DebugProcess process = DebuggerManager.getInstance(environment.getProject()).getDebugProcess(res.getProcessHandler()); if (process == null) break; final RemoteConnection connection = new RemoteConnection(true, "127.0.0.1", String.valueOf(read), true); final DebugEnvironment env = new DefaultDebugEnvironment(environment, state, connection, true); ((DebugProcessImpl)process).reattach(env, false, () -> { try { accept.getOutputStream().write(0); } catch (Exception e) { e.printStackTrace(); } }); read = stream.readInt(); } } catch (EOFException ignored) {} catch (IOException e) { e.printStackTrace(); } }