for (SocketAddress address : tries) { try { if ((myBoundAddress = connection.connect(address)) != null) { logger.info("Started torrent tracker on {}", address); started = true;
@Override public void close() throws IOException { container.onServerStop(); analyzer.stop(); connection.close(); }
/** * Starts proxy. * * @throws IOException In case starting fails. */ public void start() throws IOException { // Close existing connection if it exists. if (connection != null) { connection.close(); } proxy = new ProxyImplementation(); connection = new SocketConnection(proxy); final SocketAddress address = new InetSocketAddress(port); connection.connect(address); LOGGER.debug("Started on port: " + port); }
final SocketAddress socketAddr = connection.connect(listen, context); container.onServerStart();
/** * Stop the tracker. * <p> * <p> * This effectively closes the listening HTTP connection to terminate * the service, and interrupts the peer myPeerCollectorThread thread as well. * </p> */ public void stop() { this.stop = true; try { this.connection.close(); logger.info("BitTorrent tracker closed."); } catch (IOException ioe) { logger.error("Could not stop the tracker: {}!", ioe.getMessage()); } if (myPeerCollectorThread != null && myPeerCollectorThread.isAlive()) { myPeerCollectorThread.interrupt(); try { myPeerCollectorThread.join(); } catch (InterruptedException e) { // } logger.info("Peer collection terminated."); } }
protected void initHttp(Connection connection, int port) { SocketAddress address = new InetSocketAddress(port); try { connection.connect(address); } catch (java.net.BindException ex) { throw new RuntimeException("Couldnt bind to port: " + port); } catch (Exception ex) { throw new RuntimeException("Couldnt start connection", ex); } log.info("Simpleton server is now running on: " + address); }
/** * Closes the server. * * @throws IOException In case closing fails. */ public void stop() throws IOException { connection.close(); }
public void stop() throws IOException { if (connection != null) connection.close(); }
/** * Starts the server. * * @return Port used by server. * @throws IOException In case starting fails. */ public int start() throws IOException { handler = new ExpectationHandler(); connection = new SocketConnection(handler); final SocketAddress address = new InetSocketAddress(port); final InetSocketAddress connectedAddress = (InetSocketAddress) connection.connect(address); connectedPort = connectedAddress.getPort(); return connectedPort; }
@Override protected void _stop() throws Exception { if (router instanceof AutoCloseable) { ((AutoCloseable) router).close(); } connection.close(); connection = null; }
public void start() throws Exception { try { logger.debug("Starting redirect server"); connection.connect(address); } finally { logger.debug("Started redirect server"); } }
/** * Stops proxy. * * @throws IOException In case closing connection fails. */ public void stop() throws IOException { LOGGER.debug("Stopping and closing connection."); connection.close(); } }
@Override public void start() throws Exception { try { logger.debug("Starting basic auth server"); connection.connect(address); } finally { logger.debug("Started basic auth server"); } }
@Override protected void _stop() throws Exception { if (router instanceof AutoCloseable) { ((AutoCloseable) router).close(); } connection.close(); connection = null; }
public void start() throws Exception { try { logger.debug("Starting redirect server"); connection.connect(address); } finally { logger.debug("Started redirect server"); } }
public static void stop() { try { connection.close(); } catch (Throwable e) { SDFSLogger.getLog().error("unable to stop Web Management Server", e); } }
/** * Starts the server * @param port port of the server * @throws Exception */ public void start(int port) throws Exception { ServerLyzer.port = port; Container container = new ServerLyzer(config); Server server = new ContainerServer(container); this.connection = new SocketConnection(server); SocketAddress address = new InetSocketAddress(port); System.out.println("Starting server on port "+port); this.connection.connect(address); }
/** * Stops the server */ public void stop() { System.out.println("Shutting down server on port "+ServerLyzer.port); try { this.connection.close(); } catch (IOException ex) { Logger.getLogger(ServerLyzer.class.getName()).log(Level.SEVERE, null, ex); } catch (Exception ex) { Logger.getLogger(ServerLyzer.class.getName()).log(Level.SEVERE, null, ex); } } }
public void start(InetSocketAddress bindAddress, int poolSize) throws Exception { executor = Executors.newFixedThreadPool(poolSize); container = new HttpServer(); server = new ContainerServer(container); connection = new SocketConnection(server); SocketAddress address = bindAddress; connection.connect(address); }