Derek-R-S/Light-Reflective-Mirror

Unstable Direct connection module

Closed this issue · 7 comments

Evn.
Client to Server transport : SimpleWebTransport
Direct connection module transport : KcpTransport
Relay Server hosted on a NAS's VM with public ip address

LightReflectiveMirrorTransport component setup
Relay Server port : 7000
NAT punchthrough port : 7001
Kcp transport port : 7777
SimpleWebTransport port : 7778

The Direct connection works great while all client under same LAN.

But if I change one of my unity editor into iPhone's hotspot network and try to connect to host.
The direct connect will failed.
Host console will show msg "Direct Connect Client Connected" and after a while and new msg "Kicked direct connect client." shows.

Client show msg "KCP: Connection timed out after not receiving any message for 10000ms. Disconnecting."

Could you please upload the full error to pastie.io or contact me in discord to further debug?

It seems the host is getting data from the phone, but the phone is unable to get data from the host. Aka the phone is unable to do a successful NAT punch. This will be most likely the case with cellular networks since lots share ips and have very strict NAT rules.

Is it falling back to relaying and working over that?

  • Is it falling back to relaying and working over that?

I don't think so, it just shows timeout message and not thing happen on client.

Well, after i change the KcpTransport into TelepathyTransport on Direct connect module the client can connected to the host!
(In different network environment)

Maybe the issue base on which transport is using.

Since i didn't know how to check which method is using for the connection (relay or direct connect), i just can let you know the connection is woking while using TelepathyTransport.

NAT punch will most likely fail on cellular networks, just turn it off in LRM transport settings

telepathy worked because it is TCP, so the nat punch would instant fail. It seems UDP is failing to fallback after failed punch attempt. this is fixed in v10