title: Socket creation using a IPv6 Address and port number in java using eclipse(windows)
body: <p>When I try to create a socket using IPv4 address, it's successful, but when I try to create a socket using IPv6 address and port number it throws an exception : </p>
  
  <pre><code>java.net.SocketException: Network is unreachable: connect
            at java.net.DualStackPlainSocketImpl.connect0(Native Method)
            at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
            at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
            at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
            at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
            at java.net.PlainSocketImpl.connect(Unknown Source)
            at java.net.SocksSocketImpl.connect(Unknown Source)
            at java.net.Socket.connect(Unknown Source)
            at java.net.Socket.connect(Unknown Source)
            at java.net.Socket.&lt;init&gt;(Unknown Source)
            at java.net.Socket.&lt;init&gt;(Unknown Source)
            at epcs.intf.be.SimConnectionHandler.connect(SimConnectionHandler.java:332)
            at epcs.intf.be.BackEndConnection.connect(BackEndConnection.java:42)
            at epcs.intf.be.ProcedureRunner.runScenario(ProcedureRunner.java:230)
            at epcs.exec.Runner.SendExecTrigger(Runner.java:418)
            at epcs.exec.Runner.sendCommand(Runner.java:454)
            at epcs.main.ExecutionThread$TaskStartTestCaseExecution.run(ExecutionThread.java:98)
            at epcs.main.ExecutionThread.run(ExecutionThread.java:29)
  </code></pre>
  
  <p>Code:</p>
  
  <p>I am running the code through Eclipse IDE from a Windows machine.  </p>
  
  <pre><code>    if(p_objSimData.getIpAddress().contains(":") )
      {
          System.out.println("IPV6 Address Found\n");
          InetAddress ip6addr = Inet6Address.getByName(p_objSimData.getIpAddress());
          System.out.println("InetAddress ip6addr = "+ip6addr); **//prints  //2011::11 - IPv6 address**
          objConnection.m_objSocket = new Socket(ip6addr,p_objSimData.getPortNo()); -  **here it is throwing an exception** 
      }
      else
      {
          objConnection.m_objSocket = new Socket(p_objSimData.getIpAddress(),p_objSimData.getPortNo());
          //m_hmObjConnection1.put(p_objSimData.getIpAddress(), objConnection.m_objSocket);
          m_hmObjConnection1.put(p_objSimData.getIpPort(), objConnection.m_objSocket);
      }
  </code></pre>