Hi all,

I'm writing a TCP/UDP server that should allow the user to change the TCP/UDP listening port number, but I'm not sure what is the best way to do this. I think I have to close the listening pcb bound to the "old" port number, create a new listen PCB and bind the "new" port number to it... But what I have to do with the already active TCP connections?

And if the user "plays around" with port numbers, I think I have to deal with ERR_USE failures on bind() call due to listening connections in TIME_WAIT state (for example, if the port number is changed from 1024 to 1025 and then
re-changed to 1024 without leaving the TIME_WAIT period to elapse).
Can I use SO_REUSEADDR on listening PCBs without compromising reliability, or it is "safer" to wait?

I was thinking if there is a way to change the port that is already bound to a listening TCP pcb, or bound to an UDP pcb, without closing the pcb and creating a new one, and if this could "override" the previous problem.

Thank you very much
Enrico


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

Reply via email to