适用于 Android、iOS 和 Flash 的 WebSocket 库

编程入门 行业动态 更新时间:2024-10-25 08:15:46
本文介绍了适用于 Android、iOS 和 Flash 的 WebSocket 库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

谁能提供一个在 Android、iOS(iPhone/iPad)和 Flash(不是 flex!)中实现 WebSocket 的示例.

我找到了一些图书馆,但没有一个工作:).我的浏览器 WebSocket 实现使用 Socket.IO 运行良好,现在我还想深入研究 Android、iPhone 和 Flash.

我尝试实现一个 Android webview,指向一个实现了套接字的网站,但它不起作用.如果有一些本地库,我会很高兴.

感谢您的帮助!

解决方案

iOS 4.2 及更高版本具有原生 WebSockets 支持.

对于支持 Flash 的 Android 设备(或任何支持 Flash 的浏览器),您可以使用 web-socket-js.Socket.IO 实际上包含 web-socket-js 作为可以启用的传输之一.

请参阅 caniuse,了解支持原生 WebSocket 的浏览器和移动设备的最新列表.>

更新:

对于原生 iOS 应用程序 (Objective-C),请查看 UnittWebSocketClient.一个警告:我查看了代码,它使用了协议的 HyBi-07 版本,该版本比大多数浏览器当前支持的 Hixie-76 版本更新.但是,如果您连接的服务器支持 HyBi-07 或更高版本,则应该没有问题.

can someone please provide an example of WebSocket implementation in Android, iOS(iPhone/iPad) and Flash (not flex!).

I found some libraries but none of that work :). My browser WebSocket implementation is working great using Socket.IO, now I would like to dig also into Android, iPhone and Flash.

I tried to implement a Android webview pointing to a website where sockets are implemented, but it doesn't work. I would be great to have some native library for that.

Thx for your help!

解决方案

iOS 4.2 and above have native WebSockets support.

For Android devices with Flash support (or any browser with Flash) you can use web-socket-js. Socket.IO actually includes web-socket-js as one of the transports that can be enabled.

See caniuse for an up-to-date list of browsers and mobile devices with native WebSockets support.

Update:

For native iOS applications (Objective-C) check out UnittWebSocketClient. One caveat: I looked in the code and it uses the HyBi-07 version of the protocol which is more recent than the Hixie-76 version currently supported by most browsers. However, if the server you are connecting to supports HyBi-07 or later it shouldn't be a problem.

更多推荐

适用于 Android、iOS 和 Flash 的 WebSocket 库

本文发布于:2023-11-15 03:00:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1590553.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:适用于   Android   iOS   Flash   WebSocket

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!