mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-08-15 12:27:30 +00:00
doc[zfoo]: 更新文档
This commit is contained in:
+4
-1
@@ -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());
|
||||
|
||||
//绑定端口,同步等待成功
|
||||
|
||||
Reference in New Issue
Block a user