Re: TCP sockets with Bonjour-discovered address
Re: TCP sockets with Bonjour-discovered address
- Subject: Re: TCP sockets with Bonjour-discovered address
- From: Carl Hoefs <email@hidden>
- Date: Tue, 15 Jul 2014 10:00:13 -0700
On Jul 15, 2014, at 9:49 AM, Quinn The Eskimo! <email@hidden> wrote:
> However, my expectation is that the documentation /demonstrates/ 1 KiB reads and writes, in which case that's just an example. In general doing I/O in larger blocks results in better performance, and this is no exception.
Yes, you are quite correct! The Stream Programming Guide chooses 1024-byte blocks in its example code, for reasons which aren't explained. "Then it declares a buffer of a certain size (1024 bytes, in this case) and invokes the stream object’s read:maxLength: method." I erred in assuming there was some magic in the number (with networking code, sometimes there is). Your general guideline about doing I/O in larger blocks is borne out by what I'm seeing during testing. Nice to know I'm not wandering totally out of the ballpark just yet...
Thx,
-Carl
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden