Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Must you read all you can on kCFStreamEventHasBytesAvailable?



If you're using a CFReadStream in the non-blocking mode, and your callback receives kCFStreamEventHasBytesAvailable, what happens if you don't consume all the bytes that are available? In the best of all possible worlds, you'd get another kCFStreamEventHasBytesAvailable message. The sample code in the CFNetwork Programming Guide seems to suggest that is so, because it just reads what fits in one buffer on kCFStreamEventHasBytesAvailable. In contrast, CFFTPSample takes pains to keep reading until either CFReadStreamHasBytesAvailable returns false or CFReadStreamRead reads 0 bytes.
--
James W. Walker, ScriptPerfection Enterprises, Inc.
<http://www.write-brain.com/>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/macnetworkprog/email@hidden


This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.