问题描述
我正在开发一个涉及聊天元素的 Cocoa 应用程序.我考虑过的一种方法是使用 Websockets 来处理客户端-服务器通信.这将是特别可取的,因为聊天也将显示在网站上,并且使用 Websockets 可以使实现变得非常简单.
I am developing a Cocoa application which involves a chat element. One approach I've considered is using Websockets to handle client-server communication. This would be particularly desirable because chats will also be displayed on a website, and using Websockets could make the implementation very simple.
那么:是否可以使用 WebView 元素,并在其中使用 Websockets?(我知道 Safari 还不支持 Websockets,所以我想这是不可能的?)
So: would it be possible to use a WebView element, and use Websockets within it? (I know Safari doesn't support Websockets yet, so I imagine this is not possible?)
否则,是否有任何适用于 C、Objective C 或任何其他语言的 Websocket 客户端库,我可以成功地嵌入到我的应用程序中?
Failing that, are there any Websocket client libraries for C, Objective C, or any other language I could successfully embed within my application?
欢迎提出建议.
推荐答案
这里是objective-c的websockets实现
Here is an implementation of websockets for objective-c
这篇关于如何将 WebSockets 合并到 Cocoa 应用程序中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!