Re: TCP sockets with Bonjour-discovered address
Re: TCP sockets with Bonjour-discovered address
- Subject: Re: TCP sockets with Bonjour-discovered address
- From: "Quinn \"The Eskimo!\"" <email@hidden>
- Date: Tue, 15 Jul 2014 14:45:55 +0100
On 2 Jul 2014, at 00:08, Carl Hoefs <email@hidden> wrote:
> But I think you're both correct about using CFNetwork/CFStream in the long run. Was just trying to get old code working, but it will eventually become more cumbersome. Will have to sit down with the docs and try to figure it all out.
One option here is to do the connect-by-name stuff using high-level APIs, then extract the socket from the stream (kCFStreamPropertySocketNativeHandle), then pass that socket to your legacy BSD Sockets code for the actual I/O. This works fine in most circumstances [1].
On 2 Jul 2014, at 22:26, Carl Hoefs <email@hidden> wrote:
> Couldn't find reference to it in my NSStreams.h. Still using Xcode 5.1 on OS X 10.8.5.
You're right that +getStreamsToHostWithName:port:inputStream:outputStream: isn't in current GM OS releases or their corresponding SDKs. On current systems you have to use the technique shown by QA1652 "Using NSStreams For A TCP Connection Without NSHost".
<https://developer.apple.com/library/ios/#qa/qa1652/_index.html>
Share and Enjoy
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
[1] It's not supported for VoIP command channel sockets on iOS.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden