Reputation: 13
i am programming voice chat app but the problem is when client is using router firewall block connection
i solved this problem with tcp connection but with udp connection i didn't know how i can solve this problem
i try udp hole by this step
but this work one time and many time didn't work i dont know why. any help.
Upvotes: 3
Views: 3077
Reputation: 31
NAT punchthrough requires an external "matchmaking" server and is possible on all BUT non-symmetric routers and firewalls. Putting it simply these "symmetric" routers change the outbound/inbound port of your data each time you change either the IP or the PORT of the destination, effectivelly nullifying the "matching" that the server is trying to do.
There are other "crafty" ways of doing a punchthrough but they lack coherence.
I would advise you to read about the differences of NAT types (Assymetric, Symmetric, Full cone, Restricted cone, Port restriceted cone). Also make sure you read about STUN which allows you to identify the type of NAT your client is operating behind. Finally, you should read about UPnP which is a feature that most routers have, and allows programs to self-register and open ports, without the user having to do that manually through the router interface.
Upvotes: 3
Reputation: 1872
What you are trying is UDP-hole punching. But few routers, which has symmetric NAT, hole-punching is very difficult and inconsistent (when possible). Read about different NATs on wikipedia, you will get more insight.
Upvotes: 3