Android Question UDP Hole punching

KZero

Active Member
Licensed User
Longtime User
Hello,

there is any way in B4A to open a UDP peer to peer connection across NAT ?

thanks
 

KZero

Active Member
Licensed User
Longtime User
You would need a third party public server somewhere for e.g. you can use GCM or alternative to pass the port information, and let both hosts start transmitting after that.

knowing IP and port will not help to connect behind NAT , the both have to start the connection because they can't listen to incoming connections

i have a detected server and i can write server application receive the connection from the both devices
now do you have idea about how to merge this 2 connections together without needing the the server anymore ?

thanks
 
Upvote 0

Troberg

Well-Known Member
Licensed User
Longtime User
As I said in another thread, I don't think you can expect to do this through high level APIs. You'll have to dig deep and get dirty.
 
Upvote 0

thedesolatesoul

Expert
Licensed User
Longtime User
knowing IP and port will not help to connect behind NAT , the both have to start the connection because they can't listen to incoming connections
It will because it will open the ports on the local side. This means when the remote host transfers next it will find an open port on the outside.
But there are other issues whether the outside ip/port is the same as the internal ip/port.

Read THIS. It should help.
 
Upvote 0
Top