Package org.simpleframework.transport.connect

Examples of org.simpleframework.transport.connect.SocketConnection


        }
        SocketAddress listen = new InetSocketAddress(port);
        Connection connection;
        try {
            Server server = new ContainerServer(container);
            connection = new SocketConnection(server);

            connection.connect(listen, context);
            container.onServerStart();
        } catch (IOException ex) {
            throw new ProcessingException("IOException thrown when trying to create simple server", ex);
View Full Code Here


     */
   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);
   }
View Full Code Here

    @Before
    public void init() throws IOException
    {
        container = new BadRequestServer(503);
        connection = new SocketConnection(container);
        SocketAddress address = new InetSocketAddress(PORT);

        connection.connect(address);
    }
View Full Code Here

        }
        final InetSocketAddress listen = new InetSocketAddress(port);
        final Connection connection;
        try {
            final Server server = serverProvider.get();
            connection = new SocketConnection(server);

            final SocketAddress socketAddr = connection.connect(listen, context);
            container.onServerStart();

            return new SimpleServer() {
View Full Code Here

  public DummyServer(int port) {
    container = new Handler();
    try {
      server = new ContainerServer(container);
      connection = new SocketConnection(server);
    }
    catch (IOException e) {
      throw new RuntimeException(e);
    }
    address = new InetSocketAddress(port);
View Full Code Here

  public PrintStream stdOut = System.out;

  public static void start() throws Exception {
    Container container = new HttpServer();
    Server server = new ContainerServer(container);
    connection = new SocketConnection(server);
    SocketAddress address = new InetSocketAddress(Integer.valueOf(StartMain.args[0]));
   
    connection.connect(address);
   
    //connection.close();
View Full Code Here

    rootContext.setVariableValue("zetesVersion", zetes.hands.About.VERSION);
    rootContext.setVariableValue("parrotVersion", Parrot.VERSION);
   
    executor = Executors.newFixedThreadPool(size);
    server = new ContainerServer(this);
    connection = new SocketConnection(server);
    address = new InetSocketAddress(port);
    dataConnector = new DataConnector(new File(databaseFile));
    System.out.println("Parrot server greets you!");
  }
View Full Code Here

  private static SocketConnection socketConnection;
  private static String baseUrl;

  @BeforeClass
  public static void startServer() throws IOException {
    socketConnection = new SocketConnection(new Container() {
      public void handle(Request req, Response resp) {
        try {
          if (req.getPath().getPath().contains("/redirect/")) {
            resp.setCode(303);
            resp.add("Location", "/");
View Full Code Here

    public HttpMockServer(@Nonnull JSONObject jsonObject, @Nonnull ConfigReader configReader, @Nonnull NetworkType simulatedNetworkType)
            throws IOException, JSONException {
        ConfigResult config = new ConfigParser(configReader).parseConfig(jsonObject);
        this.responseHandler = new ResponseHandler(config.responses, simulatedNetworkType, configReader);
        Server server = new ContainerServer(this);
        conn = new SocketConnection(server);
        final SocketAddress sa = new InetSocketAddress(config.port);
        conn.connect(sa);
    }
View Full Code Here

                                                      new GovernmentReport(new GovernmentWatchdog(network))));
    private final Connection connection;
    private final InetSocketAddress address;
   
    public CiEyeServer(int port) throws IOException {
        connection = new SocketConnection(container);
        address = new InetSocketAddress(port);
    }
View Full Code Here

TOP

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

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.