Package org.simpleframework.transport.connect

Examples of org.simpleframework.transport.connect.Connection


               }
            }
         }
      };
      ContainerServer server = new ContainerServer(container);
      Connection connection = new SocketConnection(server);
      InetSocketAddress address = (InetSocketAddress)connection.connect(null); // ephemeral port
     
      return new ServerCriteria(connection, address);
   }
View Full Code Here


    public HttpFileServer start(File contentRoot, int port) {
        Container container = new SimpleFileServerContainer(new FileContext(contentRoot));

        try {
            final Server server = new ContainerServer(container);
            Connection connection = new SocketConnection(server);
            InetSocketAddress address = new InetSocketAddress(port);
            InetSocketAddress usedAddress = (InetSocketAddress)connection.connect(address);

            return new SimpleHttpFileServer(contentRoot, usedAddress.getPort(), new Stoppable() {
                public void stop() {
                    try {
                        server.stop();
View Full Code Here

        if (port == -1) {
            port = defaultPort;
        }
        SocketAddress listen = new InetSocketAddress(port);
        Server server = new ContainerServer(container);
        Connection connection = new SocketConnection(server);

        connection.connect(listen, context);

        return connection;
    }
View Full Code Here

       
        if(port == -1) {
           port = defaultPort;
        }        
        SocketAddress listen = new InetSocketAddress(port);
        Connection connection = new SocketConnection(container);
       
        connection.connect(listen, context);
       
        return connection;
   
View Full Code Here

TOP

Related Classes of org.simpleframework.transport.connect.Connection

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.