mercredi 30 janvier 2019

java rmi avoid runtime random port usage for communication

I have client machine behind firewall. So added rule for the port used (rmi_server_port) in:

registry=rmi_server_ip: rmi_server_port +"SomeVal";
poInterface = (I_Factory)Naming.lookup(registry);

But when actual communication happens a random port is opened. Cannot add all ports after 1099 to firewall rules.

Found below alternate: Use MyRMISocketFactory

But how to use createServerSocket(int port) method in basic rmi code.




Aucun commentaire:

Enregistrer un commentaire