I found that by default, the OS does not immediately release the port that my server socket uses after the server shuts down. By providing SO_REUSEADDRwhen setting up the socket, you can avoid this problem, but I do not understand why it is useful to hold the port for a while. If the server shuts down, the socket closes, will any data transferred to this port not be processed anyway?
source
share