File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Can I use localhost for RMI server? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Can I use localhost for RMI server?" Watch "Can I use localhost for RMI server?" New topic
Author

Can I use localhost for RMI server?

long lingyu
Ranch Hand

Joined: Feb 15, 2004
Posts: 51
Can I use localhost for RMI server? If not,How can I get the server name through API?
Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982
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


SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
long lingyu
Ranch Hand

Joined: Feb 15, 2004
Posts: 51
Which java API should be used to get the host IP address?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can I use localhost for RMI server?