• 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: Why might CFReadStreamCopyProperty(stream, kCFStreamPropertySocketNativeHandle) return NULL?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why might CFReadStreamCopyProperty(stream, kCFStreamPropertySocketNativeHandle) return NULL?


  • Subject: Re: Why might CFReadStreamCopyProperty(stream, kCFStreamPropertySocketNativeHandle) return NULL?
  • From: Quinn <email@hidden>
  • Date: Fri, 29 Aug 2008 12:31:38 +0100

At 1:55 -0400 29/8/08, Michael Ledford wrote:
Can someone give me some clear direction as to why this is occurring?

The only CFStream object that responds directly to the kCFStreamPropertySocketNativeHandle is CFSocketStream.


The HTTP stream copy property routine handles the HTTP-related properties directly and pass other property requests down to a complex web of objects that its uses in its implementation. One of those objects is CFSocketStream. Thus, if the HTTP stream is, at this given incident, using a CFSocketStream, your kCFStreamPropertySocketNativeHandle request will work. OTOH, if the HTTP stream is currently disconnected from the socket stream, the request fails.

This relationship between the HTTP stream and the CFSocketStream is not part of the API. The fact that the kCFStreamPropertySocketNativeHandle ever works is just an accident of the implementation. I don't think you should rely on this in your code.

Why do you need access to the underlying socket?

S+E
--
Quinn "The Eskimo!"                    <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
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


References: 
 >Why might CFReadStreamCopyProperty(stream, kCFStreamPropertySocketNativeHandle) return NULL? (From: Michael Ledford <email@hidden>)

  • Prev by Date: Re: How to change the system proxy configuration ?
  • Next by Date: Re: CFHTTPMessage and thread safety
  • Previous by thread: Why might CFReadStreamCopyProperty(stream, kCFStreamPropertySocketNativeHandle) return NULL?
  • Next by thread: Re: Why might CFReadStreamCopyProperty(stream, kCFStreamPropertySocketNativeHandle) return NULL?
  • Index(es):
    • Date
    • Thread