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 ?
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.