[Top][All Lists]

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

[lwip-users] Changing listen port number on the fly

From: Enrico Murador - Research & Development - CET
Subject: [lwip-users] Changing listen port number on the fly
Date: Tue, 21 Jun 2011 11:22:18 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20110414 Thunderbird/3.1.10

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

reply via email to

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