terminating open ports
when i do a "netstat -na | grep 9999"
it tells me
tcp 0 0 localhost:9999 destination:1053 TIME_WAIT
As a result I cannot use this port(9999) henceforth even though I am not using it, is there a way to just terminate this connection and free up the port? or does it require a hard reboot?
"lsof -i" gives a list of processes associated with particular ports...
once you kill the process then the port becomes free...
Ports in the TIME_WAIT state are not associated to a process. They are closed sockets that are waiting to ensure that no packets still linger on the network and confuse programs when they get through. You can check with "netstat -anto | grep 9999" to see the current timeout value.
Otherwise, to see which process it is that's keeping a socket open, you can check with the -p flag to netstat, which specifies to it to display the associated process.