• 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 would CFReadStreamSetProperty return FALSE?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why would CFReadStreamSetProperty return FALSE?


  • Subject: Re: Why would CFReadStreamSetProperty return FALSE?
  • From: Martin Redington <email@hidden>
  • Date: Sun, 22 Jan 2006 17:35:43 +0000

Hi Jeremy

On 1/22/06, Jeremy Wyld <email@hidden> wrote:
>
> On Jan 22, 2006, at 8:23 AM, Martin Redington wrote:
>
>
> I'm also using CFReadStreamSetProperty to set the
>
> kCFStreamPropertySocketSecurityLevel entry, and that works
> fine.
>
> I'm confused by this bit.  Are you also calling this in addition to
> kCFStreamPropertySSLSettings?

yep. It did seem a little redundant, but the docs didn't say anything
about not setting both.

My code looks like this (although the new code checks the setProperty
return values.

CFTypeRef secLevel = (CFTypeRef) [sslProps objectForKey:(NSString
*)kCFStreamSSLLevel];

CFReadStreamSetProperty(readStreamRef,
kCFStreamPropertySocketSecurityLevel, secLevel);
CFWriteStreamSetProperty(writeStreamRef,
kCFStreamPropertySocketSecurityLevel, secLevel);

CFReadStreamSetProperty(readStreamRef, kCFStreamPropertySSLSettings, sslProps);
CFWriteStreamSetProperty(writeStreamRef, kCFStreamPropertySSLSettings,
sslProperties);

> There should be no threading issues associated with making these calls per
> se.  Because you're making them from another thread, you always run a risk
> of not issuing the calls at the correct time unless your protocol has a
> mechanism to "know" when to do it.

The entire connection is being run in this thread, so I don't think
that's an issue (and my logging indicates that the sequencing is as
intended).

> You can always look at the CFSocketStream source.
> http://darwinsource.opendarwin.org/10.4/CFNetwork-128/Stream/CFSocketStream.c
>
> The functions that you're interested in are
> _SocketStreamSecuritySetContext_NoLock and
> _SocketStreamSecuritySetInfo_NoLock.

Thanks very much for the pointer. I'm just looking at
_SocketStreamSecuritySetInfo_NoLock now.

   cheers,
         Martin
 _______________________________________________
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 would CFReadStreamSetProperty return FALSE? (From: Martin Redington <email@hidden>)
 >Re: Why would CFReadStreamSetProperty return FALSE? (From: Jeremy Wyld <email@hidden>)

  • Prev by Date: Re: Why would CFReadStreamSetProperty return FALSE?
  • Next by Date: Re: Efficient UDP processing
  • Previous by thread: Re: Why would CFReadStreamSetProperty return FALSE?
  • Next by thread: data into mbufs
  • Index(es):
    • Date
    • Thread