How could the message be exchanged? _networking_
<p>I have made my pc both server and client and am able to pass messages from one cmd window to another.
But i am still able to do so when i am not connected to internet.<strong>How is that possible.?</strong><em>This is My code.</em></p>

<pre><code>import java.net.*;
 class tester {
  static int pos=0; 
  static byte buffer[]=new byte[100];

   static void Client() throws Exception {
   InetAddress address=InetAddress.getLocalHost();
  DatagramSocket ds=new DatagramSocket();
   while(pos&lt;buffer.length) {
    int c=System.in.read();
    buffer[pos++]=(byte)c;
    if((char)c=='\n')
      break;
   }
  ds.send(new DatagramPacket(buffer,pos,address,3000));

}          
 static void Server() throws Exception {
 InetAddress address=InetAddress.getLocalHost();
 DatagramSocket ds=new DatagramSocket(3000,address);
 DatagramPacket dp=new DatagramPacket(buffer,buffer.length);
 ds.receive(dp);
 String s=new String(dp.getData(),0,dp.getLength());
 System.out.print(s);
}
 public static void main(String args[])throws Exception {
  if(args.length==1) {
 Client();  }
    else {
     Server();
    }
 }
}
</code></pre>
