-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
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
Special treatment for the first package #601
Comments
这个问题主要是 gnet v1 里出现的,因为 v1 有编码器和解码器的功能,导致解码器在识别第一个特殊包的场景中不是很灵活,但是 gnet v2 移除了编码器和解码器,现在整个数据解析逻辑都要放在 |
This problem mainly occurs in gnet v1, because v1 has the functions of encoder and decoder, resulting in the decoder not being very flexible in the scenario of identifying the first special packet, but gnet v2 removes the encoder and decoder. Now the entire data parsing logic will be placed in |
是~~~ |
Yes~~~ |
不需要每次都判断,你用 |
You don’t need to judge every time. You can use |
emmm... 我说的就是这个判断,这也是判断啊... |
|
遇到了不少场景(如:支持PROXY Protocol协议),都需要在连接建立后对首个包进行特殊处理,当然放在协议解析器里面去处理是可以的,但很明显这样每次数据包来的时候都得去判断一下,很不合理,解析器应该只关心业务相关内容才对!!!
翻了一下Issues,发现之前已经有提过这个了,
#231 (comment)
#231 (comment)
pan大佬也说了解决的思路:应该有一个专门的 handler,收到第一个包的时候调用一下就行。。。
这么久过去了,有计划支持吗?
The text was updated successfully, but these errors were encountered: