|
From: | Noam weissman |
Subject: | [lwip-users] enqueing problem |
Date: | Sun, 27 Mar 2011 15:05:56 +0200 |
Hi all, I have a problem that I have seen lots or users straggling with, but without any real solution. I am trying to send data in a loop. I have triad closing NAGLE as follows: // this should shut down the NAGLE algorithm pcb->flags |= TF_NODELAY | TF_ACK_NOW; I am calling tcp_output() on every tcp_write() but this does not help as well. I got ERR_MEM after the 20th something call to tcp_write() I managed to find in one of the answers here that I should use a smaller window, meaning change the settings in lwipopts.h… So I did, and it was a bit better. /* TCP Maximum segment size. */ //#define TCP_MSS 1460 #define TCP_MSS 512 /* TCP sender buffer space (bytes). */ //#define TCP_SND_BUF (3*TCP_MSS) #define TCP_SND_BUF (8*TCP_MSS) Well the above helped and I was able to send more small packets but after 32 instead of 20 it again It stopped sending and I got ERR_MEM. The most important thing is when I check wireshark I see that the stack is sending all my data in one Frame ??? Now can someone explain what is going on ? For every call to tcp_write the enqueue mechanism is advancing snd_queulen by one ! I see two problems here. If the stack eventually sends all these in one TCP packet why is snd_queulen incremented at all ?? Secondly if I use pcb->flags |= TF_NODELAY why is the stack adding all the data into one packet ?? Your input is more than welcomed. BR, Noam. ************************************************************************************ This footnote confirms that this email message has been scanned by PineApp Mail-SeCure for the presence of malicious code, vandals & computer viruses. ************************************************************************************ |
[Prev in Thread] | Current Thread | [Next in Thread] |