• 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: CSocket callback keeps giving my Data instead of Read
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >CSocket callback keeps giving my Data instead of Read (From: Ken Baer <email@hidden>)
 >Re: CSocket callback keeps giving my Data instead of Read (From: Douglas Davidson <email@hidden>)

  • Prev by Date: Constant New Port message's
  • Next by Date: RE: Constant New Port message's for MoreSCF
  • Previous by thread: Re: CSocket callback keeps giving my Data instead of Read
  • Next by thread: Constant New Port message's
  • Index(es):
    • Date
    • Thread