[Top][All Lists]
[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 21:47:43 +0800 |
On 11 August 2011 21:15, Kieran Mansley <address@hidden> wrote:
> On Thu, 2011-08-11 at 21:11 +0800, narke wrote:
>> Hi,
>>
>> I have a few questions about the raw api:
>>
>> 1. When a connection received 3 segments, how many times the recv
>> callback will be called?
>> 2. After continuously did 3 times of tcp_write, how many times the
>> sent callback will be got called after all the data have been sent out
>> and acknowledged?
>
> I think both of the above are undefined by the API. I.e. you shouldn't
> rely on any particular behaviour. You may get called once, you may get
> called 3 times, you may get called more.
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?
In above example, is that possible I got a sent callback with a len
that is not a multiple of 100?
>
>> In the sent callback, how do I understand and use
>> the 'len' argument?
>
> It tells you how many bytes have been sent and acknowledged, and so you
> no longer need to maintain the next "len" bytes of data as valid.
>
Why I need to keep maintain this 'len' of bytes after I pass it to
tcp_write? I don't need to worry about resenting things, right? It
should be a job of lwIP.
> 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)
- [lwip-users] recv and sent callbacks usage, narke, 2011/08/11
- Re: [lwip-users] recv and sent callbacks usage, Kieran Mansley, 2011/08/11
- Re: [lwip-users] recv and sent callbacks usage,
narke <=
- Re: [lwip-users] recv and sent callbacks usage, Kieran Mansley, 2011/08/11
- [lwip-users] lwip socket is stable, vincent cui, 2011/08/11
- Re: [lwip-users] lwip socket is stable, Kieran Mansley, 2011/08/11
- Re: [lwip-users] lwip socket is stable, vincent cui, 2011/08/11
- Re: [lwip-users] lwip socket is stable, Kieran Mansley, 2011/08/11
- Re: [lwip-users] lwip socket is stable, vincent cui, 2011/08/12
- Re: [lwip-users] lwip socket is stable, FreeRTOS Info, 2011/08/12
- Re: [lwip-users] lwip socket is stable, vincent cui, 2011/08/14
- Re: [lwip-users] lwip socket is stable, Felipe de Andrade Neves L., 2011/08/15
- Re: [lwip-users] lwip socket is stable, vincent cui, 2011/08/15