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.
_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/lwip-users