Websockets

blov · · 690 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>Hi all,<br/> I wanted to ask, have someone experience with Websocket in Golang. I know that Gorilla provide Websocket library but is Golang suitable for Websocket based application or Server Sent Event?<br/> When using Websocket with Golang, it could appear problem with GC, i have read somewhere.</p> <hr/>**评论:**<br/><br/>albatr0s: <pre><p>Yes, it&#39;s suitable.</p></pre>james-h: <pre><p>I have used the <code>golang.org/x/net/websocket</code> package and I haven&#39;t had any problems with it. I don&#39;t see how the garbage collector could be an issue.</p></pre>avrtno: <pre><p>Have you run into <a href="https://github.com/golang/go/issues/7632" rel="nofollow">the fragmentation issue</a>? </p></pre>james-h: <pre><p>Ah, I wasn&#39;t aware of this. In my case, I was only sending short messages. That being said, if you&#39;re using web sockets to communicate with a web browser, it&#39;s inevitable since web browsers only read a single frame at a time.</p></pre>robvdl: <pre><p>I thought that the built-in websocket support was based an older version of the websocket protocol, I forget exactly what the issue was, but it is pretty much why you should use Gorilla websockets... well last time I checked anyway.</p></pre>xsolarwindx: <pre><p>What kind of question is this...</p></pre>simon-whitehead: <pre><p>There&#39;s also <em>cough</em> nice libraries (<a href="https://github.com/simon-whitehead/relayr" rel="nofollow">https://github.com/simon-whitehead/relayr</a>) <em>cough</em> to make that a bit easier.</p> <p>(I wrote that one - works nicely for me)</p></pre>PsyWolf: <pre><p>server sent events in golang: <a href="http://sse.getgin.io/room/hn" rel="nofollow">http://sse.getgin.io/room/hn</a></p></pre>ksawicki: <pre><p>I&#39;m using wampv2 implementation. <a href="https://github.com/jcelliott/turnpike/tree/v2?files=1" rel="nofollow">https://github.com/jcelliott/turnpike/tree/v2?files=1</a></p></pre>

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

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