publicclassHttpServer{int port ;publicHttpServer(int port){this.port = port;}publicvoidstart()throws Exception{
ServerBootstrap bootstrap =newServerBootstrap();
EventLoopGroup boss =newNioEventLoopGroup();
EventLoopGroup work =newNioEventLoopGroup();
bootstrap.group(boss,work).handler(newLoggingHandler(LogLevel.DEBUG)).channel(NioServerSocketChannel.class).childHandler(newHttpServerInitializer());
ChannelFuture f = bootstrap.bind(newInetSocketAddress(port)).sync();
System.out.println(" server start up on port : "+ port);
f.channel().closeFuture().sync();}}
1public class HttpServer { int port ; public HttpServer(int port){ this.port = port; } public void start() throws Exception{ ServerBootstrap bootstrap = new ServerBoot...