| | |
| | | package com.example.erp.tools.netty; |
| | | |
| | | import io.netty.bootstrap.ServerBootstrap; |
| | | import io.netty.channel.ChannelFuture; |
| | | import io.netty.channel.ChannelInitializer; |
| | | import io.netty.channel.ChannelOption; |
| | | import io.netty.channel.EventLoopGroup; |
| | | import io.netty.channel.nio.NioEventLoopGroup; |
| | | import io.netty.channel.socket.SocketChannel; |
| | | import io.netty.channel.socket.nio.NioServerSocketChannel; |
| | | import io.netty.handler.codec.http.HttpObjectAggregator; |
| | | import io.netty.handler.codec.http.HttpServerCodec; |
| | | import io.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandler; |
| | | import io.netty.handler.stream.ChunkedWriteHandler; |
| | | |
| | | /** |
| | | * NettyServer Netty服务器配置 |
| | | * @author zhengkai.blog.csdn.net |
| | |
| | | this.port = port; |
| | | } |
| | | |
| | | public void start() throws Exception { |
| | | /*public void start() throws Exception { |
| | | EventLoopGroup bossGroup = new NioEventLoopGroup(); |
| | | |
| | | EventLoopGroup group = new NioEventLoopGroup(); |
| | |
| | | group.shutdownGracefully().sync(); // 释放线程池资源 |
| | | bossGroup.shutdownGracefully().sync(); |
| | | } |
| | | } |
| | | }*/ |
| | | } |
| | | |
| | | |