[gameprogrammer] Re: TCP output buffer size

  • From: Jason Harrison <drjasonharrison@xxxxxxxxx>
  • To: gameprogrammer@xxxxxxxxxxxxx
  • Date: Sun, 8 Mar 2009 16:43:30 -0700

This sort of question is answered well at stackoverflow.com.

The answer is to pick a block size (trial and error) and then loop.
The protocol is to send first the size of the transmission, then send
the blocks.  Win32 implementation of recv fails on the last call for
some block sizes unless you request exactly the correct number of
remaining blocks.  You can find my question about this on
stackoverflow.com

-Jason

On 3/7/09, Chris Nystrom <cnystrom@xxxxxxxxx> wrote:
> On Sat, Mar 7, 2009 at 7:19 PM, Kevin Jenkins <gameprogrammer@xxxxxxxxxx> 
> wrote:
> >
> > I want to send a very large file by TCP. If I send the whole file at once...
>
> Why send the whole file at once? Why not send the file in 1K blocks or
> something? Your  internal looping is going to be faster than your
> network i/o.
>
> Chris
>
> --
> E-Mail: Chris Nystrom <cnystrom@xxxxxxxxx>
> Saving the world from web programming.
> http://www.newio.org - G-Talk: cnystrom
>
> ---------------------
> To unsubscribe go to http://gameprogrammer.com/mailinglist.html
>
>
>


-- 
Jason Harrison, PhD
Software Engineering and Research
Human Factors
Project Management

Cell: 604 644 8611
Email: drjasonharrison@xxxxxxxxx
LinkedIn: http://www.linkedin.com/in/drjasonharrison
Twitter: http://twitter.com/drjasonharrison

Thanks to Yggy King for bringing this quote to my attention:
Thinking the world should entertain you leads to boredom and sloth.
Thinking you should entertain the world leads to bright clothes, odd
graffiti and amazing grace in running for the bus. -- Ann Herbert

---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: