作者:Sunny-阿坚 | 来源:互联网 | 2023-05-18 10:17
IamwantingtocreateaprogramthattalkswithaCometdservertoallowforpushingofdatatothe
I am wanting to create a program that talks with a Cometd server to allow for pushing of data to the app.
我想创建一个与Cometd服务器通信的程序,以允许将数据推送到应用程序。
I have done this on the web side using AJAX, but I am a little unsure of the best way to do this with Cocoa.
我已经在网络端使用AJAX完成了这个,但我不太确定使用Cocoa做到这一点的最佳方法。
I can make a standard connection using NSURLRequest and NSURLConnection, but how do I keep this connection alive so I can send data when needed and get the pushed info when needed.
我可以使用NSURLRequest和NSURLConnection建立标准连接,但是如何保持此连接处于活动状态,以便我可以在需要时发送数据并在需要时获取推送信息。
Am I even going about this the correct way?
我是否正确地采用这种方式?
Thanks in advance
提前致谢
1 个解决方案