I have a PC and a phone and I am trying to set up bi-directional communication between the 2 over 3G.
On the PC end I have full control over the NAT. So I have port mapped incoming communications on my specific port to the PC on my desk.
I then send to our PC network’s outside IP address with my specific port.
I see the packets arrive at my PC, which is perfect. So now I want to send back a communication from the PC to the phone. I have got the address and port via a “recvfrom” and i then do a sendto back across to the address and port that I received the data from.
However this data is then not being received by the phone. I assume the incoming communication is not getting re-directed by the NAT box on the mobile providers network.
Why is this? I thought seeing as I’ve initiated communication from the phone that I should be able to go back along that route to communicate with the phone?
So, how do I get this working?
Any thoughts appreciated!
Well I did figure out what I was doing wrong. I was communicating from the phone to the PC’s port “x” and then trying to go back the other way on port “y”. Using the same port for both ways allowed communication to occur 🙂