UDP hole punching P2p

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Vikram Ranabhatt
    New Member
    • Aug 2010
    • 1

    #1

    UDP hole punching P2p

    HI,
    I am implementing UDP Hole Punching in C#.To have communication between two peer in the internet one should know the public IP address.I have developped application which acts as both client and server and installed in both machine.I use 192.45.20.10 and 50006 (local ip and port)to contact STUN Server 3478. I am able to get Public IP and port say 127.34.10.45:34 56(machine1) and 145.167.10 and 4567 (nachine2).as explained in bryan ford white paper on UDP hole punching I supposed to use the same loacl end point to connect to other peer.but this failing AS IT REPORTS ADDRESS REUSE.If I change the port then request than NAT will change the public IP. In that case other peer won't be able to connect.
    here instead of rendezvous server, I am manually supplying public ip and port to both application to connect.

    Please suggest how to implement this UDP hole punching.

    thanks
    Last edited by Vikram Ranabhatt; Aug 30 '10, 06:46 PM. Reason: grammer mistake
  • Oralloy
    Recognized Expert Contributor
    • Jun 2010
    • 988

    #2
    Since you're using UDP, you should probably just use sendto and recvfrom using the same base port.

    You should only have to create the socket and bind it once.

    Or am I dropping a ball here?

    Cheers!

    Comment

    Working...