[EMAIL PROTECTED] wrote:
> 
> How  to close lwip? 
> My problem is that i have gprs connection and the coonection is closed by
> peer after every 24h. What i have to do to restart lwip (ppp). I use
> lwip_init() to start connection on ecos platform. I search lwip_close() or
> something like that but now found. Any sugestions?
> before i call lwip_init()  i dial to peer sending to modem at commands
> (ATD... etc.) when i recceive CONNECT then i call lwip_init() he negotiate
> LCP,PAP,IPCP then i have got connection, hov to repeat that step without
> reseting program?

Hello,

LwIP has been implemented such that it starts up fine, but not much thought has 
been given to how to deallocate and destroy it. Indeed, lwip_close() or similar 
does not exist. You are intended to keep the tasks in memory.

I initialise the stack then go into an infinite task command loop as follows:-

lwip_init
pppInit
pppSetAuth
while(1)
{
   <start up low level data link here>
   pppOpen
   <await PPPERR_NONE arg in ppp link status callback>
   <do your TCP/IP app-related stuff here>
   pppClose
}

This works fine in that you can bring the link and PPP up and down repeatedly. 
However, I currently have a problem (you may have seen the mails) whereby if 
the link unexpectedly disappears (not due to pppClose), the TCP/IP layers do 
not seem to be becoming aware that the network has gone. Unfortunately, I don't 
know enought about the stack to know if I'm asking too much to expect this, or 
whether there should be some kind of fail-safe timeout when sending packets 
from the socket API. At the moment, when the network disappears and I have 
ourstanding un-ACKed packets, the app just waits forever... 8-(

Hope this helps in some way, maybe you might have an opinion on my situation.

Kind regards,

Clive Wilson



_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to