/** * Starts the server (in setDaemon(true) mode). */ public void start(final int timeout) throws IOException { start(timeout, true); }
/** * Start the server. * * @throws IOException * if the socket is in use. */ public void start() throws IOException { start(NanoHTTPD.SOCKET_READ_TIMEOUT); }
public static void executeInstance(NanoHTTPD server) { try { server.start(NanoHTTPD.SOCKET_READ_TIMEOUT, false); } 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"); }
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"); } }
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"); } }
server.start(); servers.put(url, server); } catch (IOException e) {
public void start() throws IOException { if (super.isAlive()) { //kill the server if its already running try { super.stop(); } catch (Exception e) { //ignore the exception } } try { super.start(NanoHTTPD.SOCKET_READ_TIMEOUT, false); } catch (SocketException e) { throw new IllegalStateException("The application under test must require android.permission.INTERNET " + "permission in its manifest", e); } logger.info(String.format("\nRunning Appium Espresso Server at port %d \n", DEFAULT_PORT)); router = new Router(); }
server.start(NanoHTTPD.SOCKET_READ_TIMEOUT, asDeamon.getValue()); servers.put(url, server); if (!asDeamon.getValue()) {