SCJP,SCJD,SCWCD,SCBCD,SCDJWS,SCEA
the server is universally identified (at least in the windows world) as "localhost"
The ip address assigned to the localhost name is always 127.0.0.1
I would like to know the ip or name of the computer on the net when it act as a server so that the server code can bund itself and a client can find it.
I would like to know the ip or name of the computer on the net when it act as a server so that the server code can bund itself and a client can find it.
What should I do when I showdown the server?
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Originally posted by Davidd Smith:
I use a ConnectionFactory bound to rmiregistry. Should I unbind it before exit?
Originally posted by Davidd Smith:
There are many Connections with their instance of Data class as a member, how could I deal with all of them? Could I ignore them and let the finalize() method of the Data class work?
Originally posted by Davidd Smith:
I lock and unlock the records on the server in the booking() method of ConnectionImpl class. In my instructions, there is no request about database lock. I am afraid it will cause the code more complex and increase the possibility of losing score if I add the database lock, because I found there are few person get high score in lock/unlock.
Could you give me any suggestion?
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Originally posted by Davidd Smith:
Hi, everyone,
What should I do when I shutdown the server?
Recards
Davidd
[Davidd] I am not sure when client mode (no command line arguments) starts and user type in "localhost" while selecting host, should the stand alone mode run or loop back net client run?
[Tony] Why do you need to unbind before you close down the registry with exit ?
Won't it be unbound on exit ?
[Tony] BTW exit seems to be the only way of terminating the registry.
[Davidd]What should I do when I shutdown the server?
[Tony]I thought maybe you could unbind the factory, pause(or wait for all locks to become free) then exit.
[Davidd] I think when net is down, the Connections and their member object Data will be garbage collected automatically.
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Consider Paul's rocket mass heater. |