GSI Object Oriented Online Offline (Go4)
GO4-5.3.2
|
#include <TGo4HistogramServer.h>
Public Member Functions | |
virtual | ~TGo4HistogramServer () |
TGo4HistogramServer (TGo4AnalysisClient *owner, const char *servername="localhost", const char *password="go4", Bool_t useobjectserver=kFALSE) | |
TGo4HistogramServer () | |
Int_t | ServeObjectClient () |
UInt_t | GetObjPort () |
virtual Int_t | TimerConnect () |
TGo4AnalysisClient * | GetAnalysisClient () const |
TGo4Analysis * | GetAnalysis () const |
Public Member Functions inherited from TGo4CommandReceiver | |
virtual | ~TGo4CommandReceiver () |
TGo4CommandReceiver () | |
Static Public Attributes | |
static const char * | fgcCONTHREADNAME ="HISTOSERV-" |
static const char * | fgcOBJTHREADNAME ="OBJECTSERV-" |
static const char * | fgcSHUTDOWNNAME ="__HServLast__" |
static const char * | fgcCOMGETLIST ="__OServNamesList__" |
static const UInt_t | fguTIMERPERIOD =200 |
static const Int_t | fgiOPENWAITCYCLES =100 |
static const UInt_t | fguOPENWAITCYCLETIME =500 |
static const Int_t | fgiCLOSEWAITCYCLES =100 |
static const UInt_t | fguCLOSEWAITCYCLETIME =500 |
static const Int_t | fgiCONNECTWAITCYCLES =20 |
static const UInt_t | fguCONNECTWAITCYCLETIME =500 |
Private Member Functions | |
const char * | ConnectorName () const |
const char * | ObjectThreadName () const |
const char * | ConnectHost () const |
void | SetConnect (TGo4Socket *trans, const char *host, UInt_t port) |
void | SetDisConnect (TGo4Socket *trans) |
Int_t | WaitForOpen () |
Int_t | WaitForClose () |
Int_t | WaitForConnection () |
void | DisconnectObjectClient () |
Bool_t | CheckLogin () |
Int_t | ConnectObjectClient () |
Bool_t | HandleObjectRequest () |
Bool_t | SendObject (TObject *obj) |
Private Attributes | |
TGo4AnalysisClient * | fxAnalysisClient |
TGo4Analysis * | fxAnalysis |
TGo4ThreadHandler * | fxThreadHandler |
TString | fxServerName |
TString | fxServerPass |
TString | fxConnectorName |
TString | fxObjectThreadName |
Int_t | fiServerPort |
TGo4Socket * | fxTransport |
UInt_t | fuObjectPort |
TGo4Socket * | fxConnectTransport |
TGo4Socket * | fxDisConnectTransport |
TString | fcConnectHost |
UInt_t | fuConnectPort |
Bool_t | fbConnectRequest |
Bool_t | fbDisConnectRequest |
Bool_t | fbConnectIsOpen |
Bool_t | fbConnectIsDone |
Bool_t | fbConnectIsClose |
TGo4ObjConnectorTimer * | fxConnectorTimer |
Bool_t | fbUseObjectServer |
Friends | |
class | TGo4HisConnectorRunnable |
Handles a histogram server (mbs histogram protocol) for the histograms registered in the analysis. Optionally, object server for root may be started using Go4 protocoll style. This was disabled for V3 by default 09/2005
Definition at line 35 of file TGo4HistogramServer.h.
|
virtual |
remove and delete the objectserver thread:
Definition at line 148 of file TGo4HistogramServer.cxx.
References TGo4Socket::Close(), ConnectorName(), f_his_close(), f_his_gethis(), fbUseObjectServer, fgcSHUTDOWNNAME, fiServerPort, fxConnectorTimer, fxServerName, fxServerPass, fxThreadHandler, fxTransport, ObjectThreadName(), TGo4ThreadHandler::RemoveThread(), TGo4ThreadHandler::Stop(), and TGo4CommandInvoker::UnRegister().
TGo4HistogramServer::TGo4HistogramServer | ( | TGo4AnalysisClient * | owner, |
const char * | servername = "localhost" , |
||
const char * | password = "go4" , |
||
Bool_t | useobjectserver = kFALSE |
||
) |
Definition at line 57 of file TGo4HistogramServer.cxx.
References COMM__SUCCESS, ConnectorName(), f_his_server(), fbUseObjectServer, fgcCONTHREADNAME, fgcOBJTHREADNAME, fguTIMERPERIOD, fiServerPort, fxAnalysis, fxAnalysisClient, fxConnectorName, fxConnectorTimer, fxObjectThreadName, fxServerName, fxServerPass, fxThreadHandler, fxTransport, TGo4AnalysisClient::GetAnalysis(), TGo4TaskOwner::GetName(), TGo4Slave::GetThreadHandler(), TGo4CommandInvoker::Instance(), TGo4Analysis::Instance(), TGo4Analysis::Message(), TGo4ThreadHandler::NewThread(), ObjectThreadName(), TGo4CommandInvoker::Register(), TGo4ThreadHandler::Start(), and TGo4HisConnectorRunnable.
TGo4HistogramServer::TGo4HistogramServer | ( | ) |
Definition at line 135 of file TGo4HistogramServer.cxx.
References TGo4CommandInvoker::Instance(), and TGo4CommandInvoker::Register().
|
private |
Checks basename and passwd login of connected client
Definition at line 274 of file TGo4HistogramServer.cxx.
References DisconnectObjectClient(), fxServerName, fxServerPass, fxTransport, TGo4TaskHandler::Get_fgcERROR(), TGo4TaskHandler::Get_fgcOK(), TGo4Socket::RecvRaw(), and TGo4Socket::Send().
Referenced by ServeObjectClient().
|
inlineprivate |
Definition at line 104 of file TGo4HistogramServer.h.
References fcConnectHost.
Referenced by TimerConnect().
|
private |
Starts server socket waiting for the next client
Definition at line 213 of file TGo4HistogramServer.cxx.
References TGo4Log::Debug(), fuObjectPort, fxAnalysisClient, fxServerName, fxTransport, TGo4TaskHandler::Get_fgiPORTWAITCYCLES(), TGo4TaskHandler::Get_fguPORTWAITTIME(), GetObjPort(), TGo4TaskOwner::GetTask(), TGo4Analysis::Instance(), TGo4ThreadManager::IsTerminating(), TGo4Analysis::Message(), SetConnect(), TGo4Thread::Sleep(), WaitForConnection(), and WaitForOpen().
Referenced by ServeObjectClient().
|
inlineprivate |
Definition at line 100 of file TGo4HistogramServer.h.
References fxConnectorName.
Referenced by TGo4HistogramServer(), and ~TGo4HistogramServer().
|
private |
Terminate connection to current object client, keep waiting for the next one
Definition at line 204 of file TGo4HistogramServer.cxx.
References fxTransport, SetDisConnect(), and WaitForClose().
Referenced by CheckLogin(), and ServeObjectClient().
|
inline |
Definition at line 63 of file TGo4HistogramServer.h.
References fxAnalysis.
Referenced by TGo4HisConnectorRunnable::Run().
|
inline |
Definition at line 61 of file TGo4HistogramServer.h.
References fxAnalysisClient.
UInt_t TGo4HistogramServer::GetObjPort | ( | ) |
returns the portnumber for object server connection
Definition at line 570 of file TGo4HistogramServer.cxx.
References fuObjectPort, fxTransport, and TGo4Socket::GetPort().
Referenced by ConnectObjectClient().
|
private |
Ask for which object to send and give it to the client
Definition at line 312 of file TGo4HistogramServer.cxx.
References fgcCOMGETLIST, TGo4ThreadManager::fguTEXTLENGTH, fxAnalysis, fxTransport, TGo4Analysis::GetNamesList(), TGo4Analysis::GetObject(), TGo4Socket::RecvRaw(), SendObject(), and TGo4Analysis::UpdateNamesList().
Referenced by ServeObjectClient().
|
inlineprivate |
Definition at line 102 of file TGo4HistogramServer.h.
References fxObjectThreadName.
Referenced by TGo4HistogramServer(), and ~TGo4HistogramServer().
|
private |
Send object to the current object client. Protocol matches TGo4ObjectClient::ReceiveObject()
Definition at line 344 of file TGo4HistogramServer.cxx.
References TGo4Log::Debug(), fxTransport, TGo4TaskHandler::Get_fgcERROR(), TGo4TaskHandler::Get_fgcOK(), TGo4Socket::RecvRaw(), TGo4Socket::Send(), TGo4Socket::SendBuffer(), and TGo4Buffer.
Referenced by HandleObjectRequest().
Int_t TGo4HistogramServer::ServeObjectClient | ( | ) |
Used by object connector runnable to serve client request
Definition at line 192 of file TGo4HistogramServer.cxx.
References CheckLogin(), ConnectObjectClient(), DisconnectObjectClient(), and HandleObjectRequest().
Referenced by TGo4ObjConnectorRunnable::Run().
|
private |
Definition at line 387 of file TGo4HistogramServer.cxx.
References fbConnectRequest, fcConnectHost, fuConnectPort, fxConnectTransport, and GO4TRACE.
Referenced by ConnectObjectClient().
|
private |
Definition at line 396 of file TGo4HistogramServer.cxx.
References fbDisConnectRequest, fxDisConnectTransport, and GO4TRACE.
Referenced by DisconnectObjectClient().
|
virtual |
This method is used by the object connectortimer Notify to connect or disconnect a transportchannel (TSocket) on demand; the connection process itself is handled by the connector runnable
Definition at line 403 of file TGo4HistogramServer.cxx.
References TGo4Socket::Close(), ConnectHost(), fbConnectIsClose, fbConnectIsDone, fbConnectIsOpen, fbConnectRequest, fbDisConnectRequest, fuConnectPort, fxConnectTransport, fxDisConnectTransport, GO4TRACE, TGo4Socket::IsOpen(), and TGo4Socket::Open().
Referenced by TGo4ObjConnectorTimer::Notify().
|
private |
Definition at line 517 of file TGo4HistogramServer.cxx.
References fbConnectIsClose, fgiCLOSEWAITCYCLES, fguCLOSEWAITCYCLETIME, GO4TRACE, and TGo4Thread::Sleep().
Referenced by DisconnectObjectClient().
|
private |
Definition at line 543 of file TGo4HistogramServer.cxx.
References fbConnectIsDone, fguCONNECTWAITCYCLETIME, fxAnalysisClient, TGo4TaskOwner::GetTask(), GO4TRACE, TGo4ThreadManager::IsTerminating(), and TGo4Thread::Sleep().
Referenced by ConnectObjectClient().
|
private |
Definition at line 485 of file TGo4HistogramServer.cxx.
References fbConnectIsOpen, fgiOPENWAITCYCLES, fguOPENWAITCYCLETIME, fxAnalysisClient, TGo4TaskOwner::GetTask(), GO4TRACE, TGo4ThreadManager::IsTerminating(), and TGo4Thread::Sleep().
Referenced by ConnectObjectClient().
|
friend |
Definition at line 37 of file TGo4HistogramServer.h.
Referenced by TGo4HistogramServer().
|
private |
True if fxConnectTransport has returned from Close(), i.e. connection was closed
Definition at line 186 of file TGo4HistogramServer.h.
Referenced by TimerConnect(), and WaitForClose().
|
private |
True if fxConnectTransport has returned from Open(), i.e. connection was established
Definition at line 182 of file TGo4HistogramServer.h.
Referenced by TimerConnect(), and WaitForConnection().
|
private |
True if fxConnectTransport waits in server Open() call
Definition at line 178 of file TGo4HistogramServer.h.
Referenced by TimerConnect(), and WaitForOpen().
|
private |
True if fxConnectTransport shall be Open() by Timer
Definition at line 172 of file TGo4HistogramServer.h.
Referenced by SetConnect(), and TimerConnect().
|
private |
True if fxConnectTransport shall be Close() by Timer
Definition at line 175 of file TGo4HistogramServer.h.
Referenced by SetDisConnect(), and TimerConnect().
|
private |
Switches Go4 objectserver option on/off
Definition at line 195 of file TGo4HistogramServer.h.
Referenced by TGo4HistogramServer(), and ~TGo4HistogramServer().
|
private |
hostname for timer connect
Definition at line 166 of file TGo4HistogramServer.h.
Referenced by ConnectHost(), and SetConnect().
|
static |
command string for object server nameslist request
Definition at line 75 of file TGo4HistogramServer.h.
Referenced by HandleObjectRequest(), and TGo4ObjClient::RequestNamesList().
|
static |
histogram server connector thread name
Definition at line 66 of file TGo4HistogramServer.h.
Referenced by TGo4HistogramServer().
|
static |
object server connector thread name
Definition at line 69 of file TGo4HistogramServer.h.
Referenced by TGo4HistogramServer().
|
static |
This string is send as histogram name for termination connection
Definition at line 72 of file TGo4HistogramServer.h.
Referenced by TGo4HisConnectorRunnable::Run(), and ~TGo4HistogramServer().
|
static |
Maximum cycles to wait until transport is closed
Definition at line 87 of file TGo4HistogramServer.h.
Referenced by WaitForClose().
|
static |
Maximum cycles to wait until transport is connected
Definition at line 93 of file TGo4HistogramServer.h.
|
static |
Maximum cycles to wait until transport is open
Definition at line 81 of file TGo4HistogramServer.h.
Referenced by WaitForOpen().
|
static |
Time for each close wait cycle, in ms
Definition at line 90 of file TGo4HistogramServer.h.
Referenced by WaitForClose().
|
static |
Time for each connect wait cycle, in ms
Definition at line 96 of file TGo4HistogramServer.h.
Referenced by WaitForConnection().
|
static |
Time for each open wait cycle, in ms
Definition at line 84 of file TGo4HistogramServer.h.
Referenced by WaitForOpen().
|
static |
Period of connector timer, in ms
Definition at line 78 of file TGo4HistogramServer.h.
Referenced by TGo4HistogramServer().
|
private |
port number for server socket
Definition at line 149 of file TGo4HistogramServer.h.
Referenced by TGo4HistogramServer(), and ~TGo4HistogramServer().
|
private |
port number for timer connect
Definition at line 169 of file TGo4HistogramServer.h.
Referenced by SetConnect(), and TimerConnect().
|
private |
port number for the object server connections
Definition at line 155 of file TGo4HistogramServer.h.
Referenced by ConnectObjectClient(), and GetObjPort().
|
private |
Definition at line 133 of file TGo4HistogramServer.h.
Referenced by GetAnalysis(), HandleObjectRequest(), and TGo4HistogramServer().
|
private |
Definition at line 132 of file TGo4HistogramServer.h.
Referenced by ConnectObjectClient(), GetAnalysisClient(), TGo4HistogramServer(), WaitForConnection(), and WaitForOpen().
|
private |
Name of connector thread
Definition at line 143 of file TGo4HistogramServer.h.
Referenced by ConnectorName(), and TGo4HistogramServer().
|
private |
timer responsible for the connection/disconnection of clients; independent of application control timer 1
Definition at line 192 of file TGo4HistogramServer.h.
Referenced by TGo4HistogramServer(), and ~TGo4HistogramServer().
|
private |
link to the next TaskHandler transport instance that shall be connected by the Object connector Timer with the client
Definition at line 159 of file TGo4HistogramServer.h.
Referenced by SetConnect(), and TimerConnect().
|
private |
link to the next TaskHandler transport instance that shall be disconnected by the connector Timer with the client
Definition at line 163 of file TGo4HistogramServer.h.
Referenced by SetDisConnect(), and TimerConnect().
|
private |
Name of object server thread
Definition at line 146 of file TGo4HistogramServer.h.
Referenced by ObjectThreadName(), and TGo4HistogramServer().
|
private |
contains api server name
Definition at line 137 of file TGo4HistogramServer.h.
Referenced by CheckLogin(), ConnectObjectClient(), TGo4HistogramServer(), and ~TGo4HistogramServer().
|
private |
contains api server password
Definition at line 140 of file TGo4HistogramServer.h.
Referenced by CheckLogin(), TGo4HistogramServer(), and ~TGo4HistogramServer().
|
private |
Definition at line 134 of file TGo4HistogramServer.h.
Referenced by TGo4HistogramServer(), and ~TGo4HistogramServer().
|
private |
socket for object server
Definition at line 152 of file TGo4HistogramServer.h.
Referenced by CheckLogin(), ConnectObjectClient(), DisconnectObjectClient(), GetObjPort(), HandleObjectRequest(), SendObject(), TGo4HistogramServer(), and ~TGo4HistogramServer().