GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4HistogramServer Class Reference

Handles a histogram server (mbs histogram protocol) for the histograms registered in the analysis. More...

#include <TGo4HistogramServer.h>

+ Inheritance diagram for TGo4HistogramServer:

Public Member Functions

 TGo4HistogramServer ()
 
 TGo4HistogramServer (TGo4AnalysisClient *owner, const char *servername="localhost", const char *password="go4", Bool_t useobjectserver=kFALSE)
 
virtual ~TGo4HistogramServer ()
 
TGo4AnalysisGetAnalysis () const
 
TGo4AnalysisClientGetAnalysisClient () const
 
UInt_t GetObjPort ()
 returns the portnumber for object server connection
 
Int_t ServeObjectClient ()
 Used by object connector runnable to serve client request.
 
virtual Int_t TimerConnect ()
 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.
 
- Public Member Functions inherited from TGo4CommandReceiver
 TGo4CommandReceiver ()
 
virtual ~TGo4CommandReceiver ()
 

Static Public Attributes

static const char * fgcCOMGETLIST = "__OServNamesList__"
 command string for object server nameslist request
 
static const char * fgcCONTHREADNAME = "HISTOSERV-"
 histogram server connector thread name
 
static const char * fgcOBJTHREADNAME = "OBJECTSERV-"
 object server connector thread name
 
static const char * fgcSHUTDOWNNAME = "__HServLast__"
 This string is send as histogram name for termination connection.
 
static const Int_t fgiCLOSEWAITCYCLES = 100
 Maximum cycles to wait until transport is closed.
 
static const Int_t fgiCONNECTWAITCYCLES = 20
 Maximum cycles to wait until transport is connected.
 
static const Int_t fgiOPENWAITCYCLES = 100
 Maximum cycles to wait until transport is open.
 
static const UInt_t fguCLOSEWAITCYCLETIME = 500
 Time for each close wait cycle, in ms.
 
static const UInt_t fguCONNECTWAITCYCLETIME = 500
 Time for each connect wait cycle, in ms.
 
static const UInt_t fguOPENWAITCYCLETIME = 500
 Time for each open wait cycle, in ms.
 
static const UInt_t fguTIMERPERIOD = 200
 Period of connector timer, in ms.
 

Private Member Functions

Bool_t CheckLogin ()
 Checks basename and passwd login of connected client.
 
const char * ConnectHost () const
 
Int_t ConnectObjectClient ()
 Starts server socket waiting for the next client.
 
const char * ConnectorName () const
 
void DisconnectObjectClient ()
 Terminate connection to current object client, keep waiting for the next one.
 
Bool_t HandleObjectRequest ()
 Ask for which object to send and give it to the client.
 
const char * ObjectThreadName () const
 
Bool_t SendObject (TObject *obj)
 Send object to the current object client.
 
void SetConnect (TGo4Socket *trans, const char *host, UInt_t port)
 
void SetDisConnect (TGo4Socket *trans)
 
Int_t WaitForClose ()
 
Int_t WaitForConnection ()
 
Int_t WaitForOpen ()
 

Private Attributes

Bool_t fbConnectIsClose {kFALSE}
 True if fxConnectTransport has returned from Close(), i.e.
 
Bool_t fbConnectIsDone {kFALSE}
 True if fxConnectTransport has returned from Open(), i.e.
 
Bool_t fbConnectIsOpen {kFALSE}
 True if fxConnectTransport waits in server Open() call.
 
Bool_t fbConnectRequest {kFALSE}
 True if fxConnectTransport shall be Open() by Timer.
 
Bool_t fbDisConnectRequest {kFALSE}
 True if fxConnectTransport shall be Close() by Timer.
 
Bool_t fbUseObjectServer {kFALSE}
 Switches Go4 objectserver option on/off.
 
TString fcConnectHost
 hostname for timer connect
 
Int_t fiServerPort {0}
 port number for server socket
 
