See more:
(untagged)
This is a difficult question and discussion was going on earlier, but as suggested by "SAKryukov" I am creating this as a New Post.
I know, many people will be benefited if a solution comes out, as many are already pondering over this problem. So, I thought CodeProjet would be the ideal place to brain jam :)
Question Begins here:
Imagine 2 users connected to Yahoo messenger or GTalk etc. Both the users are under the same LAN (i.e., same router), hence their Internet IP's are same but LAN IP's are different.
The question of Router configuration etc. will not arise at all. Because the persons under the same LAN are communicating with each other, without even bothering what their IP is and they are also communicating with another person in Montreal (i.e., out of the LAN).
The Socket Server is always running in the background, but the communication is entirely P2P.
The Problem: If a message sent from A in Montreal to B in Japan (C is also in Japan and in the same LAN as B). Now, the message from A destined for B will also be broadcast to C. Because the sockets are binded to an IP and Port. Since B & C have the same Internet IP, the sender message cannot resolve to the actual end point (i.e., the actual recipient of the message).