• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Stopping DataServer using socket connection

 
Chandra Peri
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greetings!
As part of the DataServer(rmi server) startup, it could create a ServerSocket and listen to it for shutdown command.
When user wants to shutdown the server, they will run DataServer with command line parameter "stop"; inside the program this will create a client Socket and connects to the ServerSocket created at the startup time. ServerSocket once gets the "stop" command, DataServer as a whole exits out.
Concern: I'm not sure, whether I can use "stop" as a command line parameter, as it's mentioned in the req, only listed parameters are allowed.
Am I allowed to do this?
I'd appreciate your help.
Thanks for your time!
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
Chandra Peri
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Chandra Peri
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm happy to provide more information about my implementation if anybody needed. I'd greatly appreciate your input.
Thanks!
(Note: Yes I wanted to bring this thread up in the list, so that somebody would take a look)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic