开发者

iOS: NSSocketPort, where art thou?

开发者 https://www.devze.com 2023-02-13 23:46 出处:网络
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 i

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:

http://developer.apple.com/library/ios/#documentation/Networking/Conceptual/NSNetServiceProgGuide/Articles/OperationsonNetworkServices.html#//apple_ref/doc/uid/TP40002525开发者_JAVA技巧-SW1


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消