-
Notifications
You must be signed in to change notification settings - Fork 160
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
能不能加入protobuf协议类型的支持,非常感谢! #5
Comments
非常抱歉两天后才看到您的建议,首先感谢您对summer提出宝贵的建议! |
不用改太多现有逻辑,只需要在协议类型中增加一种protobuf就行,以前的stringline,lengthfield等等还是能用。我试着加了一下,虽然写得有点丑,但是改动量貌似不太大。另外protobuf只是针对公网的客户端比较有用,rpc还是走json没问题,只需要修改server部分的代码,client只支持stringline和lengthfield都没问题。而且内部服务器通信json问题不大,也没必要一定用protobuf。protobuf的优势主要体现在公网客户端的流量和性能上。因为手机玩家使用json协议会增加两三倍的流量,这样是有点点多的。 |
好的,您先试试
…------------------ 原始邮件 ------------------
发件人: "kingo"<notifications@github.com>;
发送时间: 2019年12月20日(星期五) 上午9:49
收件人: "SwingFrog/Summer"<Summer@noreply.github.com>;
抄送: "夕仔"<767214481@qq.com>; "State change"<state_change@noreply.github.com>;
主题: Re: [SwingFrog/Summer] 能不能加入protobuf协议类型的支持,非常感谢! (#5)
不用改太多现有逻辑,只需要在协议类型中增加一种protobuf就行,以前的stringline,lengthfield等等还是能用。我试着加了一下,虽然写得有点丑,但是改动量貌似不太大。
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
现在的json格式性能不太好,对于压力比较大的服务器用起来可能有点困难。
protobuf解析性能是json的8倍,网络流量可以节省3倍,对于用户量特别多的情况,还是protobuf比较现实一些
The text was updated successfully, but these errors were encountered: