Forums Register Login

How does the port determined

+Pie Number of slices to send: Send
Hi ,
I understand how rmi works. The client requests an object by name to the RMI registry, once the client has the stub it make calls to the remotes method.I have gone through the RMI specification doc and underneath it actually opens a socket, but who determines on which port it shoud talk?..Is this done at compile time and run time?
Can someone explain in detail.
Thanks for your time
Thanks
Praveen.
+Pie Number of slices to send: Send
Hi Praveen,
Well I don't pretend to be an expert on RMI but I will tell you what little I do know about RMI and ports. The RMI registry is bound to port 1099 by default but can be bound to virtually any available port on the system. Now when a client requests a connection to a service that is bound to the RMI registry then the RMI server usually opens an anonymous port (which is whatever available port the system gives it) for that client to communicate with the remote service. It's like you creating a ServerSocket like:

This is why RMI has such a hard time with firewalls. Nobody knows for sure what ports are going to be needed. When this problem arises though custom SocketFactories can be implemented to use selected ports.
Hope this helps,
Michael Morris
How do they get the deer to cross at the signs? Or to read this tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1063 times.
Similar Threads
matter in class verses component diagram
How to block the port
do i have to supply a port number when start server?
NX: Selecting the port number
What is the second TCP port when using RMI?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 18, 2024 22:04:02.