Hi Sergio,

Per your suggestion, I took a closer look at the port and my codes

I am on TiVa/lwip platform.

1) The timer seems to work fine, sys_now() returns correct ms counts (I can't rule out the hardware induced glitch due to TI design flaw).

   So I don't understand why calling sys_check_timeouts without any
   delay yields a poorer performance than calling it or tcp_tmr at
   250ms pace.


2) I read http://lwip.wikia.com/wiki/Raw/TCP and the example https://github.com/MCUapps/lwip-gnu/blob/master/STM32F4DIS-BB/tcp_echo_server/src/tcp_echoserver.c again.

   I think tcp_sent callback is only an option, not a requirement, in lwip.

   So I think it is OK to use the following flow:

   use tcp_sndbuf to check available buffer
   use tcp_write to write data to queue
   finally use tcp_output to send out data asap.

   Is my understanding correct?


Thanks for your help!

Chen

On 7/7/2015 12:00 PM, lwip-users-requ...@nongnu.org wrote:



------------------------------

Message: 5
Date: Mon, 06 Jul 2015 17:13:34 -0300
From: "Sergio R. Caprile" <scapr...@gmail.com>
To: lwip-users@nongnu.org
Subject: Re: [lwip-users] Retransmit too quick?
Message-ID: <559ae16e.2020...@gmail.com>
Content-Type: text/plain; charset=utf-8

Again, you should check how you are handling timers in your port.
sys_check_timeouts() needs a consistent time base, it expects you
provide a sys_now() function which returns time in milliseconds.
You should call sys_check_timeouts() from your main loop as frequently
as possible so it does its jobs, it will take care of time by using
sys_now().

Sorry, I can't check/follow your code, you should send the first block
when you need it and following blocks will be sent via the tcp_sent()
callback, check the examples.
And, you should not be freeing pbufs the way you are doing in
echo_recv(), please check the examples and the wiki
http://lwip.wikia.com/wiki/Raw/TCP







------------------------------

_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

End of lwip-users Digest, Vol 143, Issue 6
******************************************


_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to