lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] RE: Why the tcp_pcb haven't been free when I calltcp_cl


From: Kieran Mansley
Subject: Re: [lwip-users] RE: Why the tcp_pcb haven't been free when I calltcp_close()
Date: Fri, 16 Mar 2007 16:09:46 +0000

On Fri, 2007-03-16 at 23:48 +0800, geckook Xu wrote:
> But the tcp_pcb haven't been free for a long time,and my stack can not work.

How long is a long time?  It should take two minutes to timeout from the
TIMEWAIT state if you haven't changed the default configuration for
TCP_MSL.

> When I add a new thread to do with the received data, then the tcp_pcb
> would be free. In this cast, I use the message box to communicate
> between the stack and the other thread. But when the tcp_pcb have been
> exhausted,  message box will block for a long time (about 2 seconds).
> What is the metter?
> but when I do with the received data in the tcp_rcvd callback
> function, In this case, the tcp_pcb couldn't be free.
> Are there anything should be take attention to?

Sounds like it's possible your the timeouts aren't happening properly.
Are you calling tcp_tmr() (or alternatively tcp_slowtmr() and
tcp_fasttmr() directly) as described in the doc/rawapi.txt?

"When the system is running, the two timer functions tcp_fasttmr() and
tcp_slowtmr() must be called with regular intervals. The tcp_fasttmr()
should be called every TCP_FAST_INTERVAL milliseconds (defined in tcp.h)
and tcp_slowtmr() should be called every TCP_SLOW_INTERVAL milliseconds"

The tcp_tmr() function simplifies things slightly.  If you call this
every TCP_FAST_INTERVAL it will call the other two at appropriate times.

Kieran





reply via email to

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