- Home /
MIRROR: Connect Android client to PC server?
Using the Mirror NetworkManager alongwith the NetworkManagerHUD, I made two scenes: one for server, one for client.
The client one I built out to Android, and started up the server one on laptop, both devices being connected to the same home wifi. I entered the relevant IP and port on the client phone, and when I hit LAN Client on the phone, it can't connect to the laptop server, and times out and gives:
Client Recv: failed to connect to ip=192.168.x.xx port=xxxx reason=System.Net.Sockets.SocketException (...) Connection timed out at System.Net.Sockets.TcpClient.Connect.....
I tried setting the relevant ports to 'allow' in the firewall, to no avail. How can I go about achieving this?
Answer by tanmayband · May 18, 2019 at 12:10 PM
I got it, my server (windows laptop) firewall was blocking the connection. Even though I had put in an "Allow" rule in Inbound rules, there's apparently Unity editor's own "Block" rule, that blocks any type of connection over TCP and UDP. Had to disable those rules, and it finally worked.
Later, when I built out the server scene, windows popped up the "Firewall is blocking some features" dialog, I simply clicked Allow and it worked.
Answer by Izanobixx · Aug 06, 2021 at 12:06 PM
How can you disable the TCP and UDP blocks?? I've been investigating, but I can't figure it out.