Back to project page android_opengles.
The source code is released under:
MIT License
If you think the Android project android_opengles listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package fi.iki.elonen; // w w w. j a va 2s . c o m import java.io.IOException; public class ServerRunner { public static void run(Class serverClass) { try { executeInstance((NanoHTTPD) serverClass.newInstance()); } catch (Exception e) { e.printStackTrace(); } } public static void executeInstance(NanoHTTPD server) { try { server.start(); } catch (IOException ioe) { System.err.println("Couldn't start server:\n" + ioe); System.exit(-1); } System.out.println("Server started, Hit Enter to stop.\n"); try { System.in.read(); } catch (Throwable ignored) { } // server.stop(); // System.out.println("Server stopped.\n"); } }