#include "TGo4ComServerQuit.h" #include "Riostream.h" #include "TGo4Log.h" #include "TGo4ServerTask.h" TGo4ComServerQuit::TGo4ComServerQuit() :TGo4TaskHandlerCommand("SVQuit","quits the server and the whole application") { SetReceiverName("ServerTask"); // sets the receiver name checked by command invoker // receiver name neednt be class name! fbIsSynchron=kFALSE; fbIsLocal=kFALSE; // we misuse this old command to send it to analysis server for shutdown SetProtection(kGo4ComModeAdministrator); } TGo4ComServerQuit::~TGo4ComServerQuit() { } Int_t TGo4ComServerQuit::ExeCom() { TGo4ServerTask* server=dynamic_cast(fxReceiverBase); if (server!=0) { //server->Quit(); // Quit will disconnect clients one by one server->Shutdown(); // Shutdown will terminate without waiting for clients removed properly return 0; } else { TGo4Log::Debug(" !!! ComServerQuit ''%s'': NO RECEIVER ERROR!!!",GetName()); return 1; } return -1; }