This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
I definitely think you should allow the User to choose the port when starting the server. It's not guaranteed that every User will have the default port that you choose open, therefore you should let them decide what port to run the server on. And because of that, you're going to have to allow the Client to choose the server port to connect to as well.
In a real world application, I would definately allow the port to be configurable. However, for the purpose of this assignment, I don't think it is neccessary. If you want to do it, go ahead. If you want to leave it out for simplicity's sake, that is fine too.
FYI, I am pretty sure you are correct David, you cannot change the registry to a different port without restarting the JVM.
“Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.” - Rich Cook
---------------------- FYI, I am pretty sure you are correct David, you cannot change the registry to a different port without restarting the JVM. ----------------------------------------- What do you mean? restarting the JVM?? How come? You only should do is : restart your application ,choose a new port.
or you should >rmiregistry new_port
-------------------------------<br />OCP 9i <br />SCJP/SCJD/SCWCD(92%)/SCDJWS<br />XML(IBM Test 141)<br />Who is the next?SCBCD<br />SCBCD/CCNA/CCNP/PMP<br />not sure
Joined: May 24, 2004
What do you mean? restarting the JVM?? How come? You only should do is : restart your application ,choose a new port.
Yes, that is what I was referring to. For more info, check out this thread.
Originally posted by Paul Bourdeaux: Yes, that is what I was referring to. For more info, check out this thread.
Since I wrote that reply in that thread I've changed my server to have a GUI and allow changing the port. What I do is let the user specify a new port , but inform her that she will need to restart the server for that change to be effective. This behaviour is common for Windows configuration changes and should be no surprise to a network admin, it's also infrequent. After even more research, including hacking some low level stuff, I can confirm that that ObjID prevents you from closing a registry that you have opened in your application and starting another one.
If you really want to do this you can use Runtime.exec("rmiregistry") and fight all those problems with platform dependencies and controlling a seperate process.
Or you can take the easy way out and just use port 1099, be sure to explain why you chose this one. [ January 28, 2005: Message edited by: peter wooster ]