This commit is contained in:
Lemon
2023-11-28 13:50:01 +08:00
parent 5bcfa92ff9
commit 6d71a7e9c2

View File

@@ -39,7 +39,7 @@ public class NettyServer implements CommandLineRunner {
try { try {
ServerBootstrap bootstrap = new ServerBootstrap() // //启动NIO服务的辅助启动类 ServerBootstrap bootstrap = new ServerBootstrap() // //启动NIO服务的辅助启动类
.group(bossGroup, workerGroup) // 绑定线程池 .group(bossGroup, workerGroup) // 绑定线程池
.channel(NioServerSocketChannel.class) // 启动服务时, 通过反射创建一个NioServerSocketChannel对象 .channel(NioServerSocketChannel.class) // 启动服务时, 通过反射创建一个NioServerSocketChannel对象 负责绑定监听端口地址,接收客户端连接并创建用于与客户端通信
/* /*
===> 服务器初始化时执行, 属于AbstracBootstrap的方法 ===> 服务器初始化时执行, 属于AbstracBootstrap的方法