Hi All,
I am continuing my colleague work of data transfer using lwip socket to server.
To transfer the DATA to server in continuous certain interval.
Using LWIP 2.0.2 version with PPPos connection.
There
i am facing some issues that after 2 lwip_write where data is
successfully getting transfer to server. But on 3rd try data is not
getting transmitted to server.
So I have debug for this issue, And following is my observation:
1. In this case TCP_MSS is 1460 and TCP_SND_BUF is 2920.
2. First attempt, I am sending data buffer of 512 bytes through lwip_write function. And on server side receiving 512 bytes.
After this operation oversize_left 948 bytes. So 948 bytes memory is available to data copy and transfer
3. In 2nd attempt also, I am successfully sending and receiving 512 bytes. then oversize_left 436 bytes.
4. In 3rd attempt, i am facing issue. where i want to send 512 byte,But available
memory size is 436 bytes. Which is equal to oversize_left 436 bytes.
so tcp_pbuf_prealloc
allocate new 1460 bytes
memory , Out of these 1460 bytes 76 bytes are used to transfer 512 data
bytes(436+76 = 512). After this parameter is pcb->unsent_oversize =
1384 bytes.
But I am not receiving data on server side .
My
observation is once first time allocated 1460 memory gets over after
some data transfer, Newly allocated memory ( To copy data to transfer)
is not getting transfer properly. And data not receiving at server side.
I have tried with different data size also like (128, 256 bytes etc.). And observed same behavior.
Please suggest any changes required and any more debug points needed.
Thanks
Dev