Re: Why might CFReadStreamCopyProperty(stream, kCFStreamPropertySocketNativeHandle) return NULL?
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