You run your server application and the port is not available

I’ve hit this problem before (see post . An attempt was made to access a socket in a way forbidden by its access permissions). The port was available one day and seemingly locked the next…

Try the following step to see if it’s on the exclusion port range

netsh interface ipv4 show excludedportrange protocol=tcp

If you do find the port is within one of the ranges then I’ve found (at least for the port I’ve been using) that I can stop and restart the winnat service, i.e.

Note: you may need to run these as administrator.

net stop winnat

then

net start winnat

and the excluded port list reduces in size.