RevenantX/LiteNetLib

NAT hole punching failure detection

amazedevil opened this issue · 3 comments

I would like to make a NAT hole punching + relay if NHP fail, but I'm not sure how to reliably detect the NAT hole punching failure. Of course I can just watch for timeout, but it's always a risk to mess with the timing, so I thought maybe there is a better solution. Any ideas? If it can be done, it would be cool to have event symmetric to "NatIntroductionSuccess", for instance "NatIntroductionFailed".

Timeout is the common practice because you can't detect it normally in another way.

I see, thank you! Maybe somebody have practical experience of choosing such a timeout? My conditions are quite common - single server for the whole world, clients from anywhere.

@amazedevil it's a balance between time you choose that user can wait and punch success rate.
In most cases something near 5 seconds will be enough