title: connection refused at 127.0.1.1 java RMI
body: <p>I am new at Java RMI technology. I have a problem that already other programmers had, but I was not able to understand what they did in the tutorials in order to solve it. 
  I have implemented the game "tic tac toe" with Java RMI. 
  Here the ControllerServer code</p>
  
  <pre><code>public ControllerServer() {
  
      try {
          game = new GameImpl();
          BoardView view = new BoardView(this);
          viewUpdater = new ServerViewUpdaterImpl(view);
  
          Game gameStub = (Game) UnicastRemoteObject.exportObject(game, 1099);
          ServerViewUpdater serverViewStub = (ServerViewUpdater) UnicastRemoteObject.exportObject(viewUpdater, 1099);
  
          Registry registry = LocateRegistry.createRegistry(1099);
  
          registry.rebind("TTTGame", gameStub);
          registry.rebind("TTTServerView", serverViewStub);
  
  
      } catch (Exception e) {
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>and here the ControllerClient</p>
  
  <pre><code>public ControllerClient() {
      try {
  
          BoardView view = new BoardView(this);
          localView = new ClientViewUpdaterImpl(view);
  
          String address = JOptionPane.showInputDialog("Insert server's address: ");
  
          Registry registry = LocateRegistry.getRegistry(address, 1099);
  
          game = (Game) registry.lookup("TTTGame");
          remoteView = (ServerViewUpdater) registry.lookup("TTTServerView");
          remoteView.registerClientView(localView);
  
  
      } catch (Exception e) {
          e.printStackTrace();
      }
  
  }
  </code></pre>
  
  <p>It works locally, by inserting "localhost" "127.0.0.1" or my external network IP.
  It does not work if client and server run on different machines. </p>
  
  <p>I got the exception "<strong>connection refused by 127.0.1.1</strong>". I do not understand why they are trying to use a localhost address at some point of the execution.  </p>