Skip to content
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

请教zinx必须通过msgid处理消息吗 #284

Open
gosun163 opened this issue Oct 29, 2023 · 3 comments
Open

请教zinx必须通过msgid处理消息吗 #284

gosun163 opened this issue Oct 29, 2023 · 3 comments

Comments

@gosun163
Copy link

看demo都是通过注册msgid处理消息,原生二进制数据是要怎么处理的呢

@aceld
Copy link
Owner

aceld commented Oct 30, 2023

可以通过自定义decoder来实现,但是需要给一个自己默认的msgID,然后在自己的decoder里面实现自定义的原生二进制。

@aceld
Copy link
Owner

aceld commented Oct 30, 2023

image

如果没有MsgID, 那么你需要自定义一个Decoder,在实现自定义Decoder的Intercept方法时,SetMsgID给一个默认值,然后在server中 通过addRouter将这个默认的msgID进行注册。

@aceld
Copy link
Owner

aceld commented Oct 30, 2023

自定义实现一个Decoder的文档在这:
https://www.yuque.com/aceld/tsgooa/lsu25bgvqoxeg6nz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants