UDP Holepunching behind NAT

前端 未结 3 669
独厮守ぢ
独厮守ぢ 2021-01-31 06:21

I am trying to implement a simple sketch of UDP-Holepunching in Java to test it\'s concept and use it in my C/C++ application later on.

Concept:

As from Wikip

3条回答
  •  天涯浪人
    2021-01-31 06:47

    Just a note for those following this great post, notice that in the server side, the second UDP packet received is announced as: System.out.println("(2nd) Server received:" + new String(bytes) + " from " + address1 + " on port " + port1); It should be System.out.println("(2nd) Server received:" + new String(bytes) + " from " + address2 + " on port " + port2); Its no big deal since its only an informative message, but it made me lose some time just wondering how the hell on earth the router was giving the same port to 2 different communications :P

提交回复
热议问题