Monday, September 23, 2019

Windows 10 Complaining Permission Denied for Bind, but Ports Unused

An application on Windows 10 cannot open a TCP port, and the error message is something like

Error:  Permission denied - bind(2) for 127.0.0.1:7334

However, when you attempts to see if any uses the port, you finds nothing, such as,

netstat -abo | find ":7334"

In fact, this error can be the result of the "exclude port range". For instance, we can query the excluded port range on the system using,

netsh interface ipv4 show excludedportrange protocol=tcp
The output can be something like,

Protocol tcp Port Exclusion Ranges

Start Port    End Port
----------    --------
      7248        7347
      7348        7447

* - Administered port exclusions.

From the output we can see that the 7334 tcp port is in the exclusion range, and thus we can not assign it to a process.

No comments:

Post a Comment