vincent cui wrote:
All
I develop a FTP server with lwIP 1.3.2 in Cortex M3 platform, when I
use FlashFXP to get file from the server, the tcp_sndbuf always return
0 after work a while .
I capture it with wireshark, the file is attached file. The server ip:
192.168.1.51. it seems that transfer error and need retransmission.
From the wireshark capture, I cannot see why the segment is
retransmitted. Also, at which point do you get tcp_sndbuf==0, and what's
the size of tcp_sndbuf initially?
I'm afraid that doesn't really help on your problem, though :-(
If I were you, I'd first have a look at lwip_stats to see if there are
dropped segments or memory (allocation) failures and then monitor the
value of tcp_sndbuf() (maybe it keeps getting smaller and never grows
again?).
My sendcode in server is below:
[..]
err = tcp_write(pcb, fsd->fifo.buffer + i,
(u16_t)(fsd->fifo.size - i), 1);
Yikes! Using numbers instead of constants is really a thing people
should learn (I'm speaking of TCP_WRITE_FLAG_COPY vs. '1')!
We provide the constants for people to use them so we are free to modify
what they are defined to. By using '1' instead of TCP_WRITE_FLAG_COPY,
you have successfully made your code susceptible to problems with future
versions of lwIP (once we decide to change the value of
TCP_WRITE_FLAG_COPY) :-)
Simon
_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users