Suppose you have a socket listening on a TCP port and some clients are connected. When one of them issues sock_close (fd) in C and tries to bind it to the same port again, the failure fails. Some TIME_WAIT state is mapped to "netstat -plutnoa", for example:
tcp 0 0 127.0.0.1:4567 127.0.0.1:32977 TIME_WAIT - timewait (17.12/0/0)
So, how can you properly disconnect the server socket and reconnect to the same port?
source
share