Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

rmi server connection info...

 
joel smither
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm working on the developer exam, the urlybird problem.
When the server component first comes up, I need to get the location of the database, and the port from the end user so I can feed that information to RMI...I'm using RMI for networking.

My question is this...do I need to get the host information as well...shouldn't the host setting ALWAYS be localhost?

Currently, my serve rbinds without specifying the host, is this correct?
 
Eric Chang
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is the approach that I took. I only allowed the user to input the Port and location of the database file for the Server.
 
joel smither
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just want to make sure I have this right. I'm working the UrlyBird project and I I'm using RMI for networking. When I bring up the server program, I first pop up a JDialog assking the user to enter connection settings. I ask the user for the name and location of the database file, as well as the port to listen on. I'm assumming the host will ALWATS be localhost.
Can anyone ever think of a case where the host is not the local host?
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12014
220
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Joel,

Yes, on the server side, with Sun's RMI Registry�, the host will always be localhost.

It is only on the client side you will have to request the IP / hostname of the server.

Note �: (this is a bit off topic, so feel free to ignore it) Sun's RMI Registry appears to ignore the IP address specified. This may change sometime in the future and/or other vendor's RMI Registries may behave diferently. One possible benefit of being able to specify IP addresses to listen on would mean that a single computer with multiple IP addresses could theoretically have different registries on the same port just listening to different addresses.

Regards, Andrew
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic