在iPhone上的COMET(服务器推送到客户端) [英] COMET (server push to client) on iPhone

查看:117
本文介绍了在iPhone上的COMET(服务器推送到客户端)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要从我的服务器到我的iPhone应用程序建立某种套接字/ COMET类型的功能。基本上,用户在服务器上设置任意对象脏时,例如更新其地址。反馈应该从服务器推送到保持对服务器的实时轮询的任何客户端。这个流行语是COMET我想。我知道有DWR的Web浏览器应用程序,所以我想,也许最好在我的每个控制器中设置一个隐藏的UIWebView,所以我可以从他们的javascript框架的COMET出来?有更优雅的方法吗?

I'm looking to establish some kind of socket/COMET type functionality from my server(s) to my iPhone application. Essentially, anytime a user manages to set an arbitrary object 'dirty' on the server, by say, updating their Address.. the feedback should be pushed from the server to any clients keeping a live poll to the server. The buzzword for this is COMET I suppose. I know there is DWR out there for web browser applications, so I'm thinking, maybe it's best to set a hidden UIWebView in each of my controllers just so I can get out of the box COMET from their javascript framework? Is there a more elegant approach?

推荐答案

有几个解决方案可以使用 STOMP 客户端。

There are a couple of solutions available to use a STOMP client.

STOMP非常简单和轻便,非常适合iPhone。

STOMP is incredibly simple and lightweight, perfect for the iPhone.

我使用这一个作为我的出发点,并发现它非常好。它有一些对象分配/内存泄漏问题,但一旦我得到了iphone程序的悬挂,这些都很容易解决。

I used this one as my starting point, and found it very good. It has a few object allocation/memory leak problems, but once I got the hang of iPhone programming, these were easy to iron out.

希望有帮助!

这篇关于在iPhone上的COMET(服务器推送到客户端)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