lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] tcp_enqueue problem, using socket:


From: Jonathan Larmour
Subject: Re: [lwip-users] tcp_enqueue problem, using socket:
Date: Tue, 18 Mar 2008 18:35:11 +0000
User-agent: Thunderbird 1.5.0.12 (X11/20070530)

Piero 74 wrote:
> Hi.
> 
> i'm using socket on lwip 130rc1.
> 
> i have this problem:
> 
> after some send operation, in tcp_enqueue, here:
> 
>   /* If total number of pbufs on the unsent/unacked queues exceeds the
>    * configured maximum, return an error */
>   queuelen = pcb->snd_queuelen;
>   /* check for configured max queuelen and possible overflow */
>   if ((queuelen >= TCP_SND_QUEUELEN) || (queuelen >
> TCP_SNDQUEUELEN_OVERFLOW)) {
>     LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 3, ("tcp_enqueue: too long queue
> %"U16_F" (max %"U16_F")\n", queuelen, TCP_SND_QUEUELEN));
>     TCP_STATS_INC(tcp.memerr);                           
>     pcb->flags |= TF_NAGLEMEMERR;
>     return ERR_MEM;
>   }
> 
> my code loop forever, in this piece of code, with queuelen =
> TCP_SND_QUEUELEN, without send any packet, incremeting err in tcp.memerr

Since I assume your thread is blocked in the send, lwip is trying by itself
to resend the data. You can see how it does this in api_msg.c. The sent_tcp
 function is called when TCP data is really sent. More will be sent if it
needs to be from sent_tcp by calling do_writemore (or indeed, that's how it
will know that all data in the write has finished). The send buffers are
also periodically topped up if they need to be by using the poll_tcp
callback, which also calls do_writemore. This is called from the tcp slow
timer every 500ms.

This will be why you are seeing that code called lots of times. Sometimes
it won't get ERR_MEM, or at least it shouldn't. Unless the connection has
really stalled because the remote end has stopped acking packets.

Jifl
-- 
eCosCentric Limited      http://www.eCosCentric.com/     The eCos experts
 **  Visit us at ESC Silicon Valley <http://www.embedded.com/esc/sv>  **
 **  April 15-17 2008, Booth 3012, San Jose McEnery Convention Center **
Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["Si fractum non sit, noli id reficere"]------       Opinions==mine




reply via email to

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