Toubleshooting Network Discovery (on Android)

Hi there,

I wanted to implement Network Discovery via UDP broadcasting for my game.
I have a game server that is running on my computer and a client that runs on an Android smartphone. I am using the Unity “Network Manager” and “Network Discovery” components.

Everything runs fine when run from the PC, but on the smartphone it doesn’t seem to receive the broadcast message.

I know that it should work in principle, because I have played games using this exact setup that also use UDP broadcasting. How do I troubleshoot this? Thank you very much!

Greetings,
Pfaeff

Any ideas?

Maybe an obvious question, but have you checked so your phone is on the same network as the PC?
Can they connect using the IP-numbers?

Yes, they are on the same network. I played “Eon Altar”, which also seems to use UDP Broadcast and that works fine.

Have you verified that you have Network Discovery working between two PC’s, with one on your wifi that your android device is using?

I just tried running the server on a virtual machine on the same network, since I currently have no second Windows machine. I then ran the client on the host machine and I am having the same issue there.

Could it be some firewall blocking the network discovery packets, are there a Windows, or antivirus firewall running on the PC?

It seems to work when I turn off the Windows firewall. Shouldn’t it be enough to allow the game to use the network when it first starts up?

EDIT: now it even works with the firewall turned on. What is going on?

Not sure if it´s a Unity error, but I would recommend filing a bug report on this.
Se if it can be reproduced on other machines.

  1. Open game on PC, allow network connections → no network discovery
  2. Disable Windows Firewall, enable it again → network discovery working.

Check if it has to be done on both the server-PC, and the client-PC, or just one of them.