Android device can send data to PC, but can't receive

I’m using the new com.unity.transport multiplayer thing, and it works well when I run my game on two PCs. They connect to each other without problems.

But when I run one copy on android, and another one on PC, the following happens:

If I run android app as client and PC one as server, android app successfully sends connect request, then server on PC accepts connection and starts the game. But android app doesn’t receive “connection is accepted” signal.

And if I start android app as server, and PC one as client, connect request from PC doesn’t reach android app.

In terms of code sending a connect request looks like this:

m_Driver = new UdpNetworkDriver(new ReliableUtility.Parameters { WindowSize = 32 });
System.Net.IPAddress ip;
System.Net.IPAddress.TryParse("192.168.0.4", out ip);
NetworkEndPoint endpoint = NetworkEndPoint.Parse(ip.ToString(), 9000);
m_Connection = m_Driver.Connect(endpoint);

Feels like something blocks network data from reaching android app.

So, does anyone have any idea, what could be wrong here and how to make it so android app receive data from network?

Hello,

You posted this issue quite a long time ago, but I am running into a similar problem and I can’t find out a solution.

Did you find any workarounds?

Thank you.

Hey!

Yes, I found the source of this bug. And it wasn’t a result of multiplayer system misbehaving.

There simply was a bug on android build, that I didn’t notice. Some systems that worked on PC, refused to work on android. And it blocked some of the multiplayer related code from running. I don’t remember what was it, something unrelated and innocent.

So, my advice is to comprehensively debug the android build, and make sure everything works as it should, even things you wouldn’t suspect in going wrong.