[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] problem tcp_enqueue
From: |
Nicolas Dioli |
Subject: |
[lwip-users] problem tcp_enqueue |
Date: |
Tue, 11 May 2010 10:02:43 +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 |
Hello everybody,
I have a problem with RAW API.
I have a memory error when i do a tcp_enqueue() after 70 bytes.
here is my code:
for(i=0;i<6;i++){
tcp_write(tcp1, "1234567890" , 10,
TCP_WRITE_FLAG_COPY); //No error
tempo_ms(50);
}
tcp_output(tcp1);
//60 bytes sent
err=tcp_write(tcp1, "ABCDEFGHIJ" , 10,
TCP_WRITE_FLAG_COPY); //No error
err=tcp_output(tcp1);
//10 bytes sent
err=tcp_write(tcp1, "1234567890" , 10,
TCP_WRITE_FLAG_COPY); //MEM_ERROR
err=tcp_output(tcp1);
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.