Hi all,
I develop a device which receives data from host machine using TCP (LwIP
1.4.1). Host sends data continuously queuing it to the controller.
Controller process data as fast as possible, but data process time is
not determined. it can be from milliseconds to hours. And I wish to use
TCP/IP incoming buffer as buffer for the data.
In my case TCP window on the device becomes full very often. Sometimes
device's application receives from the TCP stack portion of data less
than TCP windows size. This case LwIP doesn't update receive window
leaving it zero. But the device able to receive some bytes now. And when
the host sends 1 byte ZeroProbe packet device receives it.
For this one byte LwIP allocates new pbuf structure and sends it to
application using sys_mbox_xxx call.
I use fixed-size mbox queues so after some probe packets from the host
mbox becomes full and refuses new data. tcp_input notices this and tries
to deliver refused data to the application every time it called.
But if application still refuses new data tcp_input() doesn't send ACK
to the host! And host disconnects after some tries.
Making my mboxes dynamically doesn't solve the problem because in
general we can waste all RAM with (TCP_WND-1) pbuf structures for every
incoming byte from window probe packets.
I think it would be better to ACK with previous value to the host
instead of silently dropping new data. What do you think about the
issue? What is the best way to avoid disconnects in my project?
--
Best regards, Oleg
_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users