IP address will not connect to same IP address
<p>EDIT: This question was written by someone else in my project group. It's not very well worded, or informative, so if you've stumbled here by some accident let me know if you need any clarification etc.</p>

<p>The server sends the IP address through a message to the client. Our client then reads the message and displays the IP address by reading it.  I have it where it gathers the right numbers, but does not connect when back to the sent IP address. Any idea why it won't connect even with the same address? The code is given below:</p>

<pre><code>byte IPAddr[] = Arrays.copyOfRange(message, 3, 7); //and that is equal to "0.0.0.1" 

try {    
  InetAddress IP = InetAddress.getByAddress(IPAddr);    
  Socket clientSocket = new Socket(IP, returnPort);    
  System.out.println("Connected!");    
}
</code></pre>
