lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Will a TCP stream fail or be halted?


From: Kieran Mansley
Subject: Re: [lwip-users] Will a TCP stream fail or be halted?
Date: Thu, 16 Dec 2004 12:30:42 +0000

On Thu, 2004-12-16 at 12:39 +0100, Per Strand wrote:
> Hi,
> 
> I've haven't started to implement the lwIP stack yet but I already got
> one question.
> 
> The memory capacity in my embedded device will be limited and if I
> assume correct lwIP relies on malloc() (and some other block oriented
> alloc function?) for buffering a "TCP stream" onto the lwIP stack.
> 
> What happens if I cannot 'consume' the TCP stream at the same speed as
> it's is received. What will happen?
> Will there be an error, or will the malloc() fail result in that the
> stream is halted until there there is enough free memory on the heap?

TCP uses window based flow control to prevent the sender transmitting
faster than the receiver can cope.  Effectively the receiver tells the
sender how much memory it has to receive packets into, and the sender
can not send more than that until the receiver updates it.

lwIP has a couple of different ways of managing memory, depending on how
sophisticated your operating system (or lack of operating system!) is.
Most simply, if you can use malloc() or similar, it can do that.
Alternatively it can manage its own heap, both for packet data and for
many internal data structures.

Hope that helps,

Kieran





reply via email to

[Prev in Thread] Current Thread [Next in Thread]