Forum Discussion
Altera_Forum
Honored Contributor
19 years ago --- Quote Start --- originally posted by laplace@Jul 28 2006, 04:22 AM i 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
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=17221)
--- quote end ---
--- Quote End --- Ha, I think you're right. The source code mentions that tcp_output should be called after tcp_write to force the data to be sent now. The raw_api.txt file doesn't mention that. I had been doing 1400 bytes before because tcp_sndbuf returns something like 32768 bytes. I didn't realize it would break it up for me and send it out. I'll look into using the sockets API when I rewrite this whole mess though. Right now it's a heavily modified version of the simple socket server and it could use a ground-up refactoring. Thanks!