for (SocketAddress address : tries) { try { if ((myBoundAddress = connection.connect(address)) != null) { logger.info("Started torrent tracker on {}", address); started = true;
final SocketAddress socketAddr = connection.connect(listen, context); container.onServerStart();
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); }
/** * 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; }
public void start() throws Exception { try { logger.debug("Starting redirect server"); connection.connect(address); } finally { logger.debug("Started redirect server"); } }
@Override public void start() throws Exception { try { logger.debug("Starting basic auth server"); connection.connect(address); } finally { logger.debug("Started basic auth server"); } }
public void start() throws Exception { try { logger.debug("Starting redirect server"); connection.connect(address); } finally { logger.debug("Started redirect server"); } }
/** * 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); }
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); }
/** * 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); }
Connection connection = new SocketConnection(server); connection.connect(listen, context);
@Override protected void _start() throws Exception { logger.debug("starting web server"); router = setupRouter(); Container container = new Container() { @Override public void handle(Request request, Response response) { try { if (request.getTarget().startsWith(routerPath)) { router.route( new SimpleRestxRequest(httpSettings, routerPath, request), new SimpleRestxResponse(response)); } else { response.getPrintStream().print("Not found..."); response.getPrintStream().close(); } } catch (IOException e) { throw new RuntimeException(e); } } }; Server server = new ContainerServer(container); connection = new SocketConnection(server); SocketAddress address = new InetSocketAddress(port); connection.connect(address); }
@Override protected void _start() throws Exception { logger.debug("starting web server"); router = setupRouter(); Container container = new Container() { @Override public void handle(Request request, Response response) { try { if (request.getTarget().startsWith(routerPath)) { router.route( new SimpleRestxRequest(httpSettings, routerPath, request), new SimpleRestxResponse(response)); } else { response.getPrintStream().print("Not found..."); response.getPrintStream().close(); } } catch (IOException e) { throw new RuntimeException(e); } } }; Server server = new ContainerServer(container); connection = new SocketConnection(server); SocketAddress address = new InetSocketAddress(port); connection.connect(address); }
private String startMockServer(Container container) throws IOException { ContainerServer server = new ContainerServer(container); connection = new SocketConnection(server); InetSocketAddress address = (InetSocketAddress) connection .connect(new InetSocketAddress(0)); int port = address.getPort(); return "http://localhost:" + port + "/"; }
public void start() throws IOException { server = new FixdServer(new ContainerServer(container)); connection = new SocketConnection(server, new LoggingAgent()); SocketAddress address = new InetSocketAddress(port); actualConnectionAddress = (InetSocketAddress)connection.connect(address); }
/** * Opens the HTTP server * @throws IOException */ public void start() throws IOException { stop(); this.server = new ContainerServer(this); this.connection = new SocketConnection(server); SocketAddress address = new InetSocketAddress(this.port); this.connection.connect(address); }
setConnection(connection); InetSocketAddress address = (InetSocketAddress)getConnection().connect(getAddress()); setEphemeralPort(address.getPort()); super.start();
connection = new SocketConnection(server); InetSocketAddress address = (InetSocketAddress) connection .connect(new InetSocketAddress(0)); int port = address.getPort(); String url = "http://localhost:" + port + "/";