title: Pinging computers on a network
body: <p>I am a researcher at University and I'm trying my hand at a bit of amateur java2 programming.</p>
  
  <p>I've been working through the KnockKnockServer/Client Java2 tutorial to send strings from one program to another using Java Sockets.</p>
  
  <p><a href="http://download.oracle.com/javase/tutorial/networking/sockets/clientServer.html" rel="nofollow">http://download.oracle.com/javase/tutorial/networking/sockets/clientServer.html</a></p>
  
  <p>Full source can be downloaded there and it compiles nicely and is a great example of using IP's to get two programs to talk to each other in Java.</p>
  
  <p>This works fine when I use both the server and the client running on the same machine and the machine name as "localhost" </p>
  
  <pre><code>kkSocket = new Socket("localhost", 4444);
  </code></pre>
  
  <p>And it also works at home when I use it on my home network with a InetAddress:</p>
  
  <pre><code>InetAddress myaddress = InetAddress.getByName("129.11.138.64");
  kkSocket = new Socket(myaddress, 4444);
  </code></pre>
  
  <p>However when I try to do the same on the university machines it doesn't work because they are behind some kind of proxy despite the fact that the two machines are next to each other and plugged into adjacent ethernet ports.</p>
  
  <p>Question:</p>
  
  <p>How to I work out how to get the two machines to speak to each other, when I don't have full control of the network they are on? I can't even work out how to get them to ping each other. I have visited "www.whatismyip.com" to get the external ip's of each machine but that doesn't work, and I've looked at the next work adapters ip and the gateway they are on but still I can't get them to talk to each other.</p>
  
  <p>Any ideas.</p>
  
  <p>Thanks! </p>