https://run-jetty-run.googlecode.com/svn-history/r280/Jetty8Support/bootstrap-jetty8/src/runjettyrun/Bootstrap.java
private static void initEclipseListener(final Configs configs){//init eclipse hookif(configs.getEclipseListenerPort() != -1 ){Thread eclipseListener = new Thread(){public void run() {try {while(true){Thread.sleep(5000L);Socket sock = new Socket("127.0.0.1", configs.getEclipseListenerPort());byte[] response = new byte[4];sock.getInputStream().read(response);//@see runjettyrun.Plugin#enableListenterif(response[0] ==1 && response[1] ==2){//it's ok!}else{//Eclipse crashsshutdownServer();}}} catch (UnknownHostException e) {System.err.println("lost connection with Eclipse , shutting down.");shutdownServer();} catch (IOException e) {System.err.println("lost connection with Eclipse , shutting down.");shutdownServer();} catch (InterruptedException e) {System.err.println("lost connection with Eclipse , shutting down.");shutdownServer();}};};eclipseListener.start();}}private static void shutdownServer(){try {server.stop();System.exit(-1);} catch (Exception e1) {e1.printStackTrace();}}