In the last two days i was fighting the werid situation where i couldn’t bind to a specific port on my machine. All the other ports were fine, but this specific one was just blocked and didn’t matter what applicaiton i ran to try to bind to it.
Here are the steps i did until i found the reason:
- make sure it’s not the antivirus or any other security application
- make sure no other process is using this port by running netstat or TCPView
netstat -ano | wsl grep "<port>"
- if anything shows up, kill the process that owns the port
- if this didn’t work, reset the machine TCP/IP stack
netsh int ip reset
- if you find that anything is was blocked and the message “Access is denied” is shown, follow the steps listed here and run the previous step again
- Reset the machine