Mina学习笔记 codec filter

来源:互联网 发布:网络女主播直播洗澡 编辑:程序博客网 时间:2024/06/07 03:59

能够让你的代码更加干净和容易维护
There are three common techniques for splitting the stream of bytes into messages:

use fixed length messages
use a fixed length header that indicates the length of the body
using a delimiter; for example many text-based protocols append a newline (or CR LF pair) after every message
(定长编码,固定长度头部编码,分隔符)

ProtocolCodecFilter怎么编写codecfilter具体怎么实现自己的协议编码解码
1、ProtocolCodecFactory
2、ProtocolCodecFilter
3、ProtocolEncoderAdapter ProtocolEncoder
4、ProtocolDecoderAdapter ProtocolDecoder

原创粉丝点击