title: Java Socket Timesout when I try connecting to server with external IP
body: <p>I'm trying to make a simple pong game with multiplayer support, but when I try to connect to the server application with my external ip it fails.</p>
  
  <h1>What I've Tried</h1>
  
  <p>localhost, 127.0.0.1, and 192.168.0.10 all work.</p>
  
  <p>When I check to see if my port is open with an external tool it always returns true right away if I have the server running.</p>
  
  <p><img src="https://i.stack.imgur.com/YHSBa.png" alt="My port is open"></p>
  
  <p>Turning off firewall or adding exceptions hasn't helped.</p>
  
  <p>pinging my external IP returns instant response.</p>
  
  <h1>Code for sockets creation in Java and exception</h1>
  
  <p>Server Socket Creation</p>
  
  <pre><code>serverSocket = new ServerSocket(7777);
  for(;;){
      socket = serverSocket.accept();
  }
  </code></pre>
  
  <p>Client Socket Creation</p>
  
  <pre><code>socket = new Socket(IP, 7777);
  </code></pre>
  
  <p>Exception thrown by client</p>
  
  <pre><code>java.net.ConnectException: Connection timed out: 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 Client.&lt;init&gt;(Client.java:93)
      at Client.main(Client.java:153)
  </code></pre>