Port 59100 blocked investigation (Socket error 10013)

Depending on your version you could see 1 of these errors:

  • ClientListenerException (Socket error 10013)
  • BIND_SOCKET_ERROR
  • An attempt was made to access a socket in a way forbidden by its access permissions

A restart will probably solve this, but if you’d like to help solve the issue for good, please provide the requested info. :slightly_smiling_face:

On my end, I’ll add a way to change the default port but if the issue is reccurring, it’ll eventually happen with the new port too.

Info

  • Does it happen the first time you launch AudioRelay? (after a PC restart)
  • Or does AudioRelay stops working without a PC restart? (e.g: AudioRelay works fine first, then you close and start the app and the issue occurs)
  • Which version of AudioRelay for PC do you use?

Reason 1: Reserved or already in use

When the issue occurs, open a command prompt with administrator rights

Please copy-paste the results of these 3 commands:

  • netstat -anob | findstr 59100
    • (Tells us if the port 59100 is already used)
  • netsh int ip show excludedportrange protocol=tcp
    • (Tells us if the port 59100 is in a reserved range)
  • netsh int ipv4 add excludedportrange protocol=tcp startport=59100 numberofports=1
    • (If possible, prevents the port 59100 from being reserved)

Reason 2: Firewalls

Does temporarily disabling the firewall and antivirus solve the issue?

Reason 3: Port exhaustion

When the issue occurs, check whether AudioRelay or another program consumes a lot of ports.

  • Open the task manger
  • Go to details
  • Right click on a header
  • Click on Select columns
  • Enable Handles
  • Click on handles to find the program with the most handles

Is there a program that has a lot more handles than most?
As a baseline, no program has more than 10 000 handles on my PC.

image

image

Reason 4: Any ideas?

I had same issue. I have no process that uses port 59100.
It helped me to open eventvwr.msc, then Windows Logs\Application. Here I use Find and entered 59100. I find out that Apple’s Bonjour Service was trying to do smth with this port.

Solution: I just disabled Bonjour Service and rebooted my PC. Most likely you can just uninstall Bonjour. Possibly, you have another service interfering port 59100.

I had the same issue again. And again app that uses this port was not listed in netstat. In my case the reason was Hyper-V (Docker use it). It reserves port range that includes port 59100. There are two solutions.
First is to disable Hyper-V (most simple, but Hyper-V and Docker wont work):

  1. Open cmd as admin
  2. Enter dism.exe /Online /Disable-Feature:Microsoft-Hyper-V
  3. Reboot PC

Second is to reserve this port before Hyper-V does it (more difficult, but Hyper-V, Docker and AudioRelay can work together):

  1. Open cmd as admin
  2. Enter dism.exe /Online /Disable-Feature:Microsoft-Hyper-V
  3. Reboot PC
  4. ! If AudioRelay starts after reboot, then close it
  5. Enter netsh int ipv4 add excludedportrange protocol=tcp startport=59100 numberofports=1 as admin again
  6. Then enable Hyper-V dism.exe /Online /Enable-Feature:Microsoft-Hyper-V /All
  7. Reboot
  8. Hyper-V and AudioRelay works together as expected.
    ! Some people need to run this command also:
    reg add HKLM\SYSTEM\CurrentControlSet\Services\hns\State /v EnableExcludedPortRange /d 0 /f

Sources:
Gemini
Port already in use but nothing in netstat | SimplyAboutCode (IT SAYS TO netsh int ipv4 set dynamic tcp startport=4200 numberofports=1 DONT DO IT!!!)