• 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: After Autoreleasing Still Getting Leaked
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: After Autoreleasing Still Getting Leaked


  • Subject: Re: After Autoreleasing Still Getting Leaked
  • From: Wade Williams <email@hidden>
  • Date: Wed, 15 Jun 2011 14:18:51 -0500

Bing,

That's not the point.  The point is a program has to be ready to handle the possibility of corrupted, truncated or fragmented data.

Writing a client-server program, particularly at the socket level, is not easy for that very reason.  If you fail to take the possibilities into account, you may well be coming back to the list saying "my program is crashing and I don't know why."

Wade
On Jun 15, 2011, at 2:04 PM, Bing Li wrote:

> 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@hidden>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@hidden
>> http://www.elevated-dev.com/
>> (303) 722-0567 voice
>>
>>
>>
>>
>>
> _______________________________________________
>
> 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

_______________________________________________

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: 
 >After Autoreleasing Still Getting Leaked (From: Bing Li <email@hidden>)
 >Re: After Autoreleasing Still Getting Leaked (From: Scott Ribe <email@hidden>)
 >Re: After Autoreleasing Still Getting Leaked (From: Bing Li <email@hidden>)
 >Re: After Autoreleasing Still Getting Leaked (From: Scott Ribe <email@hidden>)
 >Re: After Autoreleasing Still Getting Leaked (From: Jens Alfke <email@hidden>)
 >Re: After Autoreleasing Still Getting Leaked (From: Scott Ribe <email@hidden>)
 >Re: After Autoreleasing Still Getting Leaked (From: Bing Li <email@hidden>)

  • Prev by Date: [iOS] What's the point of UISegementedControl.tintColor?
  • Next by Date: Re: [iOS] What's the point of UISegementedControl.tintColor?
  • Previous by thread: Re: After Autoreleasing Still Getting Leaked
  • Next by thread: Re: After Autoreleasing Still Getting Leaked
  • Index(es):
    • Date
    • Thread