lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] shutdown sequence?


From: Jonathan Larmour
Subject: Re: [lwip-users] shutdown sequence?
Date: Thu, 30 Oct 2008 10:47:14 +0000
User-agent: Thunderbird 1.5.0.12 (X11/20070530)

address@hidden wrote:
> 
> Hey Guys,
> 
> I was just wondering: is there a defined shutdown sequence for LwIP?
> I need to be able to completely shut down all LwIP Threads and release
> all memory and resources that were hogged.
> 
> I didn't find any function for that.

There isn't. On most embedded systems when you start the TCP/IP stack you
never stop it.

A lot of the memory that lwIP uses comes from statically allocated pools,
so you wouldn't be able to free those (without code modifications to maybe
use malloc instead for the pools).

> My plan so far is to have a handle list for all resources that are
> allocated via the sys_arch layer. I already have a linked list of all
> threads that LwIP might create.
> Is there any better way to do that?

Once you have shut down all your open sockets, including listeners, and
brought down the interface and driver so that there can be no more incoming
packets - all things which can be done using normal lwIP APIs - I guess
there probably aren't many resources left. You could look at enabling
LWIP_STATS to find out what is left in that situation.

Jifl
-- 
eCosCentric Limited      http://www.eCosCentric.com/     The eCos experts
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]