Re: Event driven CFStream protocol in 10.1?
Re: Event driven CFStream protocol in 10.1?
- Subject: Re: Event driven CFStream protocol in 10.1?
- From: Becky Willrich <email@hidden>
- Date: Tue, 11 Jun 2002 18:29:13 -0700
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.