ActionScript 套接字与 WebSocket
我正在开发一款基于 Flash 的网络游戏。我必须在 ActionScript 套接字和 WebSockets(或更具体地说是 socket.io)之间进行选择。我想知道哪个是更好的选择。我倾向于 ActionScript 套接字,因为它(应该)将成为所有浏览器的标准。对于socket.io,WebSockets只能在HTML5中使用,甚至可能导致对某些旧浏览器进行轮询,这是一个大问题。
你们认为 ActionScript 套接字是更好的选择吗?
非常感谢!
I'm working on a Flash based networked game. I have to choose between ActionScript sockets and WebSockets (or more specifically socket.io). I'm wondering which is the better choice. I'm leaning toward ActionScript sockets since it (should) will be standard across all browsers. With socket.io, WebSockets can only be used in HTML5 and it can even result to polling for some older browsers which is a big issue.
Would you guys say that ActionScript sockets is the better choice?
Thank you very much!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
世界正在走向 WebSocket(以及一般而言的 HTML5)。
鉴于许多平板电脑、智能手机(甚至Metro 风格的 IE10) 不支持插件。 Adobe 宣布他们将停止为移动浏览器开发 Flash。 Flash 可能适合您的应用程序,但很明显,目前 HTML5 比 Flash 更“面向未来”。
至于浏览器对 HTML5 特别是 WebSocket 的支持:一些 WebSocket 服务器提供了非常巧妙的模拟技术,一方面允许开发人员针对 WebSocket API 进行编码,另一方面在给定情况下自动选择最佳传输层(浏览器、平台、代理、路由器和其他中介)。例如,Kaazing WebSocket Gateway [披露:我为 Kaazing 工作] 的仿真效果非常好(如果对使用旧版浏览器(包括 IE6)进行 WebSocket 模拟感兴趣,请查看此博客文章。
还有一件事:如果 Flash 是您熟悉并需要用于开发的技术,Kaazing 还提供适用于 Flash、Flex、Air(以及 Java、.Net,显然还有 JavaScript)的 WebSocket API。
总的来说,我今天肯定会选择 WebSockets 路线。
The world is moving towards WebSockets (and HTML5, in general).
Flash is becoming more challenging than ever, given that many tablets, smartphones (and even IE10 in Metro style) don't support plugins. Adobe announced that they will stop developing Flash for mobile browsers. Flash may be OK for the purposes of your application, but it's pretty clear that at this point HTML5 is way more "future proof" than Flash.
As for the browser support for HTML5 and specifically WebSockets: some of the WebSocket servers provide very clever emulation techniques that on one hand allow the developer to code against the WebSocket APIs, on the other hand automatically select the best transport layer under the given circumstances (browser, platform, proxies, routers, and other intermediaries). For example, the Kaazing WebSocket Gateway [disclosure: I work for Kaazing] does emulation exceptionally well (check out this blog post if interested in WebSocket emulation using older browsers, including IE6).
And one more thing: if Flash is a technology you're familiar with and need to use for development, Kaazing has WebSocket APIs for Flash, Flex, Air (as well as Java, .Net, and obviously JavaScript) as well.
Overall, I'd definitely go the WebSockets route today.