/** * Forcibly closes all connections that are open. */ public synchronized void closeAllConnections() { stop(); }
public void shutdown(ISourceLocation server) { NanoHTTPD nano = servers.get(server); if (nano != null) { //if (nano.isAlive()) { nano.stop(); servers.remove(server); //} } else { throw RuntimeExceptionFactory.illegalArgument(server, null, null, "could not shutdown"); } }
public void shutdown(ISourceLocation server) { NanoHTTPD nano = servers.get(server); if (nano != null) { //if (nano.isAlive()) { nano.stop(); servers.remove(server); //} } else { throw RuntimeExceptionFactory.illegalArgument(server, null, null, "could not shutdown"); } }
@Override protected void finalize() throws Throwable { for (NanoHTTPD server : servers.values()) { if (server != null && server.wasStarted()) { server.stop(); } } }
@Override protected void finalize() throws Throwable { for (NanoHTTPD server : servers.values()) { if (server != null && server.wasStarted()) { server.stop(); } } }
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"); } }
public void stop() { super.stop(); logger.info(String.format("\nStopping Appium Espresso stop at port %d \n", DEFAULT_PORT)); }
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.stop(); servers.remove(url);