00001 // $Id: TGo4ComServerQuit.cxx 614 2010-04-13 15:39:33Z linev $ 00002 //----------------------------------------------------------------------- 00003 // The GSI Online Offline Object Oriented (Go4) Project 00004 // Experiment Data Processing at EE department, GSI 00005 //----------------------------------------------------------------------- 00006 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH 00007 // Planckstr. 1, 64291 Darmstadt, Germany 00008 // Contact: http://go4.gsi.de 00009 //----------------------------------------------------------------------- 00010 // This software can be used under the license agreements as stated 00011 // in Go4License.txt file which is part of the distribution. 00012 //----------------------------------------------------------------------- 00013 00014 #include "TGo4ComServerQuit.h" 00015 00016 #include "TGo4Log.h" 00017 #include "TGo4ServerTask.h" 00018 00019 TGo4ComServerQuit::TGo4ComServerQuit() : 00020 TGo4TaskHandlerCommand("SVQuit","quits the server and the whole application") 00021 { 00022 SetReceiverName("ServerTask"); // sets the receiver name checked by command invoker 00023 // receiver name need to be class name! 00024 fbIsSynchron = kFALSE; 00025 fbIsLocal = kFALSE; // we misuse this old command to send it to analysis server for shutdown 00026 SetProtection(kGo4ComModeAdministrator); 00027 } 00028 00029 TGo4ComServerQuit::~TGo4ComServerQuit() 00030 { 00031 } 00032 00033 Int_t TGo4ComServerQuit::ExeCom() 00034 { 00035 TGo4ServerTask* server = dynamic_cast<TGo4ServerTask*>(fxReceiverBase); 00036 if (server!=0) { 00037 server->Quit(); // Quit will disconnect clients one by one 00038 //server->Shutdown(); // Shutdown will terminate without waiting for clients removed properly 00039 return 0; 00040 } 00041 00042 TGo4Log::Debug(" !!! ComServerQuit ''%s'': NO RECEIVER ERROR!!!",GetName()); 00043 return 1; 00044 }