16 #include "Riostream.h"
20 #include "TGo4LockGuard.h"
58 const char* servername,
60 Bool_t useobjectserver)
61 : fxAnalysisClient(owner), fxThreadHandler(0), fiServerPort(0),
62 fxTransport(0), fuObjectPort(0), fxConnectTransport(0), fxDisConnectTransport(0),
64 fbConnectRequest(kFALSE), fbDisConnectRequest(kFALSE),
65 fbConnectIsOpen(kFALSE), fbConnectIsDone(kFALSE),fbConnectIsClose(kTRUE),
67 fbUseObjectServer(useobjectserver)
79 "Created Histogram server %s on port %d",
86 "ERROR %d on creation of Histogram server",
90 const char* ownername;
99 ownername=
"never-come-here";
130 std::cerr <<
" Histogram Server constructor FATAL ERROR: no threadmanager !!" << std::endl;
136 : fxAnalysisClient(0), fxThreadHandler(0), fiServerPort(0),
137 fxTransport(0), fuObjectPort(0), fxConnectTransport(0), fxDisConnectTransport(0),
138 fcConnectHost(0), fuConnectPort(0),
139 fbConnectRequest(kFALSE), fbDisConnectRequest(kFALSE),
140 fbConnectIsOpen(kFALSE), fbConnectIsDone(kFALSE),fbConnectIsClose(kTRUE),
141 fbUseObjectServer(kFALSE)
154 INTS4 * pl_all =NULL;
195 if(rev<0)
return rev;
216 static Bool_t isfirsttime=kTRUE;
220 if(waitresult==-2)
return waitresult;
224 TGo4Log::Debug(
" HistogramServer: Negotiation channel open TIMEOUT");
225 std::cerr <<
" HistogramServer TIMEOUT ERROR opening socket connection !!! Terminating..." << std::endl;
234 TGo4Log::Debug(
" HistogramServer: Negotiation port getter TIMEOUT");
235 std::cerr <<
" HistogramServer TIMEOUT ERROR retrieving port number !!! Terminating..." << std::endl;
254 "Object Server %s is waiting on port %d",
260 if(connectwaitseconds<0)
264 return connectwaitseconds;
289 std::cerr <<
"##### check login with wrong base" << std::endl;
304 std::cerr <<
"##### check login with wrong passwd" << std::endl;
320 std::cerr <<
"-----Object server received null character for object request!"<< std::endl;
349 TBuffer* rootbuffer=0;
355 TFile *filsav = gFile;
357 rootbuffer->WriteObject(
object);
371 TGo4Log::Debug(
" HistogramServer: null character on finishing object client channel ");
376 TGo4Log::Debug(
" HistogramServer: ERROR on finishing object client channel ");
389 GO4TRACE((12,
"TGo4HistogramServer::SetConnect(TGo4Socket *)",__LINE__, __FILE__));
398 GO4TRACE((12,
"TGo4HistogramServer::SetDisConnect(TGo4Socket *)",__LINE__, __FILE__));
405 GO4TRACE((12,
"TGo4HistogramServer::TimerConnect()",__LINE__, __FILE__));
411 GO4TRACE((15,
"TGo4HistogramServer::TimerConnect()--DisConnectRequest",__LINE__, __FILE__));
428 GO4TRACE((15,
"TGo4HistogramServer::TimerConnect()--NO DisConnectRequest",__LINE__, __FILE__));
437 GO4TRACE((15,
"TGo4HistogramServer::TimerConnect()--ConnectRequest",__LINE__, __FILE__));
443 GO4TRACE((10,
"TGo4HistogramServer::TimerConnect()--transport is not open",__LINE__, __FILE__));
462 GO4TRACE((10,
"TGo4HistogramServer::TimerConnect()--transport already open",__LINE__, __FILE__));
469 GO4TRACE((10,
"TGo4HistogramServer::TimerConnect()--no transport specified",__LINE__, __FILE__));
475 GO4TRACE((15,
"TGo4HistogramServer::TimerConnect()--NO ConnectRequest",__LINE__, __FILE__));
488 GO4TRACE((12,
"TGo4HistogramServer::WaitForOpen()",__LINE__, __FILE__));
520 GO4TRACE((12,
"TGo4HistogramServer::WaitForClose()",__LINE__, __FILE__));
546 GO4TRACE((12,
"TGo4HistogramServer::WaitForConnection()",__LINE__, __FILE__));
TGo4ThreadHandler * GetThreadHandler()
virtual Int_t Close(Option_t *opt="")
static UInt_t Get_fguPORTWAITTIME()
virtual Int_t Send(TObject *obj)
const char * ConnectHost() const
Int_t SendBuffer(TBuffer *buf)
static void UnRegister(TGo4CommandReceiver *p)
static const char * fgcCONTHREADNAME
TGo4ObjConnectorTimer * fxConnectorTimer
Int_t ServeObjectClient()
TGo4AnalysisClient * fxAnalysisClient
static const Int_t fgiCLOSEWAITCYCLES
TString fxObjectThreadName
static const char * Get_fgcERROR()
const char * ObjectThreadName() const
static void Sleep(UInt_t millisecs)
static const char * Get_fgcOK()
friend class TGo4HisConnectorRunnable
void DisconnectObjectClient()
static void Register(const char *name, TGo4CommandReceiver *p)
virtual Int_t Open(const char *host, Int_t port, Bool_t keepservsock=kFALSE)
Bool_t NewThread(const char *name, TGo4Runnable *runnable)
static const Int_t fgiOPENWAITCYCLES
TGo4Analysis * fxAnalysis
Bool_t HandleObjectRequest()
TGo4ThreadHandler * fxThreadHandler
static const char * fgcSHUTDOWNNAME
static TGo4CommandInvoker * Instance()
void Message(Int_t prio, const char *text,...)
TGo4Analysis * GetAnalysis() const
static const UInt_t fguCONNECTWAITCYCLETIME
static const char * fgcOBJTHREADNAME
Bool_t Stop(const char *thname)
static const UInt_t fguTIMERPERIOD
const char * GetName() const
Bool_t fbDisConnectRequest
void SetDisConnect(TGo4Socket *trans)
Bool_t Start(const char *thname)
const char * ConnectorName() const
TGo4Socket * fxConnectTransport
Int_t WaitForConnection()
INTS4 f_his_gethis(const char *, int, const char *, const char *, const char *, s_his_head **, INTS4 **, INTS4 *)
virtual ~TGo4HistogramServer()
TGo4AnalysisObjectNames * GetNamesList() const
virtual Int_t TimerConnect()
static const UInt_t fguOPENWAITCYCLETIME
Bool_t RemoveThread(const char *name)
static const Int_t fgiCONNECTWAITCYCLES
Int_t ConnectObjectClient()
static const UInt_t fguCLOSEWAITCYCLETIME
TNamed * GetObject(const char *name, const char *folder=0)
Bool_t IsTerminating() const
static Int_t Get_fgiPORTWAITCYCLES()
INTS4 f_his_server(CHARS *pc_base, CHARS *pc_access, INTS4 *pl_port)
static const char * fgcCOMGETLIST
static TGo4Analysis * Instance()
virtual char * RecvRaw(const char *name=0)
TGo4Socket * fxDisConnectTransport
Bool_t SendObject(TObject *obj)
void SetConnect(TGo4Socket *trans, const char *host, UInt_t port)
static void Debug(const char *text,...)