I test the program just on a single Mac machine using TCP, i.e., both the
client and the server are located on the same machine. So I think it is
impossible that the data is corrupted during the transmission.

Thanks so much!
Bing

On Thu, Jun 16, 2011 at 2:57 AM, Scott Ribe <[email protected]>wrote:

> On Jun 15, 2011, at 12:38 PM, Jens Alfke wrote:
>
> > Also also, be aware that creating an NSString from UTF-8 data can result
> in a nil string if the data is not valid UTF-8. This can happen if the
> packet gets corrupted in transit or if something else is accidentally or
> maliciously sending unexpected data to your port. To be robust, your code
> should detect this and (probably) just ignore the packet.
>
> So, come to think of it, what if the packet breaks in the middle of a
> multi-byte sequence?
>
> --
> Scott Ribe
> [email protected]
> http://www.elevated-dev.com/
> (303) 722-0567 voice
>
>
>
>
>
_______________________________________________

Cocoa-dev mailing list ([email protected])

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 [email protected]

Reply via email to