In article , wrote: :Can anybody send me the linux/C source code for this problem.
:If Client A and Client B are unkowngly behind the NAT(firewall) and if :Client A send the request to communicate to B. Then after Crossing the :NAT the public IP address will change of A and B both then How we will :find by the help of a program that both are lying behind the same :NAT/firewall or different NAT/Firewall.
If A and B have access to normal socket calls, then they can determine their own local IP and port number. They can send that as data, along with some kind of authentication token. The other end then -attempts- to contact that local IP + port and if the connect attempt succeeds, presents the authentication token, which will be either confirmed or denied.
You need the authentication token in case the address you reach is something else that just -happens- to be listening; also you want to reduce potential Denial of Service and Man In The Middle attacks.