title: Can't connect two remote hosts in Java RMI
body: <p>My server's code looks like:</p>
  
  <pre><code>Registry r = java.rmi.registry.LocateRegistry.createRegistry(1399);
  r.rebind("Chat", new IRC());
  </code></pre>
  
  <p>and my client's code is</p>
  
  <pre><code>IRCInterface remoteObject = (IRCInterface) Naming.lookup("rmi://localhost:1399/Chat");
  String history = remoteObject.read();
  </code></pre>
  
  <p>on the localhost it works correctly, but I can't connect two remote computers (hosts).
  I've turned off all firewalls.</p>
  
  <p>What's wrong?</p>
  
  <p>The console outputs:</p>
  
  <pre><code>Error: java.rmi.ConnectException: Connection refused to host: 150.254.79.20; nested exception is: 
  java.net.ConnectException: Connection timed out: connect
  </code></pre>