• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: TCP sockets with Bonjour-discovered address
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: TCP sockets with Bonjour-discovered address
      • From: Carl Hoefs <email@hidden>
References: 
 >TCP sockets with Bonjour-discovered address (From: Carl Hoefs <email@hidden>)
 >Re: TCP sockets with Bonjour-discovered address (From: Jens Alfke <email@hidden>)
 >Re: TCP sockets with Bonjour-discovered address (From: Josh Graessley <email@hidden>)
 >Re: TCP sockets with Bonjour-discovered address (From: Jens Alfke <email@hidden>)
 >Re: TCP sockets with Bonjour-discovered address (From: Josh Graessley <email@hidden>)
 >Re: TCP sockets with Bonjour-discovered address (From: Carl Hoefs <email@hidden>)
 >Re: TCP sockets with Bonjour-discovered address (From: Jens Alfke <email@hidden>)
 >Re: TCP sockets with Bonjour-discovered address (From: Carl Hoefs <email@hidden>)

  • Prev by Date: Re: Implementing proxy support
  • Next by Date: Re: Background download tasks intermittently stalling for 4 minutes
  • Previous by thread: Re: TCP sockets with Bonjour-discovered address
  • Next by thread: Re: TCP sockets with Bonjour-discovered address
  • Index(es):
    • Date
    • Thread