UInt_t fuConnectPort {0}
 port number for timer connect
 
UInt_t fuObjectPort {0}
 port number for the object server connections
 
TGo4AnalysisfxAnalysis {nullptr}
 
TGo4AnalysisClientfxAnalysisClient {nullptr}
 
TString fxConnectorName
 Name of connector thread.
 
TGo4ObjConnectorTimerfxConnectorTimer {nullptr}
 timer responsible for the connection/disconnection of clients; independent of application control timer aggregationByValue 1
 
TGo4SocketfxConnectTransport {nullptr}
 link to the next TaskHandler transport instance that shall be connected by the Object connector Timer with the client
 
TGo4SocketfxDisConnectTransport {nullptr}
 link to the next TaskHandler transport instance that shall be disconnected by the connector Timer with the client
 
TString fxObjectThreadName
 Name of object server thread.
 
TString fxServerName
 contains api server name
 
TString fxServerPass
 contains api server password
 
TGo4ThreadHandlerfxThreadHandler {nullptr}
 
TGo4SocketfxTransport {nullptr}
 socket for object server
 

Friends

class TGo4HisConnectorRunnable
 

Detailed Description

Handles a histogram server (mbs histogram protocol) for the histograms registered in the analysis.

Optionally, object server for root may be started using Go4 protocol style. This was disabled for V3 by default 09/2005

Author
J. Adamczewski
Since
23-Sep-2002, reduced 14-Jan-2003

Definition at line 35 of file TGo4HistogramServer.h.

Constructor & Destructor Documentation

◆ TGo4HistogramServer() [1/2]

◆ TGo4HistogramServer() [2/2]

◆ ~TGo4HistogramServer()

TGo4HistogramServer::~TGo4HistogramServer ( )
virtual

Member Function Documentation

◆ CheckLogin()

Bool_t TGo4HistogramServer::CheckLogin ( )
private

Checks basename and passwd login of connected client.

Definition at line 230 of file TGo4HistogramServer.cxx.

References DisconnectObjectClient(), fxServerName, fxServerPass, fxTransport, TGo4TaskHandler::Get_fgcERROR(), and TGo4TaskHandler::Get_fgcOK().

Referenced by ServeObjectClient().

◆ ConnectHost()

const char * TGo4HistogramServer::ConnectHost ( ) const
inlineprivate

Definition at line 104 of file TGo4HistogramServer.h.

References fcConnectHost.

Referenced by TimerConnect().

◆ ConnectObjectClient()

◆ ConnectorName()

const char * TGo4HistogramServer::ConnectorName ( ) const
inlineprivate

Definition at line 100 of file TGo4HistogramServer.h.

References fxConnectorName.

Referenced by TGo4HistogramServer(), and ~TGo4HistogramServer().

◆ DisconnectObjectClient()

void TGo4HistogramServer::DisconnectObjectClient ( )
private

Terminate connection to current object client, keep waiting for the next one.

Definition at line 172 of file TGo4HistogramServer.cxx.

References fxTransport, SetDisConnect(), and WaitForClose().

Referenced by CheckLogin(), and ServeObjectClient().

◆ GetAnalysis()

TGo4Analysis * TGo4HistogramServer::GetAnalysis ( ) const
inline

Definition at line 63 of file TGo4HistogramServer.h.

References fxAnalysis.

◆ GetAnalysisClient()

TGo4AnalysisClient * TGo4HistogramServer::GetAnalysisClient ( ) const
inline

Definition at line 61 of file TGo4HistogramServer.h.

References fxAnalysisClient.

◆ GetObjPort()

UInt_t TGo4HistogramServer::GetObjPort ( )

returns the portnumber for object server connection

Definition at line 455 of file TGo4HistogramServer.cxx.

References fuObjectPort, and fxTransport.

Referenced by ConnectObjectClient().

◆ HandleObjectRequest()

Bool_t TGo4HistogramServer::HandleObjectRequest ( )
private

Ask for which object to send and give it to the client.

