I want to create the client server program which can control that if the client is still connect to the server ...no body can shutdown the server....Can anyone tell me how to create such process
Side issues:
1) if the server crashes and is stuck in a thread, you won't be able to get rid of it. This means that during development, there might be a whole bunch of zombies on your system.
2) if there are 2 zombie servers, one crashed, one not crashed, would the client know which one to connect to?
Hi,
You create a rc script that will get invoked when someone runs shutdown. in this script you check for the existence of a connection and if so loop in your script until it goes away.
( hopefully you can figure out a way to let your shutdown script to know whether there is a connection to your server. )
Shutdown will hang forever waiting for your customized shutdown script to exit.
However a clever Sys Admin would see the script not exiting and kill it and shutdown will commence.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.