Forum Discussion
Altera_Forum
Honored Contributor
12 years agoNiche "Zero copy" mode trouble: buffer overflow
Hello. I am trying to launch "Zero copy" mode of the TCP data transmission with Niche stack. It seems to be living, but after some amount of packets the transmission buffer overflows (tcp_xou...
Altera_Forum
Honored Contributor
12 years agoI've solved this all and now it works.
The problem was in lack of time for receiving task, so it could not receive ACK frames. I've wrote such code: do { e = tcp_xout(conn->fd, pkt); if (e < 0) { if (e == ENP_RESOURCE) tk_yield(); /* let the system spin once */ else { tcp_pktfree(pkt); return; } } } while (e == ENP_RESOURCE); It works... But it works even slower than using send() function. So, there is no benefit from using "Zero copy", though I am eliminating one copy process of the data. Can anybody help to explain such behaviour? What is wrong?