Android Question UDP Hole punching

Discussion in 'Android Questions' started by KZero, Feb 23, 2015.

  1. KZero

    KZero Active Member Licensed User


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

  2. thedesolatesoul

    thedesolatesoul Expert Licensed 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.
    KZero likes this.
  3. KZero

    KZero Active Member Licensed 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

    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 ?

  4. Troberg

    Troberg Well-Known Member Licensed 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.
    KZero likes this.
  5. thedesolatesoul

    thedesolatesoul Expert Licensed User

    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.
    KZero likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice