• 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: NSFileHandle and Data Integrity
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >NSFileHandle and Data Integrity (From: "Tony S. Wu" <email@hidden>)

  • Prev by Date: Re: changing file name when copying a file in the same directory
  • Next by Date: popUpStatusItemMenu - how to highlight the NSStatusItem
  • Previous by thread: NSFileHandle and Data Integrity
  • Next by thread: popUpStatusItemMenu - how to highlight the NSStatusItem
  • Index(es):
    • Date
    • Thread