• 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: Event driven CFStream protocol in 10.1?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Event driven CFStream protocol in 10.1?


  • Subject: Re: Event driven CFStream protocol in 10.1?
  • From: Kris Amico <email@hidden>
  • Date: Tue, 11 Jun 2002 20:33:51 -0700

Thank you for the assistance. The requirement for exclusive ownership of the
file descriptor was lost on me. Because CFStreamCreatePairWithSocketToHost
is asynchronous if the address is a dotted four, there isn't a need for me
to use CFSocket at all, which is great!

On 6/11/02 6:29 PM, "Becky Willrich" <email@hidden> wrote:

>> I have been fiddling a lot with using
>> CFSocketCreateConnectedToSocketSignature and from the connect callback
>> creating read/write stream pairs with client callbacks scheduled in my
>> run
>> loop. The socket appears to connect and stay open but the stream
>> callbacks
>> are never called. I just want to know if this is supposed to work on
>> 10.1 (I
>> am on 10.1.4). If it turns out that this is indeed the case, I would
>> appreciate some hints about what I could be doing wrong and will post
>> the
>> code somewhere so it may be analyzed. Thanks in advance for any help!
>> :)
>
> It's supposed to work; the catch is that the stream needs to own the
> CFSocket (there's exactly one CFSocket per open file descriptor), but
> you created the CFSocket using
> CFSocketCreateConnectedToSocketSignature(), so the CFSocket carries
> your callback instead of the CFStream's internal one.....
>
> You need to either use CFStream or CFSocket, but not both; either
> approach is quite do-able. To use CFSocket, just add the ReadCallBack
> to your callbackTypes and change your callback to look for that event -
> when the event comes in, there's data waiting to be read on the socket.
> To use CFStream, just don't create the CFSocket. :)
>
> REW
> _______________________________________________
> macnetworkprog mailing list | email@hidden
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/macnetworkprog
> Do not post admin requests to the list. They will be ignored.


--
Kris Amico <email@hidden>
Senior Software Engineer
Macintosh Client Software Development
EarthLink, Inc.
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Event driven CFStream protocol in 10.1? (From: Becky Willrich <email@hidden>)

  • Prev by Date: Re: Event driven CFStream protocol in 10.1?
  • Next by Date: Re: Crash in Carbon App quitting while AppleTalking
  • Previous by thread: Re: Event driven CFStream protocol in 10.1?
  • Next by thread: Carbon ATalk endpoints and RTMP
  • Index(es):
    • Date
    • Thread