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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to