Consider a parent process which completes a
socket/bind/accept, and will fork children with that socket open for them to communicate with, while the parent continues accepting connections. That parent process is then killed.
Another process now attempts to bind to the same address the parent process was bound to, on the same port, but receives an EADDRINUSE error.
However, when you complete this process with
sshd, it seems
sshd is able to rebind to the port that was closed, while during the restart window (where the sshd parent process is not running), a different program (running as a different user) just gets EADDRINUSE.
What are the semantics behind this? Why can
sshd rebind, but another users process cannot?
Additionally, I can confirm that the
netstat -a | grep PORT output from during the time only the child process is running (when the other process can't
bind), the only connection is the
ESTABLISHED one, none in