<p>I have started using Go and want to use it to create a program that connects to a WAMP server. So I need a library that implements the client side of the WAMP protocol. I though it would be easy since Go is usually used for network io programs, but to my surprise I can not find a proper WAMP library that implements the client side half decently.</p>
<p>There is Turnpike <a href="https://github.com/jcelliott/turnpike" rel="nofollow">https://github.com/jcelliott/turnpike</a> , but its mostly focused on the server. The client side does not even implement a mechanism to notify if the connection has gone dead.</p>
<p>Any suggestion appreciated.</p>
<hr/>**评论:**<br/><br/>titpetric: <pre><p>A good question would be, why wouldn't you rely on connection/read timeouts to notify you if the connection has gone dead. The peer object has a Close function <a href="https://github.com/jcelliott/turnpike/blob/v2/client.go#L104" rel="nofollow">which is invoked when that happens</a>. Peer is an <a href="https://github.com/jcelliott/turnpike/blob/v2/peer.go#L18" rel="nofollow">interface with a Close function</a> which I strongly suspect that you can implement by yourself. For example, you could take <a href="https://github.com/jcelliott/turnpike/blob/7e538cf1709832669045b8a68ebeda27582858fb/websocket.go" rel="nofollow">websocket.go</a>, put it into your project and update whatever you need in the Close function. Maybe I'm just misunderstanding your exact issue with it?</p>
<p>As always with open source, if you can't get the support from the original author (against payment or whatever), research if you're willing to fork the project, add the functionality you need and submit a pull request back to the original project.</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传