Originally posted by Valentin Crettaz:
I don't think the client should be able to shut down the server... On which grounds? How does the client know that no other clients are using the server? Do you think it is really the responsibility of a client to close the server? Server must only be shut down by an authorized administrator otherwise your application would be a chaos in the real-world...
I think I did not put my concern clearly. My mistake.
Actually, my implementation is rmi based. Clients have no idea about this socket. When the DataServer is started, along with regular rmi tasks, it also creates a ServerSocket in some other port and listens to it for shut down command. Again the same DataServer program has implementation to create a client Socket and to connect to the ServerSocket(with a different port than rmi communications port).
When the DataServer admin runs with command parameters like dns, port etc..(normal as in req) it starts the server and listens to client(rmi client ie the client gui) requests. When the admin wants to shut down the DataServer, he will run the same DataServer with stop as a command line parameter, this executes only the stopping part of DataServer implementation.
Hope I put it better now.
Thanks!