We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我使用TcpServer类,并使用UNPACK_BY_LENGTH_FIELD拆包规则,在包头中包含了包体长度和数据包ID还有数据包类型等字段。 然后我在onMessage(const hv::SocketChannelPtr& channel, hv::Buffer* buf) 回调中,需要读取包头的内容来做业务判断,因为数据发送端不是我写的,所以这个数据包协议我也改不了,所以请教一下,怎么读取包头的内容?
The text was updated successfully, but these errors were encountered:
使用setUnpack后,onMessage返回给你的就是完整的头部+数据的一包,你清楚头部格式,自己解析就好了,libhv做的只是帮你解决了"粘包"问题
Sorry, something went wrong.
No branches or pull requests
我使用TcpServer类,并使用UNPACK_BY_LENGTH_FIELD拆包规则,在包头中包含了包体长度和数据包ID还有数据包类型等字段。
然后我在onMessage(const hv::SocketChannelPtr& channel, hv::Buffer* buf) 回调中,需要读取包头的内容来做业务判断,因为数据发送端不是我写的,所以这个数据包协议我也改不了,所以请教一下,怎么读取包头的内容?
The text was updated successfully, but these errors were encountered: