• 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: CFSocket callback question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CFSocket callback question


  • Subject: Re: CFSocket callback question
  • From: Quinn <email@hidden>
  • Date: Tue, 5 Apr 2005 22:55:08 +0100

At 14:41 -0700 5/4/05, Ken Baer wrote:
I have a question regarding the network messages that are interpreted by the callback function set up when you create a new CFSocket. I have been using the kCFSocketDataCallBack callback type to read incoming data. I save that data, send a message and process that data. But what is the kCFSocketReadCallBack callback type used for? This has never been very clear to me. Can someone help enlighten me on this?

This is covered pretty well by the comments at the top of "CFSocket.h".

If kCFSocketReadCallBack is used, then data will not be
automatically read, but the callback will be called when data
is available to be read, or a new child socket is waiting to be
accepted.

[...]

If kCFSocketDataCallBack is used, then data will be read in chunks
in the background and passed to the callback, with the data argument
being a CFDataRef.

So, kCFSocketReadCallBack reads the data for you, and kCFSocketDataCallBack doesn't. The latter is particularly important for record oriented communications, like UDP.


S+E
--
Quinn "The Eskimo!"                    <http://www.apple.com/developer/>
Apple Developer Technical Support * Networking, Communications, Hardware
_______________________________________________
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: 
 >CFSocket callback question (From: Ken Baer <email@hidden>)

  • Prev by Date: CFSocket callback question
  • Next by Date: Re: CFSocket callback question
  • Previous by thread: CFSocket callback question
  • Next by thread: Re: CFSocket callback question
  • Index(es):
    • Date
    • Thread