i have a requirement to fix the server and client ports being used by our RMI app.Fixing the client ports is a figment of netadmin's imagination. It is unprogrammable except with great difficulty; it has major drawbacks to the client application, such as adding both latency and unreliability; and it adds nothing to network security whatsoever.
However , apart from the ports defined in the CustomRMISocketFactory there are other ports that i still see in the network traces.DGC ports.
From the debug that i have done i see that these ports are being generated right after the Naming.lookup(<String>) call.DGC ports between the Regsitry and the client.
Please do let me know if anyone can guide me in the correct path.See above.
i. Is there any published document that iterates the fact that fixing the client ports is not recommended alongside the reasons. i do understand the reasons but a document reference would help immensely. Maybe a pointer to where i can look for such documentation.Search these forums, both the Networking forum and the read-only Socket Programming forum if you can find it. I have expressed my views about this on a large number of occasions, and nobody has ever refuted them or even questioned them, in 14 years.
ii. If i understand correctly the ports used by DGC to keep track of client references should/cannot be fixed.In the absence of socket factories, there is automatic port sharing, i.e. once you have exported an object on a port, any port, whether user-defined or chosen by the system, all subsequent objects are exported on the same port unless you specify otherwise. That should apply to the DGC object as well as your own. I would guess that your socket factories got in the way of that, and once you remove them it will all fix itself nicely.