I changed the source again. Now you can use the code you wrote yourself to do the test through the "Manual test" button. To make the "Manual test" work just set "Message local port" for the port number you are listening on and "Controller port" and "Controller IP" with the data of the remote host. Can you tell me if it works for you through the two NATs? Because it works for me in LAN but not behind the two NATs.
I only took the client project1.exe and started it at both ends (both their own NAT).
(there is no need for the controller if we know the IPs and Ports.
Filled in IP of A and 7777 as controller IP and port on B and message port 7777.
Filled in IP of B and 7777 as controller IP and port on A and message port 7777.
Pressed Manual test on both sides.
And pretty quick I got the WE HAVE CONTACT on both sides.
So for me the UDP hole punching worked.
Using different ports at both ends work too.
Filled in IP of A and 4000 as controller IP and port on B and message port 7777.
Filled in IP of B and 7777 as controller IP and port on A and message port 4000.
Pressed Manual test on both sides.
And again I got the WE HAVE CONTACT on both sides.