Sending data to a remote machine

I have two machines exist inside two different subnets:

-The first 10.0.0.X connected to the Internet throw a router has fixed real IP.

-The second 10.0.0.Y connected to the Internet throw another router has another fixed real IP.

How can I send data from one machine to another using specified port?

Notes:

-I am allowed to install JVM on both machines.

-All the configurations needed on any of the machines should be done using inside Java code.

-I am not allowed to change the routers configurations (can not use NAT or any similar protocols).

[595 byte] By [mahmoudabdelsattara] at [2007-10-3 3:47:22]
# 1
Read suns Socket Tutorial.
masijade.a at 2007-7-14 21:44:19 > top of Java-index,Core,Core APIs...
# 2
Please notice, The two machines exist inside two different subnets, so they do not have real IPs, can you please provide a piece of Java code realizing that (sending any data from on of them to another using socket).
mahmoudabdelsattara at 2007-7-14 21:44:19 > top of Java-index,Core,Core APIs...
# 3
It is very possible that the routers are set so that the machines with the local address behind them can not be accessed from outside. You should examine the routers' configurations.
BIJ001a at 2007-7-14 21:44:19 > top of Java-index,Core,Core APIs...
# 4
I did reset for the tow routers, so am sure there is not any configuration preventing that.What I need is a sample code using Java to connect the two machines.
mahmoudabdelsattara at 2007-7-14 21:44:19 > top of Java-index,Core,Core APIs...
# 5

At home I have a little private network with a firewall-router. Sockets are allowed to be opened from inside, then the packets will travel with the router's IP address, but sockets can not be opened from outside. I could configure the router to allow the latter, but I do not. So reset or not, the router works this way.

BIJ001a at 2007-7-14 21:44:19 > top of Java-index,Core,Core APIs...
# 6
Then, how can 2 persons using Yahoo messenger or (MSN) talk to each other else using sockets?
mahmoudabdelsattara at 2007-7-14 21:44:19 > top of Java-index,Core,Core APIs...
# 7
Whether they can or not depends on the router settings which you can not change from the client machines.
BIJ001a at 2007-7-14 21:44:19 > top of Java-index,Core,Core APIs...
# 8
> Then, how can 2 persons using Yahoo messenger or> (MSN) talk to each other else using sockets?Because both clients (both ends) connect TO a server that exists between them which Yahoo/MSN provides. That server has a public IP address.
jschella at 2007-7-14 21:44:19 > top of Java-index,Core,Core APIs...
# 9
Hi all,At the end i found solution!!!!!!!!!!The Hole-Punching.Thanks alot for all the help you provided.
mahmoudabdelsattara at 2007-7-14 21:44:19 > top of Java-index,Core,Core APIs...