我的服務器的代碼如下所示:也不會在Java RMI連接兩個遠程主機
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();
就可以正常工作的本地主機,但我不能連接兩臺遠程計算機(主機)。 我已關閉所有防火牆。
怎麼了?
控制檯輸出:
Error: java.rmi.ConnectException: Connection refused to host: 150.254.79.20; nested exception is:
java.net.ConnectException: Connection timed out: connect
我想我會先閱讀一個基本的網絡書籍...... – TheLQ
這是一個非常一般的建議;) – deem
「不能」不是一個足夠的問題描述。請提供錯誤消息,堆棧轉儲等。 – EJP