lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Confused about flow control


From: Kieran Mansley
Subject: Re: [lwip-users] Confused about flow control
Date: Mon, 27 Jul 2009 15:01:08 +0100

On Mon, 2009-07-27 at 06:39 -0700, JM wrote:
> 
> -If I have space in my buffer, I take the data, then call tcp_recved()
> and pbuf_free().

Yes.

> -If there currently is not enough space in my buffer, I store the pbuf
> pointer for later.  I haven't tried this yet, but should I also call
> tcp_recved() with len=0?

No need to call tcp_recved in that case.

> -I periodically check if there's space in my buffer.  When there is, I
> retrieve the data from the pbuf pointer I stored.  Then I call
> tcp_recved() and pbuf_free().

Yes.  Make sure you handle a chain of pbufs, not just a single one (i.e.
look at pbuf->tot_len and pbuf->next)

> I had planned on using tcp_poll() to do the periodic buffer checking,
> but it's a little slow (500ms).  Is it Ok if I instead do this in the
> ethernet/periodic interrupt before lwIP runs

Don't know.  Probably.

Kieran





reply via email to

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