00001 //--------------------------------------------------------------- 00002 // Go4 Release Package v2.10-5 (build 21005) 00003 // 03-Nov-2005 00004 //--------------------------------------------------------------- 00005 // The GSI Online Offline Object Oriented (Go4) Project 00006 // Experiment Data Processing at DVEE department, GSI 00007 //--------------------------------------------------------------- 00008 // 00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI 00010 // Planckstr. 1, 64291 Darmstadt, Germany 00011 //Contact: http://go4.gsi.de 00012 //---------------------------------------------------------------- 00013 //This software can be used under the license agreements as stated 00014 //in Go4License.txt file which is part of the distribution. 00015 //---------------------------------------------------------------- 00016 #include "TGo4ComServerQuit.h" 00017 00018 #include <iostream.h> 00019 00020 #include "Go4Log/TGo4Log.h" 00021 #include "Go4TaskHandler/TGo4Master.h" 00022 #include "Go4TaskHandler/TGo4ServerTask.h" 00023 00024 TGo4ComServerQuit::TGo4ComServerQuit() 00025 :TGo4TaskHandlerCommand("SVQuit","quits the server and the whole application") 00026 { 00027 SetReceiverName("ServerTask"); // sets the receiver name checked by command invoker 00028 // receiver name neednt be class name! 00029 fbIsSynchron=kFALSE; 00030 fbIsLocal=kFALSE; // we misuse this old command to send it to analysis server for shutdown 00031 SetProtection(kGo4ComModeAdministrator); 00032 } 00033 00034 TGo4ComServerQuit::~TGo4ComServerQuit() 00035 { 00036 } 00037 00038 Int_t TGo4ComServerQuit::ExeCom() 00039 { 00040 TGo4ServerTask* server=dynamic_cast<TGo4ServerTask*>(fxReceiverBase); 00041 if (server!=0) 00042 { 00043 //server->Quit(); // Quit will disconnect clients one by one 00044 server->Shutdown(); // Shutdown will terminate without waiting for clients removed properly 00045 return 0; 00046 } 00047 else 00048 { 00049 TGo4Log::Debug(" !!! ComServerQuit ''%s'': NO RECEIVER ERROR!!!",GetName()); 00050 return 1; 00051 } 00052 return -1; 00053 } 00054 00055 ClassImp(TGo4ComServerQuit) 00056 00057 //----------------------------END OF GO4 SOURCE FILE ---------------------