• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Persist Properties

 
yaza awad
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone:

Do I need to persist the server properties? I am thinking no. If yes, do I need a separate file than the one I use to persist to persist the client's ones. here I say yes.

 
K. Tsang
Bartender
Posts: 3521
16
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to persist both client and server. When you start server, you need to save database and port say. Without that how can remote clients connect?
 
yaza awad
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The user at the client side should know the server and port, when starting the client, the user is prompted to enter this information. Maybe I am wrong??

On the server side, the admin is prompted for the rmi port everytime they start the server, I can persist such information. In this case I should have 2 files one for the client side and one for the server side. I am not sure how other people approached this. Maybe I am making a big deal out of it, any way any feedback is appreciated.

Thanks in advance
 
K. Tsang
Bartender
Posts: 3521
16
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes you are absolutely correct. In fact if the server and client are 2 separate computers you will have no problems. But what happens if you run server and client on the same computer?

Therefore whatever you have already saved for client/server need to be read in then add the new stuff and write it all back.

Also for the server the configuration should be done only once. So the first run you set the port, subsequent runs should not need to prompt for the port and just start server.

For the remote client I think you need both server address and port in order to connect. This is how RMI and sockets work.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic