私のサーバーのコードは次のようになります。
Registry r = java.rmi.registry.LocateRegistry.createRegistry(1399);
r.rebind("Chat", new IRC());
そして私のクライアントのコードは
IRCInterface remoteObject = (IRCInterface) Naming.lookup("rmi://localhost:1399/Chat");
String history = remoteObject.read();
localhost では正しく動作しますが、2 台のリモート コンピューター (ホスト) に接続できません。すべてのファイアウォールをオフにしました。
どうしたの?
コンソール出力:
Error: java.rmi.ConnectException: Connection refused to host: 150.254.79.20; nested exception is:
java.net.ConnectException: Connection timed out: connect