Re: NSFileHandle and Data Integrity
Re: NSFileHandle and Data Integrity
- Subject: Re: NSFileHandle and Data Integrity
- From: Jens Alfke <email@hidden>
- Date: Fri, 10 Jun 2011 14:30:31 -0700
On Jun 10, 2011, at 2:16 PM, Tony S. Wu wrote:
> I have a simple client-server application. I use NSFileHandle to handle the communication between client and server. However, NSFileHandle doesn't seem to have any sort of guarantee on data integrity because when I try to send large amount of data over the network, packets will get dropped resulting in damaged data. What would be an ideal way to stop this from happening? I'd appreciate any recommendation.
Can you describe the code you’re using to do this? I assume you end up creating a TCP socket between the two hosts, and that will send data reliably. If you’re losing data, you may not be writing or reading the data correctly.
You can look at Apple’s CocoaEcho sample code to see how to implement TCP data communications. Or at a higher level, I wrote a whole framework to make this kind of stuff easier: <http://bitbucket.org/snej/mynetwork>.
—Jens
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden