Re: NSFileHandle readInBackground vs threading?
Re: NSFileHandle readInBackground vs threading?
- Subject: Re: NSFileHandle readInBackground vs threading?
- From: Ken Thomases <email@hidden>
- Date: Wed, 09 Nov 2011 01:18:23 -0600
On Nov 9, 2011, at 12:45 AM, Kyle Sluder wrote:
> On Tue, Nov 8, 2011 at 9:43 PM, Scott Ribe <email@hidden> wrote:
>> I assume by "local socket" you mean either a UNIX domain socket or just a regular TCP socket on the local machine? If so, just using regular read & write calls there's no way for data to be lost & not delivered just because it's consumed slowly. There's something else going on. Either the sending end is discarding data and not even writing it, or the receiving is losing it after reading it.
>
> The kernel only has a certain amount of buffer space dedicated to each
> incoming TCP port. If the port gets flooded, it drops packets.
But the protocol will compensate and recover. And for purely local TCP, the writer will block rather than "packets" being lost. That is, there aren't any actual packets.
That said, it's conceivable that OP is using UDP and/or datagram Unix-domain sockets, where data loss would be conceivable, but that would be silly in a case where you weren't actually hoping to take advantage of the potential data loss (throw away old data in preference to new data, for example).
Regards,
Ken
_______________________________________________
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