|
From: | address@hidden |
Subject: | Re: [lwip-users] TCP_WRITE_FLAG_MORE, tcp_write(), tcp_output() and real output TCP segment |
Date: | Wed, 22 Nov 2017 17:07:45 +0100 |
User-agent: | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
Giuseppe Modugno wrote:
Why do you think all the world would call tcp_output() if it's not useful?
No, it's not. Unacked data is only retransmitted for a 'rexmit' event. To do that, it is moved back to 'unsent' and tcp_output() is called.
Then it is not sent. :-) TCP re-triggers tcp_output() if data is ACKed or new data is received or in a timer, so eventually, more data is sent.
No, tcp_sndbuf() does not know anything about your netif driver.
Yes, of course! If not, I would have deleted it already ;-)
It is, but only at some time later (by tcp_tmr). This drops your throughput, of course.
Yes, data is appended, to unsent segments. However, it's not easy to cite the rules here, as there are many optimizations in this path. In the end, don't try to rely on something here! Another question is about TCP_WRITE_FLAG_MORE flag. I understood this flag should be set in all tcp_write() except the last. However it seems it works with and without that flag in sending data. Of course it works, but pbuf allocation and tcp header flags differ. If it doesn't make a difference for you, you can just set the flag to what you want. Simon |
[Prev in Thread] | Current Thread | [Next in Thread] |