iOS:NSSocketPort,你在哪里?
开发人员文档充满了对 NSSocketPort 的引用,它被认为是 Foundation 框架的一部分。但是,我似乎无法在 Foundation 中找到 NSSocketPort 的头文件。我的猜测是,它只是复制到 iOS 的 Mac 文档,而 NSSocketPort 在 iOS 中并不真正存在。
我的问题:是吗(阅读:我是不是太迟钝而找不到它)?如果没有:我可以遵循基础级别的替代方法来建立点对点连接(在 Game Kit 之外,因为这看起来相当反复无常)?
参考:
The developer docs are full of references to NSSocketPort
, which is supposedly part of the Foundation framework. However, I can't seem to find a header file for NSSocketPort in Foundation. My guess is that it is just Mac docs copied over to iOS, and that NSSocketPort does not really exist in iOS.
My question: does it (read: am I too dull to find it)? And if not: is there an alternative approach on the Foundation level that I can follow to establish a peer-to-peer connection (outside Game Kit, as that seems rather capricious)?
References:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你是对的,它被到处引用,但似乎不是 iOS 基础框架的一部分。
您可以使用 NSStream< /a> 高级套接字实现类(查看 SimpleNetworkStreams 示例)。
我还听说您可以使用 smallSockets 库(专为 Mac 设计) OS,但据说对于 iOS 来说编译得很好)来包装 CF 网络类。
You are correct that it is referenced all over the place but doesn't seem to be a part of the Foundation Framework for iOS.
You can use the NSStream class for a High Level Socket Implementation (Look at the SimpleNetworkStreams sample).
I've also heard you can use the smallSockets library (designed for Mac OS, but supposedly compiles just fine for iOS) to wrap the CF Networking classes.