lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] recv and sent callbacks usage


From: Kieran Mansley
Subject: Re: [lwip-users] recv and sent callbacks usage
Date: Thu, 11 Aug 2011 14:52:45 +0100

On Thu, 2011-08-11 at 21:47 +0800, narke wrote:
> For the 2nd question, if I called tcp_write 3 times, each time with a
> 100 bytes pbuf, and I when I got the first call of sent callback with
> a len argument equals to 100, should I prepare myself to resent the
> last two 100 bytes pbuf again?

No, you should never need to resend anything; lwIP will deal with the
retransmission if necessary.  You just have to retain the data you've
sent until lwIP tells you (using the sent callback) that is has finished
with it.  You can then overwrite it or free it or do whatever you like.
When you get the first callback with len=100 that tells you that you can
release the first 100 bytes, but that the remaining 200 bytes must still
be preserved.

> In above example, is that possible I got a sent callback with a len
> that is not a multiple of 100?

Yes, and this is actually quite likely once you have more data in
flight.  

Kieran




reply via email to

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