File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can I use localhost for RMI server?

 
long lingyu
Ranch Hand
Posts: 51
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can I use localhost for RMI server? If not,How can I get the server name through API?
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi long,
localhost can be used for development testing. i.e. you can start the server in the same machine as the client, and connect to it via RMI using localhost.
However, after finished the development. I guess it is better for you to try connecting the client to the server that in another machine. You can connect to the remote server via either IP addresses or DNS names, but basically, I suppose you should connect via IP addresses, as you cannot assume the marker's environment contains a DNS. Write this down in your document.
In addition, for non-network mode, you should NOT use RMI that connect to localhost.
Nick
 
long lingyu
Ranch Hand
Posts: 51
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which java API should be used to get the host IP address?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic