Skip to content

Commit 378d29e

Browse files
committed
update
1 parent 8315ee2 commit 378d29e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

CORE FUNCTIONS/Decoding delimited and length-based protocols.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,12 @@ Listing 8.9 Decoder for the command and the handler
115115
}
116116
}
117117
}
118+
119+
1. 添加一个 CmdDecoder 到管道;将提取 Cmd 对象和转发到在管道中的下一个处理器
120+
2. 添加 CmdHandler 将接收和处理 Cmd 对象
121+
3. 命令也是 POJO
122+
4. super.decode() 通过结束分隔从 ByteBuf 提取帧
123+
5. frame 是空时,则返回 null
124+
6. 找到第一个空字符的索引。首先是它的命令名;接下来是参数的顺序
125+
7. 从帧先于索引以及它之后的片段中实例化一个新的 Cmd 对象
126+
8. 处理通过管道的 Cmd 对象

0 commit comments

Comments
 (0)