[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] Raw TCP Client - wait for ACK after each packet causes
From: |
Sergio R. Caprile |
Subject: |
Re: [lwip-users] Raw TCP Client - wait for ACK after each packet causes slowdown |
Date: |
Fri, 30 Jun 2017 13:10:22 -0300 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 |
Not "probably" ;^) Effectively tcp_sent() is called when an ACK arrives.
That is what the docs say and how TCP works.
No need to do it timely, though.
Perhaps the idea is something like this:
Oh, I need to send something now.
Is there any room ?
Yes -> Fill as much buffer as I can
No -> Oops, will try later
I'm done
tcp_sent():
Is there anything left to be sent ?
Yes -> Fill as much buffer as I can
No -> OK, I'm done, let's have some rest
Return
"try later" can be done by means of your app resources or using
tcp_poll() callback, depending on your urge and cpu management needs.
you check the room with tcp_sndbuf(), not MSS. If that does not work,
there is something in the config that is not OK and that is over my
head. In such a case we should poll one of the wizards.
tcp_output() instructs tcp to hurry up and send now. Otherwise, "he"
thinks what is best for everyone ("he" knows better) and will send at
will; probably waiting for the entire buffer to fill, since no one told
"him" that info was to be treated as urgent.