允许 D 应用程序和浏览器之间双向通信的工具链
我希望有一个用 D 编程语言编写的应用程序更新其在浏览器中的显示。浏览器还应该将输入数据发送回应用程序。
我对编程还很陌生,并且对套接字/网络套接字/服务器如何组合在一起感到困惑。谁能建议一种方法?
I wish to have an app written in the D programming language update its display in a browser. The browser should also send input data back to the app.
I'm still quite new to programming and am confused with how sockets/websockets/servers all fit together. Can anyone suggest an approach?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
非常感谢 gmfawcett 提供了他的基本 D 服务器示例的链接,我已将其与我在其他地方找到的版本 8 规范的简单 websocket 实现相结合(我相信目前仅适用于 Chrome 14/15)。它几乎是剪切和粘贴,但似乎工作得足够好,我希望它足以满足我的需求。
如果有人愿意快速浏览我的代码以发现任何明显的禁忌,请随意这样做 - 谢谢!
基本的 websocket impl: http://blog.vunie.com/implementing-websocket- Draft-10
Websocket v8 规范(协议 17):https://datatracker.ietf.org/doc/html/draft- ietf-hybi-thewebsocketprotocol-17
Many thanks to gmfawcett for the link to his basic D server example which I've mated with a bare-bones websocket implementation of the version 8 spec that I found elsewhere (currently only works in Chrome 14/15, I believe). It's pretty much cut'n'paste but seems to work well enough and I expect it will be sufficient in serving my needs.
If anyone has the inclination to cast a quick eye over my code for any glaring no-nos, please feel free to do so - and thanks!
Bare-bones websocket impl: http://blog.vunie.com/implementing-websocket-draft-10
Websocket v8 spec (protocol-17): https://datatracker.ietf.org/doc/html/draft-ietf-hybi-thewebsocketprotocol-17