re-synching websockets in golang

xuanbao · · 343 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>It is my first time using golang, but it is a pretty sweet language to design simple servers. I was making a simple html5 multiplayer demo with websockets. here is the code : <a href="https://github.com/Sweetkubuni/golang_game/blob/master/server.go" rel="nofollow">link</a></p> <p>I was wondering what is a clean way to re-sync users, who lost connection? What are some good practices with golang?</p> <hr/>**评论:**<br/><br/>nhooyr: <pre><p>gofmt your code!</p></pre>kubuni: <pre><p>oh shit, I didnt even know about gofmt lol</p></pre>nhooyr: <pre><p>Read the docs on the main website for even more cool stuff.</p></pre>Jamo008: <pre><p>Isn&#39;t really a golang thing, more of a general protocol/architecture thing. Mostly dependent on the use case. I have a solution in <a href="https://github.com/jpillora/velox" rel="nofollow">https://github.com/jpillora/velox</a> though there&#39;s a few ways to do it.</p></pre>HugoWeb: <pre><p>I&#39;m trying <a href="https://github.com/olahol/melody" rel="nofollow">https://github.com/olahol/melody</a> instead of using gorilla/websockets directly for my current project.</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

343 次点击  
加入收藏 微博
0 回复
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传