Example usage for org.apache.http.impl.bootstrap ServerBootstrap setListenerPort

List of usage examples for org.apache.http.impl.bootstrap ServerBootstrap setListenerPort

Introduction

In this page you can find the example usage for org.apache.http.impl.bootstrap ServerBootstrap setListenerPort.

Prototype

public final ServerBootstrap setListenerPort(final int listenerPort) 

Source Link

Document

Sets listener port number.

Usage

From source file:com.adobe.ags.curly.test.TestWebServer.java

private TestWebServer(int port) throws IOException, InterruptedException {
    this.port = port;
    ServerBootstrap bootstrap = ServerBootstrap.bootstrap();
    bootstrap.setListenerPort(port);
    bootstrap.setServerInfo("Test/1.1");
    bootstrap.setSocketConfig(SocketConfig.DEFAULT);
    bootstrap.registerHandler("*", this::handleHttpRequest);
    server = bootstrap.create();/*from  w ww . j  a  v  a2 s  . co m*/
    server.start();
}