Java RMI 连接使用什么端口?

2022-01-24 00:00:00 connection firewall java rmi

我可以知道 Java RMI 连接使用哪个端口吗?

May I know what port is used by Java RMI connection?

如果我想使用 RMI 连接将 Java 客户端应用程序连接到 Java 服务器应用程序,我需要在服务器计算机上打开什么端口,以便客户端应用程序可以连接到它?

If I want to connect a Java client application to a Java server application using RMI connection, what port I need to open at the server machine so that the client application can connect to it?

我想在服务器机器上设置防火墙,但不知道应该打开哪个端口.

I want to set up a firewall in the server machine but I don't know which port I should open.

推荐答案

RMI 通常不会在防火墙上工作,因为它使用不可预测的端口(它从 1099 开始,然后使用随机端口运行).

RMI generally won't work over a firewall, since it uses unpredictable ports (it starts off on 1099, and then runs off with a random port after that).

在这些情况下,您通常需要借助 HTTP 上的隧道 RMI,这已经很好地描述了 这里.

In these situations, you generally need to resort to tunnelling RMI over HTTP, which is described well here.

相关文章