v2.10-0 (21000JUN2005)

Go4HistogramServer
Class TGo4HistogramServer


class TGo4HistogramServer
derived from TGo4CommandReceiver

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

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

Field Summary
 private Bool_tfbConnectIsClose
          True if fxConnectTransport has returned from Close(),
i.e. connection was closed
 private Bool_tfbConnectIsDone
          True if fxConnectTransport has returned from Open(),
i.e. connection was established
 private Bool_tfbConnectIsOpen
          True if fxConnectTransport waits in server Open() call
 private Bool_tfbConnectRequest
          True if fxConnectTransport shall be Open() by Timer
 private Bool_tfbDisConnectRequest
          True if fxConnectTransport shall be Close() by Timer
 private TStringfcConnectHost
          hostname for timer connect
 const static const Text_t[]fgcCOMGETLIST
          command string for object server nameslist request
 const static const Text_t[]fgcCONTHREADNAME
          histogram server connector thread name
 const static const Text_t[]fgcOBJTHREADNAME
          object server connector thread name
 const static const Text_t[]fgcSHUTDOWNNAME
          This string is send as histogram name for termination connection
 const static const Int_tfgiCLOSEWAITCYCLES
          Maximum cycles to wait until transport is closed
 const static const Int_tfgiCONNECTWAITCYCLES
          Maximum cycles to wait until transport is connected
 const static const Int_tfgiOPENWAITCYCLES
          Maximum cycles to wait until transport is open
 const static const UInt_tfguCLOSEWAITCYCLETIME
          Time for each close wait cycle, in ms
 const static const UInt_tfguCONNECTWAITCYCLETIME
          Time for each connect wait cycle, in ms
 const static const UInt_tfguOPENWAITCYCLETIME
          Time for each open wait cycle, in ms
 const static const UInt_tfguTIMERPERIOD
          Period of connector timer, in ms
 private Int_tfiServerPort
          port number for server socket
 private UInt_tfuConnectPort
          port number for timer connect
 private UInt_tfuObjectPort
          port number for the object server connections
 private TGo4Analysis*fxAnalysis
           
 private TGo4AnalysisClient*fxAnalysisClient
           
 private TStringfxConnectorName
          Name of connector thread
 private TGo4ObjConnectorTimer*fxConnectorTimer
          timer responsible for the connection/disconnection of clients;
independent of application control timer
 private TGo4Socket*fxConnectTransport
          link to the next TaskHandler transport instance that shall be connected
by the Object connector Timer with the client
 private TGo4Socket*fxDisConnectTransport
          link to the next TaskHandler transport instance that shall be disconnected
by the connector Timer with the client
 private TStringfxObjectThreadName
          Name of object server thread
 private TStringfxServerName
          contains api server name
 private TStringfxServerPass
          contains api server password
 private TGo4ThreadHandler*fxThreadHandler
           
 private TGo4Socket*fxTransport
          socket for object server *

Constructor Summary
TGo4HistogramServer(TGo4AnalysisClient* owner, const char * servername, const char * password)
           
TGo4HistogramServer()
           

Destructor Summary
 virtual synchronized ~TGo4HistogramServer()
           

Method Summary
 private Bool_tCheckLogin()
          Checks basename and passwd login of connected client
 private const const char *ConnectHost()
           
 private Int_tConnectObjectClient()
          Starts server socket waiting for the next client
 private const const char *ConnectorName()
           
 private voidDisconnectObjectClient()
          Terminate connection to current object client, keep waiting for the next one
 const TGo4Analysis*GetAnalysis()
           
 const TGo4AnalysisClient*GetAnalysisClient()
           
 UInt_tGetObjPort()
          returns the portnumber for object server connection
 private Bool_tHandleObjectRequest()
          Ask for which object to send and give it to the client
 private const const char *ObjectThreadName()
           
 private Bool_tSendObject(TObject* obj)
          Send object to the current object client.
 Int_tServeObjectClient()
          Used by object connector runnable to serve client request
 private voidSetConnect(TGo4Socket* trans, const char * host, UInt_t port)
           
 private voidSetDisConnect(TGo4Socket* trans)
           
 virtual Int_tTimerConnect()
          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
 private Int_tWaitForClose()
           
 private Int_tWaitForConnection()
           
 private Int_tWaitForOpen()
           

Field Detail

fbConnectIsClose

private Bool_t fbConnectIsClose
True if fxConnectTransport has returned from Close(),
i.e. connection was closed

fbConnectIsDone

private Bool_t fbConnectIsDone
True if fxConnectTransport has returned from Open(),
i.e. connection was established

fbConnectIsOpen

private Bool_t fbConnectIsOpen
True if fxConnectTransport waits in server Open() call

fbConnectRequest

private Bool_t fbConnectRequest
True if fxConnectTransport shall be Open() by Timer

fbDisConnectRequest

private Bool_t fbDisConnectRequest
True if fxConnectTransport shall be Close() by Timer

fcConnectHost

private TString fcConnectHost
hostname for timer connect

fgcCOMGETLIST

