lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] tcp_recved


From: Kieran Mansley
Subject: Re: [lwip-users] tcp_recved
Date: Wed, 2 May 2012 14:43:58 +0100

On 1 May 2012, at 21:10, Bill Auerbach wrote:

> Is it acceptable or incorrect to call tcp_recved from the receive callback 
> even if the pbuf isn’t freed? I am buffering pbufs in the callback until I 
> have enough to process what has come in.  This buffering could be in the 
> hundreds.  There’s no memory limit – I have 6000 pbufs preallocated.

I think it is best to wait until you're returning the pbuf to the stack.  
tcp_recved() will indicate to the other end that it can now send more data by 
increasing the window size.  If you're holding all the pbufs lwIP might be 
forced to drop packets when they arrive.  If you wait until you free the pbufs 
then the window size will more accurately reflect the amount of buffering 
available.

Kieran


reply via email to

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