| | |
| | | /** |
| | | * 获取即时通讯启动端口 |
| | | */ |
| | | private Integer nettyPort = 9999; |
| | | private Integer nettyPort = (Integer) 9999; |
| | | @Override |
| | | public void run() { |
| | | EventLoopGroup bossGroup = new NioEventLoopGroup(); |
| | |
| | | // 服务器绑定端口监听 |
| | | ChannelFuture f = bootstrap.bind(nettyPort).sync(); |
| | | if(f.isSuccess()) { |
| | | System.out.println("******************************Netty启动成功******************************"); |
| | | System.out.println("******************************Netty启动成功司机******************************"); |
| | | } |
| | | // 监听服务器关闭监听 |
| | | f.channel().closeFuture().sync(); |