Package org.eclipse.jetty.server.bio

Examples of org.eclipse.jetty.server.bio.SocketConnector


   * may want to override this to return a SelectChannelConnector.)
   *
   * @return a {@link SocketConnector}
   */
  public Connector getConnector() {
    return new SocketConnector();
  }
View Full Code Here


public class StartSelect2Examples {
    public static void main(String[] args) throws Exception {
  int timeout = (int) Duration.ONE_HOUR.getMilliseconds();

  Server server = new Server();
  SocketConnector connector = new SocketConnector();

  // Set some timeout options to make debugging easier.
  connector.setMaxIdleTime(timeout);
  connector.setSoLingerTime(-1);
  connector.setPort(8080);
  server.addConnector(connector);

  WebAppContext bb = new WebAppContext();
  bb.setServer(server);
  bb.setContextPath("/");
View Full Code Here

    public static void main(final String[] args) throws Exception {
        final int timeout = (int) Duration.ONE_HOUR.getMilliseconds();
       
        final Server server = new Server();
       
        final SocketConnector connector = new SocketConnector();
        connector.setMaxIdleTime(timeout);
        connector.setSoLingerTime(-1);
        connector.setPort(8080);
        server.addConnector(connector);
       
        final WebAppContext bb = new WebAppContext();
        bb.setServer(server);
        bb.setContextPath("/");
View Full Code Here

    {
        final CountDownLatch connectLatch = new CountDownLatch(1);
        final CountDownLatch stopLatch = new CountDownLatch(1);

        Server server = new Server();
        Connector connector = new SocketConnector();
        server.addConnector(connector);
        server.setHandler(new AbstractHandler()
        {
            public void handle(String target, Request request, HttpServletRequest httpRequest, HttpServletResponse httpResponse) throws IOException, ServletException
            {
                request.setHandled(true);
                if (target.endsWith("/connect"))
                {
                    connectLatch.countDown();
                    try
                    {
                        Thread.sleep(10000);
                    }
                    catch (InterruptedException e)
                    {
                        stopLatch.countDown();
                    }
                }
            }
        });
        server.start();
        try
        {
            RHTTPClient client = createClient(connector.getLocalPort(), "test5");
            try
            {
                final CountDownLatch serverLatch = new CountDownLatch(1);
                client.addClientListener(new ClientListener.Adapter()
                {
View Full Code Here

public class Start {
    public static void main(String[] args) throws Exception {
        int timeout = (int) Duration.ONE_HOUR.getMilliseconds();

        Server server = new Server();
        SocketConnector connector = new SocketConnector();

        // Set some timeout options to make debugging easier.
        connector.setMaxIdleTime(timeout);
        connector.setSoLingerTime(-1);
        connector.setPort(8080);
        server.addConnector(connector);

    // check if a keystore for a SSL certificate is available, and
    // if so, start a SSL connector on port 8443. By default, the
    // quickstart comes with a Apache Wicket Quickstart Certificate
    // that expires about half way september 2021. Do not use this
    // certificate anywhere important as the passwords are available
    // in the source.

        Resource keystore = Resource.newClassPathResource("/keystore");
        if (keystore != null && keystore.exists()) {
            connector.setConfidentialPort(8443);

            SslContextFactory factory = new SslContextFactory();
            factory.setKeyStoreResource(keystore);
            factory.setKeyStorePassword("wicket");
            factory.setTrustStore(keystore);
View Full Code Here

    return "brcm-accounts-api";
  }
 
  @Override
  public Connector getConnector() {
    return new SocketConnector();
  }
View Full Code Here

    }

    protected void doStart() throws Exception {
        server = new Server();
        if (connector == null) {
            connector = new SocketConnector();
        }
        connector.setHost(bindAddress.getHost());
        connector.setPort(bindAddress.getPort());
        connector.setServer(server);
        server.setConnectors(new Connector[] {
View Full Code Here

        int n = Integer.parseInt(ns);
        int c = Integer.parseInt(nc);
        int contentLen = Integer.parseInt(cls);

        SocketConnector connector = new SocketConnector();
        connector.setPort(0);
        connector.setRequestBufferSize(12 * 1024);
        connector.setResponseBufferSize(12 * 1024);
        connector.setAcceptors(2);
        connector.setAcceptQueueSize(c);

        QueuedThreadPool threadpool = new QueuedThreadPool();
        threadpool.setMinThreads(c);
        threadpool.setMaxThreads(2000);

        Server server = new Server();
        server.addConnector(connector);
        server.setThreadPool(threadpool);
        server.setHandler(new RandomDataHandler());

        server.start();
        int port = connector.getLocalPort();

        TestHttpAgent[] agents = new TestHttpAgent[] {
                new TestHttpClient3(),
                new TestHttpJRE(),
                new TestHttpCore(),
View Full Code Here

public class JettyUtil {
    private static Server _server;

    public static synchronized void initJetty() throws Exception {
        _server = new Server(8080);
        SocketConnector connector = new SocketConnector();
        _server.addConnector(connector);

        ServletHolder axisServletholder = new ServletHolder(new AxisServlet());
        ServletHolder axisAdminServletholder = new ServletHolder(new AdminServlet());
View Full Code Here

*/
public class Start {

  public static void main(String[] args) throws Exception {
    Server server = new Server();
    SocketConnector connector = new SocketConnector();

    // Set some timeout options to make debugging easier.
    connector.setMaxIdleTime(1000 * 60 * 60);
    connector.setSoLingerTime(-1);
    int port = Integer.parseInt(System.getProperty("jetty.port", "8081"));
    connector.setPort(port);
        server.addConnector(connector);

    // the orders of handlers is very important!
    /*
    ContextHandler contextHandler = new ContextHandler();
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.server.bio.SocketConnector

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.