[ee122] question about buffer

Lisa Fowler fowler at eecs.berkeley.edu
Fri Nov 16 13:32:33 PST 2007


On Nov 16, 2007 1:29 PM, Davide Cerri <davide.cerri at gmail.com> wrote:
> Hello,
> how do we handle the buffer?
> I mean, we have our windowsize, and whenever we receive a packet, we
> free the window slot and we copy the data to some buffer. Whenever
> somebody calls myreceive, we return the content of that buffer.
> Here's the questions:
> 1 - do we return the content of the buffer if and only if we received
> all the packages, so the buffer is not a partial transmission?

That's up to you.  You want it to be as close to how TCP worked
(rather, what your HTTP server/client expects).  TCP doesn't
necessarily provide everything all at once, and neither do you.

> 2 - what do we do if somebody is sending a crazy amount of data (ex
> 1tb)? that can't obviously be stored in a buffer?

That's what flow control is for :)  Use it with the above notion.


-Lisa


More information about the ee122 mailing list