How can I know what is preventing my socket to bind to localhost:50060-50959

If you face this issue on Win10 2004 that's because of an issue in this update, do the following:

netsh int ipv[46] set dynamic tcp start=49152 num=16384

reg add HKLM\SYSTEM\CurrentControlSet\Services\hns\State /v EnableExcludedPortRange /d 0 /f

I face this on opening Jetbrains IDEs and many other program that use sockets.