Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 224
  • Last Modified:

Meaning of URL in RMI

How do you set up an URL from the server and client side when using RMI.
Server: Name.redind(//myhost/???/name);, what is important for in the URL for the client to recognize the remote object. My program work on the same machine, but I will setup for running from different computer.

0
pjroy
Asked:
pjroy
1 Solution
 
jpk041897Commented:
A URL as used by Java, is a Class that is initialized to an address.

See the Java Docs for the diferent constructor options, but in general they fall into the classification of:

String address = "127.0.0.1/Mydoc.html);
URL myURL;

try {
 myURL = new URL (address);
}
catch (MalformedURLException e){
 // whatever
}


So whenever you find a constructor that requires a URL, as in

Server: Name.redind(URL);

You replace the URL param  for the URL class instance you created.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now