lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re[2]: [lwip-users] TCP transmission stalls


From: Pavel Grishin
Subject: Re[2]: [lwip-users] TCP transmission stalls
Date: Fri, 16 Jun 2006 17:00:41 +0300

But isn't this code self-stabilizing? It fills available buffers and
waits with ERR_MEM until some buffer gets free, fills it and waits
again.

The receiving side is more than simple (I have dropped error handling
code):

while(1){
         recv(client_sock, buf, 200, 0);
         printf("%s\n", buf);
}

It starts quickly outputting some text and then stops.

On Friday, June 16, 2006, 16:27, Kieran Mansley wrote:
KM> On Fri, 2006-06-16 at 15:15 +0300, Pavel Grishin wrote:
>> Hello,
>> 
>> I am running a test program which sends some text continuously.
>> 
>> while(1){
>>         do{
>>                 while(tcp_sndbuf(serv_pcb) < strlen(text));
>>                 err = tcp_write(serv_pcb, text, strlen(text), 0);
>>                 tcp_output(serv_pcb);
>>         }while(err != ERR_OK);
>> }
>> 
>> It transmits a number of times and then stops with err = ERR_MEM.
>> Why does it happen?

KM> Probably because you're sending data faster than the other end is
KM> acknowledging it, so your sender starts to fill its TCP send buffer,
KM> using packet buffers in the process.  After a while, you'll run out of
KM> packet buffers, and it will return ERR_MEM.  This is the cue to back off
KM> and try again later.

KM> Kieran
 



KM> _______________________________________________
KM> lwip-users mailing list
KM> address@hidden
KM> http://lists.nongnu.org/mailman/listinfo/lwip-users





reply via email to

[Prev in Thread] Current Thread [Next in Thread]