Setting RMI ports
843793Jun 30 2001 — edited Jul 7 2001Let's see if I got this right..
RMI uses 2 ports for communication, the first port being the one rmiregistry is started at. The one you specify when binding or looking up remote objects with the url.. like rmi://localhost:1099/MyRMIServer. That is easy to set..
The other port is used by the client to receive back data from the RMI server and is set randomly each time unless you specify it yourself. Now how do I specify it? UnicastRemoteObject takes a port number for a constructor parameter, is that the one to use? And if that is the one to use, then how does the server know which port to respond to to the client when making the first connection since the UnicastRemoteObject is located on the server.. is the port number stored in the stub class created?
I need to make an RMI connection between 2 firewalled servers and I need to set the ports so they can be opened in the firewalls.. So any help would be very much appreciated thank u.. :)