PC Android LAN Network Connection

At the moment I am trying to create a networked game that works on both PC and Android (IOS to be supported later). The goal is to use mobile client devices as spectators for events while the main game plays out on the PC clients.

At the moment I have no issue networking between PCs and between multiple instances of a program run on the same PC. Using network discovery I am able to see connections broadcasted from PC hosts on Android clients but I am unable to connect. After a few seconds the connection times out and the connection message in the default Network Manage HUD is something like "connecting to local host...". Currently I am working with the sample program [here][1] as a base for the test. It should also be noted that PC clients are unable to find Android hosts when listening for broadcasts.

My current hunch is that somehow I need to open a port on the mobile device but I can't seem to find how to do this in Unity. It is important that this is done simply since Android users likely wont want to open settings to get the application to work. I've tried looking at a few tutorials for controllers however these seem to use the deprecated networking system which is no longer an option in my current Unity environment. Any advice or suggestions would be greatly appreciated. Apologize for being a bit vague but for legal reasons I can't or probably shouldn't post any code.

You might want to look here at this thread if you are still looking for an answer. He solution worked for me.


@Joe-Censored said the following:

Localhost is your problem. You need to connect to the ip address of the host computer. localhost (which is the same as connecting to means connect to the computer I am on. Run ipconfig or ifconfig on your host computer to see what IP address it is using, and on your clients you connect to that. If you are trying to connect with another computer over the internet it is far more complicated, where you’ll need to log into your router and find its IP address and port forward to your host computer.