[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] problem tcp_enqueue
From: |
Nicolas Dioli |
Subject: |
Re: [lwip-users] problem tcp_enqueue |
Date: |
Wed, 12 May 2010 09:15:23 +0200 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.1.9) Gecko/20100317 Lightning/1.0b1 Thunderbird/3.0.4 |
Le 11/05/2010 18:38, address@hidden a écrit :
Nicolas Dioli wrote:
I think there is no free memory after output because of that:
#define TCP_SND_QUEUELEN (8 *
(TCP_SND_BUF)/(TCP_MSS)) = 8*512/536 =7.6
So when i arrived at this test:
/* check for configured max queuelen and possible overflow */
if ((queuelen>= TCP_SND_QUEUELEN) || (queuelen>
TCP_SNDQUEUELEN_OVERFLOW)) {
i have a queuelen of 7 and i return an ERR_MEM.
That's correct. So why don't you just increase TCP_SND_QUEUELEN if you
really want to enqueue that many pbufs before sending? After all, that
setting looks a little low for what you are doing.
Simon
Yes of course but queuelen doesn't decrease or reset, after tcp_output().:
for(i=0;i<6;i++){
tcp_write(tcp1, "1234567890" , 10, TCP_WRITE_FLAG_COPY);
//queuelen =0 --> queuelen =6
}
tcp_output(tcp1);
//queuelen =6
err=tcp_write(tcp1, "ABCDEFGHIJ" , 10, TCP_WRITE_FLAG_COPY);
//queuelen=6 --> queuelen =7
err=tcp_output(tcp1);
//queuelen =7
err=tcp_write(tcp1, "1234567890" , 10, TCP_WRITE_FLAG_COPY);
//queuelen =7 --> ERR_MEM
err=tcp_output(tcp1);
Is it normal that lwip keep in memory data already sent ??
Can i force queuelen to 0 after tcp_output() ?
Nicolas