lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Changed IP address during runtime but TCP PCB stuck tim


From: Dirk Ziegelmeier
Subject: Re: [lwip-users] Changed IP address during runtime but TCP PCB stuck time wait state
Date: Mon, 17 Dec 2018 21:22:09 +0100

Ich you listen to an ANY IP address, then rebinding the netconn should not be necessary. Otherwise, check SO_REUSE. 

Dirk



On Mon, Dec 17, 2018 at 4:40 AM uaz <address@hidden> wrote:
Hi All,

I am doing a webserver that allows users to change device ip address during
runtime (no power reset required).
I've tried 2 ways of doing so:
1. netif_set_addr()
2. netif_remove() and then netif_add() a new interface with the new ip
address

In both methods, I will re-init my http server:
1. netconn_close()
2. netconn_delete()
3. Create a new netconn: netconn_new()
4. Bind to http port: netconn_bind()

Unfortunately, netconn_bind() to port 80 will fail because apparently the
previous pcb bound to port 80 is still there, in time wait state (lwip will
not allow multiple sockets listening to the same port).

How do I make sure the previous pcb is completely deleted or freed?

Thanks




--
Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html

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

reply via email to

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