2
  1. Using stun I will get my external ip/port and NAT type.
  2. On my middle server (public ip), I will register peers external ip/ports (Now server knows peer 1's and 2's external ip/port).
  3. Exchange the ip/port (peer 1 will get to know the peer 2's ip/port).
  4. Simultaneously make connect() call from both the peers.

Is it the right flow?

Mike Pennington
  • 41,899
  • 19
  • 136
  • 174
user739711
  • 1,842
  • 1
  • 25
  • 30

1 Answers1

2

Your algorithm is correct for UDP. Take a look at these posts for more information:

Community
  • 1
  • 1
Mike Pennington
  • 41,899
  • 19
  • 136
  • 174