• 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
Can't get remote host and port after CFStreamCreatePairWithSocketToNetService
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Can't get remote host and port after CFStreamCreatePairWithSocketToNetService


  • Subject: Can't get remote host and port after CFStreamCreatePairWithSocketToNetService
  • From: Jeff Johnson <email@hidden>
  • Date: Mon, 13 Apr 2015 10:31:17 -0500

I'm using CFStreamCreatePairWithSocketToNetService to get read/write streams. According to the documentation, "The streams do not create a socket, resolve the service, or connect to the service’s host until you open one of the streams." I open the streams with CFReadStreamOpen and CFWriteStreamOpen. The streams are open and can be read from and written to. Yet I can't get the remote host and port from the API. I try CFNetServiceGetTargetHost and CFNetServiceGetPortNumber on both my original CFNetServiceRef and kCFStreamPropertySocketRemoteNetService, but I always get NULL and 0. I try to get kCFStreamPropertySocketRemoteHostName and kCFStreamPropertySocketRemotePortNumber from both the read stream and the write stream, but again I always get NULL.

Isn't this supposed to work? Isn't the net service supposed to resolve when you open the streams?


 _______________________________________________
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: Can't get remote host and port after CFStreamCreatePairWithSocketToNetService
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: Best practices for GCD-based socket I/O with SSL support?
  • Next by Date: Re: Can't get remote host and port after CFStreamCreatePairWithSocketToNetService
  • Previous by thread: Re: Best practices for GCD-based socket I/O with SSL support?
  • Next by thread: Re: Can't get remote host and port after CFStreamCreatePairWithSocketToNetService
  • Index(es):
    • Date
    • Thread