wood burning stoves 2.0*
The moose likes Distributed Java and the fly likes What is the second TCP port when using RMI? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "What is the second TCP port when using RMI?" Watch "What is the second TCP port when using RMI?" New topic
Author

What is the second TCP port when using RMI?

Marco Ehrentreich
best scout
Bartender

Joined: Mar 07, 2007
Posts: 1280

Hi guys,

I'm testing a RMI client/server application over the internet and I'm a bit confused about the ports (especially the second port) RMI is using...

I've got the following scenario:

The RMI server is on my root server with a public IP address without NATting. My client is behind a router at home. So far everything is working fine. The RMI registry on the server side is using the desired port i specified by creating the registry with the following command:


At the moment everything is working!!! The problem is that RMI opens up a second TCP port on the server side and this port seems to change anytime the server application is started. And these ports don't seem to be reserved ports for a special application (the last two times i had 2652 and 2317 for example). This is very unsatisfying because i have to change this second port on my firewall each time the server application is restarted

Unfortunately I couldn't find any useful hints on the web what exactly this second port does or is and in particular why it is changing dynamically! Can anyone tell me please what this port is and perhaps how I can specify a fixed number for it!

Thanks in advance!
Marco
Marco Ehrentreich
best scout
Bartender

Joined: Mar 07, 2007
Posts: 1280

Now I've managed to figure out the problem by myself...

One TCP port is for the RMI registry and of course another one is needed for the actual RMI communication between server and client

I wasn't able to specify the port for RMI communication because my server implementation extended "UnicastRemoteObject".
Instead by using it's possible now to specify the desired port for RMI calls.

Just in case someone else experiences the same problems...

Marco
[ October 24, 2007: Message edited by: Marco Ehrentreich ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What is the second TCP port when using RMI?