Definition at line 260 of file TGo4HistogramServer.cxx.

References fgcCOMGETLIST, TGo4ThreadManager::fguTEXTLENGTH, fxAnalysis, fxTransport, SendObject(), and TGo4LockGuard.

Referenced by ServeObjectClient().

◆ ObjectThreadName()

const char * TGo4HistogramServer::ObjectThreadName ( ) const
inlineprivate

Definition at line 102 of file TGo4HistogramServer.h.

References fxObjectThreadName.

Referenced by TGo4HistogramServer(), and ~TGo4HistogramServer().

◆ SendObject()

Bool_t TGo4HistogramServer::SendObject ( TObject * obj)
private

Send object to the current object client.

Protocol matches TGo4ObjectClient::ReceiveObject()

Definition at line 284 of file TGo4HistogramServer.cxx.

References TGo4Log::Debug(), fxTransport, TGo4TaskHandler::Get_fgcERROR(), TGo4TaskHandler::Get_fgcOK(), and TGo4LockGuard.

Referenced by HandleObjectRequest().

◆ ServeObjectClient()

Int_t TGo4HistogramServer::ServeObjectClient ( )

Used by object connector runnable to serve client request.

Definition at line 159 of file TGo4HistogramServer.cxx.

References CheckLogin(), ConnectObjectClient(), DisconnectObjectClient(), and HandleObjectRequest().

◆ SetConnect()

void TGo4HistogramServer::SetConnect ( TGo4Socket * trans,
const char * host,
UInt_t port )
private

◆ SetDisConnect()

void TGo4HistogramServer::SetDisConnect ( TGo4Socket * trans)
private

Definition at line 325 of file TGo4HistogramServer.cxx.

References fbDisConnectRequest, fxDisConnectTransport, and GO4TRACE.

Referenced by DisconnectObjectClient().

◆ TimerConnect()

Int_t TGo4HistogramServer::TimerConnect ( )
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 332 of file TGo4HistogramServer.cxx.

References ConnectHost(), fbConnectIsClose, fbConnectIsDone, fbConnectIsOpen, fbConnectRequest, fbDisConnectRequest, fuConnectPort, fxConnectTransport, fxDisConnectTransport, and GO4TRACE.

◆ WaitForClose()

Int_t TGo4HistogramServer::WaitForClose ( )
private

◆ WaitForConnection()

Int_t TGo4HistogramServer::WaitForConnection ( )
private

◆ WaitForOpen()

Int_t TGo4HistogramServer::WaitForOpen ( )
private

Friends And Related Symbol Documentation

◆ TGo4HisConnectorRunnable

friend class TGo4HisConnectorRunnable
friend

Definition at line 37 of file TGo4HistogramServer.h.

References TGo4HisConnectorRunnable.

Referenced by TGo4HistogramServer(), and TGo4HisConnectorRunnable.

Field Documentation

◆ fbConnectIsClose

Bool_t TGo4HistogramServer::fbConnectIsClose {kFALSE}
private

True if fxConnectTransport has returned from Close(), i.e.

connection was closed

Definition at line 186 of file TGo4HistogramServer.h.

Referenced by TGo4HistogramServer(), TGo4HistogramServer(), TimerConnect(), and WaitForClose().

◆ fbConnectIsDone

Bool_t TGo4HistogramServer::fbConnectIsDone {kFALSE}
private

True if fxConnectTransport has returned from Open(), i.e.

connection was established

Definition at line 182 of file TGo4HistogramServer.h.

Referenced by TGo4HistogramServer(), TGo4HistogramServer(), TimerConnect(), and WaitForConnection().

◆ fbConnectIsOpen

Bool_t TGo4HistogramServer::fbConnectIsOpen {kFALSE}
private

True if fxConnectTransport waits in server Open() call.

Definition at line 178 of file TGo4HistogramServer.h.

Referenced by TGo4HistogramServer(), TGo4HistogramServer(), TimerConnect(), and WaitForOpen().

