Forum Discussion
Altera_Forum
Honored Contributor
20 years agoWhy is sending tcp so much slower than receiving?
I have some code running under uC-OS that receives a file via TCP and then writes it to flash. This is very quick, a 4MB file is received in 20 seconds or so. I then have another piece of code that d...
Altera_Forum
Honored Contributor
20 years agoI think the problem is, that when you call tcp_write with only 1400Bytes of data, the Nagle-algorithm keeps the segment (which is not full) from being sent immediatly. One way of solving the problem is disabling the Nagle-algorithm by setting the TF_NODELAY, the other (better) way is to call tcp_write with the size that tcp_sndbuf returns.
Greetings Laplace