Re: CFSocketDataCallBack buffer size
Re: CFSocketDataCallBack buffer size
- Subject: Re: CFSocketDataCallBack buffer size
- From: Douglas Davidson <email@hidden>
- Date: Mon, 23 Sep 2002 14:16:57 -0700
On Friday, September 20, 2002, at 02:13 PM, Aram Greenman wrote:
Is there any way to control the maximum number of bytes read between
CFSocketDataCallBacks? What I want is to get a callback after each
packet is read, instead of in 32K blocks. I think I am missing
something really stupid. Also, if anyone has a better strategy for
this type of problem I am glad to hear it.
With kCFSocketDataCallBack, CFSocket will usually try to read as much
as it can get in a single read(), up to some internal limit. It does
not wait until a certain amount of data is available. You may wish to
try using kCFSocketReadCallBack instead, and do the read() yourself, if
you do not like what you are getting from kCFSocketDataCallBack.
However, if you are using a stream-oriented socket, in general you
should not expect packet boundaries to be evident, no matter what API
you are using.
Douglas Davidson
_______________________________________________
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.