◆ fbConnectRequest

Bool_t TGo4HistogramServer::fbConnectRequest {kFALSE}
private

True if fxConnectTransport shall be Open() by Timer.

Definition at line 172 of file TGo4HistogramServer.h.

Referenced by TGo4HistogramServer(), TGo4HistogramServer(), SetConnect(), and TimerConnect().

◆ fbDisConnectRequest

Bool_t TGo4HistogramServer::fbDisConnectRequest {kFALSE}
private

True if fxConnectTransport shall be Close() by Timer.

Definition at line 175 of file TGo4HistogramServer.h.

Referenced by TGo4HistogramServer(), TGo4HistogramServer(), SetDisConnect(), and TimerConnect().

◆ fbUseObjectServer

Bool_t TGo4HistogramServer::fbUseObjectServer {kFALSE}
private

Switches Go4 objectserver option on/off.

Definition at line 195 of file TGo4HistogramServer.h.

Referenced by TGo4HistogramServer(), TGo4HistogramServer(), and ~TGo4HistogramServer().

◆ fcConnectHost

TString TGo4HistogramServer::fcConnectHost
private

hostname for timer connect

Definition at line 166 of file TGo4HistogramServer.h.

Referenced by TGo4HistogramServer(), ConnectHost(), and SetConnect().

◆ fgcCOMGETLIST

const char * TGo4HistogramServer::fgcCOMGETLIST = "__OServNamesList__"
static

command string for object server nameslist request

Definition at line 75 of file TGo4HistogramServer.h.

Referenced by HandleObjectRequest(), and TGo4ObjClient::RequestNamesList().

◆ fgcCONTHREADNAME

const char * TGo4HistogramServer::fgcCONTHREADNAME = "HISTOSERV-"
static

histogram server connector thread name

Definition at line 66 of file TGo4HistogramServer.h.

Referenced by TGo4HistogramServer().

◆ fgcOBJTHREADNAME

const char * TGo4HistogramServer::fgcOBJTHREADNAME = "OBJECTSERV-"
static

object server connector thread name

Definition at line 69 of file TGo4HistogramServer.h.

Referenced by TGo4HistogramServer().

◆ fgcSHUTDOWNNAME

const char * TGo4HistogramServer::fgcSHUTDOWNNAME = "__HServLast__"
static

This string is send as histogram name for termination connection.

Definition at line 72 of file TGo4HistogramServer.h.

Referenced by ~TGo4HistogramServer(), and TGo4HisConnectorRunnable::Run().

◆ fgiCLOSEWAITCYCLES

const Int_t TGo4HistogramServer::fgiCLOSEWAITCYCLES = 100
static

Maximum cycles to wait until transport is closed.

Definition at line 87 of file TGo4HistogramServer.h.

Referenced by WaitForClose().

◆ fgiCONNECTWAITCYCLES

const Int_t TGo4HistogramServer::fgiCONNECTWAITCYCLES = 20
static

Maximum cycles to wait until transport is connected.

Definition at line 93 of file TGo4HistogramServer.h.

◆ fgiOPENWAITCYCLES

const Int_t TGo4HistogramServer::fgiOPENWAITCYCLES = 100
static

Maximum cycles to wait until transport is open.

Definition at line 81 of file TGo4HistogramServer.h.

Referenced by WaitForOpen().

◆ fguCLOSEWAITCYCLETIME

const UInt_t TGo4HistogramServer::fguCLOSEWAITCYCLETIME = 500
static

Time for each close wait cycle, in ms.

Definition at line 90 of file TGo4HistogramServer.h.

Referenced by WaitForClose().

◆ fguCONNECTWAITCYCLETIME

const UInt_t TGo4HistogramServer::fguCONNECTWAITCYCLETIME = 500
static

Time for each connect wait cycle, in ms.

Definition at line 96 of file TGo4HistogramServer.h.

Referenced by WaitForConnection().

◆ fguOPENWAITCYCLETIME