public const static const Text_t[] fgcCOMGETLIST
command string for object server nameslist request

fgcCONTHREADNAME

public const static const Text_t[] fgcCONTHREADNAME
histogram server connector thread name

fgcOBJTHREADNAME

public const static const Text_t[] fgcOBJTHREADNAME
object server connector thread name

fgcSHUTDOWNNAME

public const static const Text_t[] fgcSHUTDOWNNAME
This string is send as histogram name for termination connection

fgiCLOSEWAITCYCLES

public const static const Int_t fgiCLOSEWAITCYCLES
Maximum cycles to wait until transport is closed

fgiCONNECTWAITCYCLES

public const static const Int_t fgiCONNECTWAITCYCLES
Maximum cycles to wait until transport is connected

fgiOPENWAITCYCLES

public const static const Int_t fgiOPENWAITCYCLES
Maximum cycles to wait until transport is open

fguCLOSEWAITCYCLETIME

public const static const UInt_t fguCLOSEWAITCYCLETIME
Time for each close wait cycle, in ms

fguCONNECTWAITCYCLETIME

public const static const UInt_t fguCONNECTWAITCYCLETIME
Time for each connect wait cycle, in ms

fguOPENWAITCYCLETIME

public const static const UInt_t fguOPENWAITCYCLETIME
Time for each open wait cycle, in ms

fguTIMERPERIOD

public const static const UInt_t fguTIMERPERIOD
Period of connector timer, in ms

fiServerPort

private Int_t fiServerPort
port number for server socket

fuConnectPort

private UInt_t fuConnectPort
port number for timer connect

fuObjectPort

private UInt_t fuObjectPort
port number for the object server connections

fxAnalysis

private TGo4Analysis* fxAnalysis

fxAnalysisClient

private TGo4AnalysisClient* fxAnalysisClient

fxConnectorName

private TString fxConnectorName
Name of connector thread

fxConnectorTimer

private TGo4ObjConnectorTimer* fxConnectorTimer
timer responsible for the connection/disconnection of clients;
independent of application control timer
supplierCardinality 1
link aggregationByValue

fxConnectTransport

private TGo4Socket* fxConnectTransport
link to the next TaskHandler transport instance that shall be connected
by the Object connector Timer with the client

fxDisConnectTransport

private TGo4Socket* fxDisConnectTransport
link to the next TaskHandler transport instance that shall be disconnected
by the connector Timer with the client

fxObjectThreadName

private TString fxObjectThreadName
Name of object server thread

fxServerName

private TString fxServerName
contains api server name

fxServerPass

private TString fxServerPass
contains api server password

fxThreadHandler

private TGo4ThreadHandler* fxThreadHandler

fxTransport

private TGo4Socket* fxTransport
socket for object server *
Constructor Detail

TGo4HistogramServer

public TGo4HistogramServer(TGo4AnalysisClient* owner, const char * servername, const char * password)

TGo4HistogramServer

public TGo4HistogramServer()
Method Detail

~TGo4HistogramServer

public virtual synchronized ~TGo4HistogramServer()
Method Detail

CheckLogin

private Bool_t CheckLogin()
Checks basename and passwd login of connected client

ConnectHost

private const const char * ConnectHost()

ConnectObjectClient

private Int_t ConnectObjectClient()
Starts server socket waiting for the next client

ConnectorName

private const const char * ConnectorName()

DisconnectObjectClient

private void DisconnectObjectClient()
Terminate connection to current object client, keep waiting for the next one

GetAnalysis

public const TGo4Analysis* GetAnalysis()

GetAnalysisClient

public const TGo4AnalysisClient* GetAnalysisClient()

GetObjPort

public UInt_t GetObjPort()
returns the portnumber for object server connection

HandleObjectRequest

private Bool_t HandleObjectRequest()
Ask for which object to send and give it to the client

ObjectThreadName

private const const char * ObjectThreadName()

SendObject

private Bool_t SendObject(TObject* obj)
Send object to the current object client.
Protocol matches TGo4ObjectClient::ReceiveObject()

ServeObjectClient

public Int_t ServeObjectClient()
Used by object connector runnable to serve client request

SetConnect

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

SetDisConnect

private void SetDisConnect(TGo4Socket* trans)

TimerConnect

public 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

WaitForClose

private Int_t WaitForClose()

WaitForConnection

private Int_t WaitForConnection()

WaitForOpen

private Int_t WaitForOpen()

Association Links

to Class TGo4AnalysisClient

to Class TGo4Analysis

to Class TGo4ThreadHandler

to Class TGo4Socket

socket for object server *

to Class TGo4Socket

link to the next TaskHandler transport instance that shall be connected
by the Object connector Timer with the client

to Class TGo4Socket

link to the next TaskHandler transport instance that shall be disconnected
by the connector Timer with the client

to Class TGo4ObjConnectorTimer

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

Supplier Cardinality 1
Type aggregationByValue

J.Adamczewski, M.Al-Turany, D.Bertini, H.G.Essel, S.Linev

30-06-2005