doc[zfoo]: 更新文档

This commit is contained in:
jaysunxiao
2021-07-10 14:41:01 +08:00
parent 00a685713f
commit b789906ae1
3 changed files with 10 additions and 4 deletions
+4 -1
View File
@@ -91,4 +91,7 @@ Javassist字节码增强序列化函数比反射快非常多
### [第九讲](https://www.bilibili.com/video/BV1rL411W7bo)
- net原理讲解
- 知识点
- 知识点
```
netty的nio
```
@@ -30,7 +30,8 @@ public class EchoClientTest {
public void connect(int port, String host) {
EventLoopGroup group = new NioEventLoopGroup();
Bootstrap bootstrap = new Bootstrap();
bootstrap.group(group).channel(NioSocketChannel.class)
bootstrap.group(group)
.channel(NioSocketChannel.class)
.option(ChannelOption.TCP_NODELAY, true)
.handler(new ChildChannelHandler());
ChannelFuture future = null;
@@ -42,8 +42,10 @@ public class EchoServerTest {
EventLoopGroup workerGroup = new NioEventLoopGroup();//SocketChannel的网络读写
try {
ServerBootstrap bootstrap = new ServerBootstrap();
bootstrap.group(bossGroup, workerGroup).channel(NioServerSocketChannel.class)
.option(ChannelOption.SO_BACKLOG, 100).handler(new LoggingHandler(LogLevel.INFO))
bootstrap.group(bossGroup, workerGroup)
.channel(NioServerSocketChannel.class)
.option(ChannelOption.SO_BACKLOG, 100)
.handler(new LoggingHandler(LogLevel.INFO))
.childHandler(new ChildChannelHandler());
//绑定端口,同步等待成功