Re: CSocket callback keeps giving my Data instead of Read
Re: CSocket callback keeps giving my Data instead of Read
- Subject: Re: CSocket callback keeps giving my Data instead of Read
- From: Ken Baer <email@hidden>
- Date: Fri, 7 Oct 2005 13:24:22 -0700
On Oct 6, 2005, at 5:50 PM, Douglas Davidson wrote:
The header comments are pretty explicit here: kCFSocketReadCallBack,
kCFSocketAcceptCallBack, and kCFSocketDataCallBack are mutually
exclusive. You get to pick at most one of these. In particular, you
can't use both kCFSocketReadCallBack and kCFSocketAcceptCallBack (as a
glance at the constants should tell you).
OK, I knew that the Data and Read callbacks were mutually exclusive,
but not the Accept callback as well. Unfortunately, the default flags
set both the Read and Accept callbacks in the code I'm porting. I had
to make a couple new functions that specify whether it's a server or
listening socket, but it did work. This is definitely something to be
aware of for anyone porting WinSock based code over to the Mac.
Also, it says quite clearly that you should not disable callbacks that
your CFSocket does not possess, so don't try to disable
kCFSocketDataCallBack if you're not using it.
I removed it now that the other conflict is resolved.
Thanks!
-Ken Baer.
Hash, Inc.
email@hidden
_______________________________________________
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