Re: Optimal read buffer size?
Re: Optimal read buffer size?
- Subject: Re: Optimal read buffer size?
- From: Justin Walker <email@hidden>
- Date: Wed, 18 May 2005 11:35:35 -0700
On May 18, 2005, at 11:06, Chaz McGarvey wrote:
I find that when I write network code, I never really know how big I
should make the read buffer. Some protocols have only short packets
so I usually have a pretty small buffer, or only read in one packet at
a time, but if I'm reading in a very big packet like a mult-megabyte
resource download that I'm writing to disk, is there a sweet spot that
requires the fewest read calls and doesn't waste (much) memory?
There is no such thing. First, your app doesn't worry about packets,
unless you are dealing with a datagram-based protocol (and generally,
those have limited packet size); and second, the kernel handles all the
buffering, and deals with it in a much different way than you do in an
application.
What are your concerns?
Regards,
Justin
--
Justin C. Walker, Curmudgeon at Large
Institute for General Semantics
-----------
My wife 'n kids 'n dog are gone,
I can't get Jesus on the phone,
But Ol' Milwaukee's Best is my best friend.
-----------
_______________________________________________
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