Il 01/08/2014 20:35, Sergio R. Caprile ha scritto:
> Hi,
> when you say "echo example", do you mean the echo example in the contrib
> tree or some vendor distributed (and probably modified) file ?
> 'cause i've run the echo example from the 1.4.1 contrib tree some weeks
> ago and I don't recall seeing anything strange.
> And btw, I don't see anything close to what you are describing in that
> code, and there is only one tcp_write() call in echo.c:
>
> [scaprile@Hal ~]$ grep -n tcp_write
> programming/lwip/contrib/apps/tcpecho_raw/echo.c
> 311:  wr_err = tcp_write(tpcb, ptr->payload, ptr->len, 1);
yes, it isn't the only one directly called but if you search for
echo_send() you will find it in echo_recv(), echo_poll(). echo_sent().

The code is exactly that, the port is that for LPC176x. The port is
working perfectly but every echo message is sent 2 times, the 1st is
correct but the second call to tcp_write() cames from the call to
echo_send() inside echo_sent(). Debugging the situation I found that
pbuf_free() is correctly called but the pointer to pbuf (es->p) is not
NULL.

So seems that the effect of the problem is quite clear but is not clear why.

What I can say is that if I want to send a message, it will be copied to
a pbuf and this pbuf in some way will be only enqueued to be
transmitted, right?

Supposing that I write 3 messages, I should call tcp_write() 3 times so
at least 3 pbufs will be enqueued. Considering that messages are really
sent calling tcp_output() that it is called in tcp_fasttmr() and in
tcp_slowtmr() I really don't understand why inside the sent callback the
pbuf pointer is checked and the message re-sent if the pointer is not
null... that it is the last message enqued and this doesn't mean that it
is always the 1st message that will be sent.

I simply think that the call to echo_send() inside the sent callback is
totally wrong .
>
> BTW, if you want to really test the net throughput (or at least come
> closer) get the netio patch: https://savannah.nongnu.org/patch/?7026
>
> Regards
>




logo
        *

Massimo Manca*/, Micron Engineering/
via della Ferriera, 48 33170 Pordenone PN ITALIA
Tel: 39 0434 1856131| Mobile: 39 349 4504979
www.micronengineering.it

Twitter
<http://s.wisestamp.com/links?url=https%3A%2F%2Ftwitter.com%2Fmassimomanca>
LinkedIn
<http://s.wisestamp.com/links?url=http%3A%2F%2Fit.linkedin.com%2Fpub%2Fmassimo-manca%2F7%2Fa15%2F479%2F>
SlideShare
<http://s.wisestamp.com/links?url=http%3A%2F%2Fwww.slideshare.net%2Fmicronpn>
Contact me: Skype micron.engineering
Designed with WiseStamp -
<http://s.wisestamp.com/links?url=http%3A%2F%2Fr1.wisestamp.com%2Fr%2Flanding%3Fu%3Daaa0e17b0c4ca423%26v%3D3.13.31%26t%3D1406923781901%26promo%3D10%26dest%3Dhttp%253A%252F%252Fwww.wisestamp.com%252Femail-install%253Futm_source%253Dextension%2526utm_medium%253Demail%2526utm_campaign%253Dpromo_10>Get
yours
<http://s.wisestamp.com/links?url=http%3A%2F%2Fr1.wisestamp.com%2Fr%2Flanding%3Fu%3Daaa0e17b0c4ca423%26v%3D3.13.31%26t%3D1406923781901%26promo%3D10%26dest%3Dhttp%253A%252F%252Fwww.wisestamp.com%252Femail-install%253Futm_source%253Dextension%2526utm_medium%253Demail%2526utm_campaign%253Dpromo_10>


---
Questa e-mail è priva di virus e malware perché è attiva la protezione avast! 
Antivirus.
http://www.avast.com

<<attachment: m_manca.vcf>>

_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to