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: narke
Subject: Re: [lwip-users] recv and sent callbacks usage
Date: Thu, 11 Aug 2011 22:10:17 +0800

On 11 August 2011 21:52, Kieran Mansley <address@hidden> wrote:
> 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.
>

Thanks, understood.  If I used the TCP_WRITE_FLAG_COPY option, will
the situation change?


>> 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
>
>
> _______________________________________________
> lwip-users mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/lwip-users
>



-- 
Life is the only flaw in an otherwise perfect nonexistence
    -- Schopenhauer

narke
public key at http://subkeys.pgp.net:11371 (address@hidden)



reply via email to

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