const UInt_t TGo4HistogramServer::fguOPENWAITCYCLETIME = 500
static

Time for each open wait cycle, in ms.

Definition at line 84 of file TGo4HistogramServer.h.

Referenced by WaitForOpen().

◆ fguTIMERPERIOD

const UInt_t TGo4HistogramServer::fguTIMERPERIOD = 200
static

Period of connector timer, in ms.

Definition at line 78 of file TGo4HistogramServer.h.

Referenced by TGo4HistogramServer().

◆ fiServerPort

Int_t TGo4HistogramServer::fiServerPort {0}
private

port number for server socket

Definition at line 149 of file TGo4HistogramServer.h.

Referenced by TGo4HistogramServer(), TGo4HistogramServer(), and ~TGo4HistogramServer().

◆ fuConnectPort

UInt_t TGo4HistogramServer::fuConnectPort {0}
private

port number for timer connect

Definition at line 169 of file TGo4HistogramServer.h.

Referenced by TGo4HistogramServer(), TGo4HistogramServer(), SetConnect(), and TimerConnect().

◆ fuObjectPort

UInt_t TGo4HistogramServer::fuObjectPort {0}
private

port number for the object server connections

Definition at line 155 of file TGo4HistogramServer.h.

Referenced by TGo4HistogramServer(), TGo4HistogramServer(), ConnectObjectClient(), and GetObjPort().

◆ fxAnalysis

TGo4Analysis* TGo4HistogramServer::fxAnalysis {nullptr}
private

Definition at line 133 of file TGo4HistogramServer.h.

Referenced by TGo4HistogramServer(), GetAnalysis(), and HandleObjectRequest().

◆ fxAnalysisClient

TGo4AnalysisClient* TGo4HistogramServer::fxAnalysisClient {nullptr}
private

◆ fxConnectorName

TString TGo4HistogramServer::fxConnectorName
private

Name of connector thread.

Definition at line 143 of file TGo4HistogramServer.h.

Referenced by TGo4HistogramServer(), and ConnectorName().

◆ fxConnectorTimer

TGo4ObjConnectorTimer* TGo4HistogramServer::fxConnectorTimer {nullptr}
private

timer responsible for the connection/disconnection of clients; independent of application control timer aggregationByValue 1

Definition at line 192 of file TGo4HistogramServer.h.

Referenced by TGo4HistogramServer(), and ~TGo4HistogramServer().

◆ fxConnectTransport

TGo4Socket* TGo4HistogramServer::fxConnectTransport {nullptr}
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 TGo4HistogramServer(), TGo4HistogramServer(), SetConnect(), and TimerConnect().

◆ fxDisConnectTransport

TGo4Socket* TGo4HistogramServer::fxDisConnectTransport {nullptr}
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 TGo4HistogramServer(), TGo4HistogramServer(), SetDisConnect(), and TimerConnect().

◆ fxObjectThreadName

TString TGo4HistogramServer::fxObjectThreadName
private

Name of object server thread.

Definition at line 146 of file TGo4HistogramServer.h.

Referenced by TGo4HistogramServer(), and ObjectThreadName().

◆ fxServerName

TString TGo4HistogramServer::fxServerName
private

contains api server name

Definition at line 137 of file TGo4HistogramServer.h.

Referenced by TGo4HistogramServer(), ~TGo4HistogramServer(), CheckLogin(), and ConnectObjectClient().

◆ fxServerPass

TString TGo4HistogramServer::fxServerPass
private

contains api server password

Definition at line 140 of file TGo4HistogramServer.h.

Referenced by TGo4HistogramServer(), ~TGo4HistogramServer(), and CheckLogin().

◆ fxThreadHandler

TGo4ThreadHandler* TGo4HistogramServer::fxThreadHandler {nullptr}
private

◆ fxTransport

TGo4Socket* TGo4HistogramServer::fxTransport {nullptr}
private

The documentation for this class was generated from the following files: