[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] lwip-users Digest, Vol 143, Issue 18
From: |
Xun Chen |
Subject: |
Re: [lwip-users] lwip-users Digest, Vol 143, Issue 18 |
Date: |
Fri, 24 Jul 2015 16:52:21 -0400 |
User-agent: |
Mozilla/5.0 (Windows NT 5.1; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 |
Hi Sergio,
Thanks for your pointer and patience!
After some debugging and tracking, I found the problem. I am writing to confirm
the problem is neither in lwip nor the port, but the communication between the
remote side and my codes, since this is my first try with callback, I didn't
handle things properly.
Here is what happened (simplified):
The program is like a data pump to convey data to the remote side at 200kb/sec
rate. On the first call to tcp_write, I write 3000 bytes, so after two packets
of 1460 bytes, or 2920 bytes, I get an ACK from remote and the tcp_sent
callback is invoked. At this point, I have only 300 points. Adding the 80 bytes
from previous tcp_write, 380 bytes are sent out by lwip.
Now the remote side is waiting for the second TCP packets before it ACKs
There is NO second packet since I only use callback to send out data (my
previous approach that is not relying on callback will work fine here, but it
eventually gives me problem and I switched to callback approach per your
suggestion)
Finally the remote side ACK the last odd packet after waiting for 200ms, and
now I have A LOT of data in queue for tcp_write, so I observe the pause in my
data stream, this cycle repeats
I don't lose any data, but the GUI is very jerky due to this 200ms pause.
I can work around it with tricks, but maybe you can give me a better pointer on
how to deal with the problem so that I can get tcp_sent callback in a nice pace
for smooth data display.
Thanks and have a nice weekend!
Chen
Date: Fri, 24 Jul 2015 10:58:31 -0300
From: "Sergio R. Caprile"<address@hidden>
To:address@hidden
Subject: Re: [lwip-users] lwip-users Digest, Vol 143, Issue 10
Message-ID:<address@hidden>
Content-Type: text/plain; charset=utf-8
tcp_sent() is called when a frame arrives, your port notices it and
dispatches to lwIP, and it reckons it is a TCP ACK. All your timing woes
depend mainly on your port, as me and many others don't see that in ours
and we all run the same lwIP.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [lwip-users] lwip-users Digest, Vol 143, Issue 18,
Xun Chen <=