Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

TGo4TaskHandler Class Reference

This class is responsible for the interconnection of two tasks: provided are three communication channels (data, command, status), one thread runnable is acting on each transport channel (e.g. More...

#include <TGo4TaskHandler.h>

List of all members.

Public Member Functions

 TGo4TaskHandler (const char *name, TGo4ThreadManager *threadmanager, Bool_t clientmode=kFALSE, Bool_t mastermode=kTRUE, UInt_t negotiationport=0)
virtual ~TGo4TaskHandler ()
Bool_t ConnectServerChannel (const char *name, TGo4Socket *negotiator, TGo4Socket *channel, const char *host)
 Method defining the connection protocol of one data transport channel (data, status, or command).
Bool_t ConnectClientChannel (const char *name, TGo4Socket *negotiator, TGo4Socket *channel, const char *host)
 method defining the connection protocol of one data transport channel (data, status, or command).
TGo4SocketServerRequest (const char *host="localhost")
 request to server at host to connect or disconnect us, returns negotiation channel
Bool_t ServerLogin (TGo4Socket *connector, Go4CommandMode_t account)
 Negotiate login to requested server channel with account type.
Bool_t Connect (const char *host="localhost", TGo4Socket *negotiator=0)
 establishes the connections of all three transport channels and starts the service threads
Bool_t DisConnect (Bool_t waitforclient=kTRUE)
 Closes the connections of all three transport channels.
TGo4ThreadManagerGetThreadManager () const
Int_t WaitGetPort (TGo4Socket *sock)
 Get actual local port number of specified Go4 socket.
void SetNegotiationPort (UInt_t port)
 Set port for the negotiation channel (client mode).
TGo4SocketGetCommandTransport () const
TGo4SocketGetStatusTransport () const
TGo4SocketGetDataTransport () const
TGo4QueueGetCommandQueue () const
TGo4QueueGetStatusQueue () const
TGo4QueueGetDataQueue () const
const char * GetHostName () const
const char * GetComName () const
const char * GetDatName () const
const char * GetStatName () const
Int_t GetComPort () const
Int_t GetDatPort () const
Int_t GetStatPort () const
Go4CommandMode_t GetRole ()
void SetRole (Go4CommandMode_t role)
TGo4CommandInvokerGetInvoker () const
 returns pointer to copy of client invoker which may be used by server to check the valid command clients
Bool_t IsClientMode () const
 Check whether this instance is client or server taskhandler.
Bool_t IsMasterMode () const
 Check whether this instance is client or server taskhandler.
void SetAborting (Bool_t isaborting=kTRUE)
 sets the internal aborting state of this taskhandler instance; will be checked before an exception tries to cancel this taskhandler
Bool_t IsAborting () const
 Check whether this instance is currently being aborted.
void SetInvoker (TGo4CommandInvoker *inv)
 sets pointer to client invoker which may be used by server to check the valid command clients
virtual TGo4TaskHandlerStatusCreateStatus ()
 create a status object with information on the current taskhandler state.
Bool_t StopTransportThreads (Bool_t wait=kTRUE)
 Stop all transport threads of this taskhandler (command, data, status).
void StartTransportThreads ()
 Start all transport threads of this taskhandler (command, data, status).
Bool_t WaitThreadStop (const char *name)
 Wait for the thread of name to be stopped.
void CloseChannels (Option_t *opt="")
 Close transport channels and clear queues.
void ClearQueues ()
 Clear all entries of queues.

Static Public Member Functions

static void SetAdminAccount (const char *name, const char *passwd)
 Specify login name and password for administrator account.
static void SetCtrlAccount (const char *name, const char *passwd)
 Specify login name and password for controller account.
static void SetObservAccount (const char *name, const char *passwd)
 Specify login name and password for observer account.
static const char * Get_fgcOK ()
static const char * Get_fgcERROR ()
static UInt_t Get_fguPORTWAITTIME ()
static Int_t Get_fgiPORTWAITCYCLES ()

Static Protected Attributes

static const UInt_t fguCONNECTORPORT = 5000
 Default port number of negotiation connection (raw transport).
static const Int_t fgiTHREADSTOPCYCLES = 6
 cycles to wait for taskhandler thread stop on disconnection
static const UInt_t fguTHREADSTOPTIME = 500
 time for each threadstop wait cycle
static const UInt_t fguTRANSPORTCHECKDELAY = 5000
 Delay time (ms) to wait between two checks of transport connection.
static const UInt_t fguSTATUSQUEUESIZE = 1000
 Maximum entries allowed for status queue.
static const UInt_t fguDATAQUEUESIZE = 1000
 Maximum entries allowed for data queue.
static const UInt_t fguCOMMANDQUEUESIZE = 1000
 Maximum entries allowed for command queue.
static const Text_t fgcCONNECT [] = "CONNECT-VERSION-300"
 Initial string for connect request (raw transport).
static const Text_t fgcDISCONNECT [] = "DISCONNECT-VERSION-300"
 Initial string for disconnect request (raw transport).
static const Text_t fgcMASTER [] = "Master-VERSION-300"
 Task identifier for client connect negotiations (raw transport).
static const Text_t fgcSLAVE [] = "Slave-VERSION-300"
 Task identifier for client connect negotiations (raw transport).
static const Text_t fgcCOMMANDTHREAD [] = "COMMAND-"
 Suffix for command thread name.
static const Text_t fgcSTATUSTHREAD [] = "STATUS-"
 Suffix for status thread name.
static const Text_t fgcDATATHREAD [] = "DATA-"
 Suffix for data thread name.

Private Member Functions

 TGo4TaskHandler ()

Private Attributes

Bool_t fbClientMode
 True if taskhandler runs in client mode.
Bool_t fbMasterMode
 True if taskhandler runs in master mode (sends commands, receives data and status).
Bool_t fbIsAborting
 True if taskhandler is being aborted e.g.
TGo4ThreadManagerfxThreadManager
 Link to threadmanager that owns the task handler, used for runnable ctors.
TGo4ThreadHandlerfxThreadHandler
 link to external threadhandler which is used for the transport service threads (runnables); these runnables are instantiated from the task handler ctor and passed to the thread handler who takes over the responsibility for the runnables (threadhandler internal mode threads) <{TGo4ThreadHandler}>
TGo4CommandInvokerfxInvoker
 Link to external command invoker instance used for direct command in client mode:.
TGo4QueuefxCommandQueue
 Buffers (queues) for the three transport channels:.
TGo4QueuefxStatusQueue
TGo4QueuefxDataQueue
TGo4SocketfxCommandTransport
 Transport channels (e.g.
TGo4SocketfxStatusTransport
TGo4SocketfxDataTransport
TString fxComName
 Remember name of command thread.
TString fxStatName
 Remember name of status thread.
TString fxDatName
 Remember name of data thread.
TString fxHostName
 Remember name of remote task handler.
UInt_t fuNegPort
 Actual port number of negotiation connection (raw transport).
Int_t fiComPort
 Command connection port number.
Int_t fiStatPort
 Status connection port number.
Int_t fiDatPort
 Data connection port number.
Go4CommandMode_t fiRole
 For server connection to client: This indicates role of connected client, if client is master.
TGo4StatusRunnablefxStatusRun
 link to status runnable which is managed by thread handler 1 1
TGo4DataRunnablefxDataRun
 link to data runnable which is managed by thread handler 1 1
TGo4CommandRunnablefxCommandRun
 link to command runnable which is managed by thread handler 1 1

Static Private Attributes

static TNamed fgxADMINISTRATORACCOUNT
 This keeps account for admin connection.
static TNamed fgxOBSERVERACCOUNT
 This keeps account for observer connection.
static TNamed fgxCONTROLLERACCOUNT
 This keeps account for controller connection.
static const char * fgcERROR = "ERROR-VERSION-300"
 Error string for client connect negotiations (raw transport).
static const char * fgcOK = "OK-VERSION-300"
 Ok string for client connect negotiations (raw transport).
static const UInt_t fguPORTWAITTIME = 200
 Time for each waitgetport cycle.
static const Int_t fgiPORTWAITCYCLES = 150
 Cycles to wait for a nonzero portnumber.

Friends

class TGo4TaskManager


Detailed Description

This class is responsible for the interconnection of two tasks: provided are three communication channels (data, command, status), one thread runnable is acting on each transport channel (e.g.

socket); one queue (buffer) is assigned to each channel depending on client or server mode of the task handler, the threads get objects from transporl and put them into the queue, or vice versa. (servertask sends commands, but receives data and status objects) taskhander is named such that it can be found in a list (i.e. task manager) by the server task which may serve more than one client tasks

Definition at line 44 of file TGo4TaskHandler.h.


Constructor & Destructor Documentation

TGo4TaskHandler::TGo4TaskHandler const char *  name,
TGo4ThreadManager threadmanager,
Bool_t  clientmode = kFALSE,
Bool_t  mastermode = kTRUE,
UInt_t  negotiationport = 0
 

Definition at line 69 of file TGo4TaskHandler.cxx.

References TGo4Log::Debug(), fbClientMode, fbMasterMode, fgcCOMMANDTHREAD, fgcDATATHREAD, fgcSTATUSTHREAD, fguCOMMANDQUEUESIZE, fguCONNECTORPORT, fguDATAQUEUESIZE, fguSTATUSQUEUESIZE, fuNegPort, fxCommandQueue, fxCommandRun, fxCommandTransport, fxComName, fxDataQueue, fxDataRun, fxDataTransport, fxDatName, fxInvoker, fxStatName, fxStatusQueue, fxStatusRun, fxStatusTransport, fxThreadHandler, fxThreadManager, GetComName(), GetDatName(), GetStatName(), TGo4ThreadManager::GetWorkHandler(), IsClientMode(), IsMasterMode(), TGo4ThreadHandler::NewThread(), and TGo4Queue::SetMaxEntries().

TGo4TaskHandler::~TGo4TaskHandler  )  [virtual]
 

Definition at line 144 of file TGo4TaskHandler.cxx.

References fxCommandQueue, fxCommandTransport, fxDataQueue, fxDataTransport, fxStatusQueue, fxStatusTransport, fxThreadHandler, GetComName(), GetDatName(), GetStatName(), and TGo4ThreadHandler::RemoveThread().

TGo4TaskHandler::TGo4TaskHandler  )  [private]
 

Referenced by TGo4TaskManager::NewTaskHandler().


Member Function Documentation

Bool_t TGo4TaskHandler::ConnectServerChannel const char *  name,
TGo4Socket negotiator,
TGo4Socket channel,
const char *  host
 

Method defining the connection protocol of one data transport channel (data, status, or command).

For server socket mode (used by taskmanager)

Definition at line 451 of file TGo4TaskHandler.cxx.

References TGo4Log::Debug(), fgcOK, fxThreadManager, TGo4Socket::IsOpen(), TGo4Socket::RecvRaw(), TGo4Socket::Send(), TGo4ServerTask::SetConnect(), TGo4ServerTask::WaitForConnection(), TGo4ServerTask::WaitForOpen(), and WaitGetPort().

Referenced by Connect().

Bool_t TGo4TaskHandler::ConnectClientChannel const char *  name,
TGo4Socket negotiator,
TGo4Socket channel,
const char *  host
 

method defining the connection protocol of one data transport channel (data, status, or command).

For client socket mode (used by taskhandler)

Definition at line 530 of file TGo4TaskHandler.cxx.

References TGo4Log::Debug(), fgcOK, TGo4Socket::IsOpen(), TGo4Socket::Open(), TGo4Socket::RecvRaw(), and TGo4Socket::Send().

Referenced by Connect().

TGo4Socket * TGo4TaskHandler::ServerRequest const char *  host = "localhost"  ) 
 

request to server at host to connect or disconnect us, returns negotiation channel

Definition at line 157 of file TGo4TaskHandler.cxx.

References TGo4Log::Debug(), fbClientMode, fuNegPort, fxThreadManager, Get_fgcERROR(), GetRole(), TGo4Socket::Open(), and ServerLogin().

Referenced by Connect(), and DisConnect().

Bool_t TGo4TaskHandler::ServerLogin TGo4Socket connector,
Go4CommandMode_t  account
 

Negotiate login to requested server channel with account type.

Definition at line 298 of file TGo4TaskHandler.cxx.

References fbMasterMode, fgcMASTER, fgcOK, fgcSLAVE, fgxADMINISTRATORACCOUNT, fgxCONTROLLERACCOUNT, fgxOBSERVERACCOUNT, Get_fgcERROR(), kGo4ComModeAdministrator, kGo4ComModeController, kGo4ComModeObserver, TGo4Socket::RecvRaw(), and TGo4Socket::Send().

Referenced by ServerRequest().

Bool_t TGo4TaskHandler::Connect const char *  host = "localhost",
TGo4Socket negotiator = 0
 

establishes the connections of all three transport channels and starts the service threads

Definition at line 199 of file TGo4TaskHandler.cxx.

References TGo4Socket::Close(), ConnectClientChannel(), ConnectServerChannel(), TGo4Log::Debug(), fbClientMode, fgcCONNECT, fgcOK, fiComPort, fiDatPort, fiStatPort, fxCommandTransport, fxDataTransport, fxHostName, fxStatusTransport, Get_fgcERROR(), TGo4Socket::RecvRaw(), TGo4Socket::Send(), ServerRequest(), SetAborting(), StartTransportThreads(), and WaitGetPort().

Referenced by TGo4TaskManager::AddClient(), and TGo4ClientTask::ConnectServer().

Bool_t TGo4TaskHandler::DisConnect Bool_t  waitforclient = kTRUE  ) 
 

Closes the connections of all three transport channels.

Argument waitforclient specifies if server shall wait for client handshake over negotiation channel before shutting down the sockets.

Definition at line 343 of file TGo4TaskHandler.cxx.

References TGo4Socket::Close(), CloseChannels(), TGo4Log::Debug(), fbClientMode, fgcDISCONNECT, fgcOK, GetHostName(), IsAborting(), TGo4Socket::Send(), ServerRequest(), and StopTransportThreads().

Referenced by TGo4TaskManager::DisConnectClient(), and TGo4ClientTask::DisconnectServer().

TGo4ThreadManager* TGo4TaskHandler::GetThreadManager  )  const [inline]
 

Definition at line 90 of file TGo4TaskHandler.h.

References fxThreadManager.

Referenced by TGo4TaskHandlerException::TGo4TaskHandlerException().

Int_t TGo4TaskHandler::WaitGetPort TGo4Socket sock  ) 
 

Get actual local port number of specified Go4 socket.

Method polls until the port number is not zero, i.e. the created server socket has been bound to that number. Used by the Connect protocol to find out server port before sending it to the client.

Definition at line 567 of file TGo4TaskHandler.cxx.

References fgiPORTWAITCYCLES, fguPORTWAITTIME, fxThreadManager, TGo4Socket::GetPort(), TGo4ThreadManager::IsTerminating(), and TGo4Thread::Sleep().

Referenced by Connect(), and ConnectServerChannel().

void TGo4TaskHandler::SetNegotiationPort UInt_t  port  )  [inline]
 

Set port for the negotiation channel (client mode).

Required if connection should be done on different port after taskhandler was created.

Definition at line 104 of file TGo4TaskHandler.h.

References fuNegPort.

Referenced by TGo4ClientTask::ConnectServer().

TGo4Socket* TGo4TaskHandler::GetCommandTransport  )  const [inline]
 

Definition at line 106 of file TGo4TaskHandler.h.

References fxCommandTransport.

Referenced by TGo4CommandRunnable::TGo4CommandRunnable().

TGo4Socket* TGo4TaskHandler::GetStatusTransport  )  const [inline]
 

Definition at line 108 of file TGo4TaskHandler.h.

References fxStatusTransport.

Referenced by TGo4StatusRunnable::TGo4StatusRunnable().

TGo4Socket* TGo4TaskHandler::GetDataTransport  )  const [inline]
 

Definition at line 110 of file TGo4TaskHandler.h.

References fxDataTransport.

Referenced by TGo4DataRunnable::TGo4DataRunnable().

TGo4Queue* TGo4TaskHandler::GetCommandQueue  )  const [inline]
 

Definition at line 112 of file TGo4TaskHandler.h.

References fxCommandQueue.

Referenced by TGo4ServerTask::GetCommandQueue(), TGo4ServerTask::NextCommand(), StopTransportThreads(), and TGo4CommandRunnable::TGo4CommandRunnable().

TGo4Queue* TGo4TaskHandler::GetStatusQueue  )  const [inline]
 

Definition at line 114 of file TGo4TaskHandler.h.

References fxStatusQueue.

Referenced by TGo4ServerTask::GetStatusQueue(), TGo4ServerTask::SendStatus(), TGo4ServerTask::SendStatusBuffer(), and TGo4StatusRunnable::TGo4StatusRunnable().

TGo4Queue* TGo4TaskHandler::GetDataQueue  )  const [inline]
 

Definition at line 116 of file TGo4TaskHandler.h.

References fxDataQueue.

Referenced by TGo4ServerTask::GetDataQueue(), and TGo4DataRunnable::TGo4DataRunnable().

const char* TGo4TaskHandler::GetHostName  )  const [inline]
 

Definition at line 118 of file TGo4TaskHandler.h.

References fxHostName.

Referenced by CreateStatus(), and DisConnect().

const char* TGo4TaskHandler::GetComName  )  const [inline]
 

Definition at line 120 of file TGo4TaskHandler.h.

References fxComName.

Referenced by CreateStatus(), StartTransportThreads(), StopTransportThreads(), TGo4TaskHandler(), and ~TGo4TaskHandler().

const char* TGo4TaskHandler::GetDatName  )  const [inline]
 

Definition at line 122 of file TGo4TaskHandler.h.

References fxDatName.

Referenced by CreateStatus(), StartTransportThreads(), StopTransportThreads(), TGo4TaskHandler(), and ~TGo4TaskHandler().

const char* TGo4TaskHandler::GetStatName  )  const [inline]
 

Definition at line 124 of file TGo4TaskHandler.h.

References fxStatName.

Referenced by CreateStatus(), StartTransportThreads(), StopTransportThreads(), TGo4TaskHandler(), and ~TGo4TaskHandler().

Int_t TGo4TaskHandler::GetComPort  )  const [inline]
 

Definition at line 126 of file TGo4TaskHandler.h.

References fiComPort.

Referenced by TGo4TaskManager::AddClient().

Int_t TGo4TaskHandler::GetDatPort  )  const [inline]
 

Definition at line 128 of file TGo4TaskHandler.h.

References fiDatPort.

Referenced by TGo4TaskManager::AddClient().

Int_t TGo4TaskHandler::GetStatPort  )  const [inline]
 

Definition at line 130 of file TGo4TaskHandler.h.

References fiStatPort.

Referenced by TGo4TaskManager::AddClient().

Go4CommandMode_t TGo4TaskHandler::GetRole  )  [inline]
 

Definition at line 132 of file TGo4TaskHandler.h.

References fiRole.

Referenced by TGo4TaskManager::AddClient(), TGo4TaskManager::DisConnectClient(), TGo4ServerTask::NextCommand(), TGo4CommandRunnable::Run(), and ServerRequest().

void TGo4TaskHandler::SetRole Go4CommandMode_t  role  )  [inline]
 

Definition at line 133 of file TGo4TaskHandler.h.

References fiRole.

Referenced by TGo4TaskManager::AddClient(), and TGo4ClientTask::ConnectServer().

TGo4CommandInvoker* TGo4TaskHandler::GetInvoker  )  const [inline]
 

returns pointer to copy of client invoker which may be used by server to check the valid command clients

Definition at line 139 of file TGo4TaskHandler.h.

References fxInvoker.

Bool_t TGo4TaskHandler::IsClientMode  )  const [inline]
 

Check whether this instance is client or server taskhandler.

Definition at line 142 of file TGo4TaskHandler.h.

References fbClientMode.

Referenced by TGo4TaskHandlerAbortException::Handle(), TGo4CommandRunnable::Run(), and TGo4TaskHandler().

Bool_t TGo4TaskHandler::IsMasterMode  )  const [inline]
 

Check whether this instance is client or server taskhandler.

Definition at line 145 of file TGo4TaskHandler.h.

References fbMasterMode.

Referenced by StopTransportThreads(), and TGo4TaskHandler().

void TGo4TaskHandler::SetAborting Bool_t  isaborting = kTRUE  )  [inline]
 

sets the internal aborting state of this taskhandler instance; will be checked before an exception tries to cancel this taskhandler

Definition at line 151 of file TGo4TaskHandler.h.

References fbIsAborting.

Referenced by Connect(), and TGo4TaskHandlerAbortException::Handle().

Bool_t TGo4TaskHandler::IsAborting  )  const [inline]
 

Check whether this instance is currently being aborted.

Definition at line 154 of file TGo4TaskHandler.h.

References fbIsAborting.

Referenced by DisConnect(), TGo4TaskHandlerAbortException::Handle(), and TGo4Task::SendStopBuffers().

void TGo4TaskHandler::SetInvoker TGo4CommandInvoker inv  )  [inline]
 

sets pointer to client invoker which may be used by server to check the valid command clients

Definition at line 160 of file TGo4TaskHandler.h.

References fxInvoker.

TGo4TaskHandlerStatus * TGo4TaskHandler::CreateStatus  )  [virtual]
 

create a status object with information on the current taskhandler state.

this object may be sent to the server or may be used to restore current status by memento mechanism

Definition at line 439 of file TGo4TaskHandler.cxx.

References fbIsAborting, fiComPort, fiDatPort, fiStatPort, fuNegPort, GetComName(), GetDatName(), GetHostName(), GetStatName(), TGo4TaskHandlerStatus::SetFlags(), TGo4TaskHandlerStatus::SetNames(), and TGo4TaskHandlerStatus::SetPorts().

Referenced by TGo4Task::UpdateStatus().

Bool_t TGo4TaskHandler::StopTransportThreads Bool_t  wait = kTRUE  ) 
 

Stop all transport threads of this taskhandler (command, data, status).

If wait is true, wait until threads are really stopped before return. If not all threads were stopped within defined stoptime and waitcycles, return value is false.

Definition at line 601 of file TGo4TaskHandler.cxx.

References fxThreadHandler, GetCommandQueue(), GetComName(), GetDatName(), GetStatName(), IsMasterMode(), TGo4ThreadHandler::Stop(), WaitThreadStop(), and TGo4Queue::Wake().

Referenced by DisConnect().

void TGo4TaskHandler::StartTransportThreads  ) 
 

Start all transport threads of this taskhandler (command, data, status).

Definition at line 594 of file TGo4TaskHandler.cxx.

References fxThreadHandler, GetComName(), GetDatName(), GetStatName(), and TGo4ThreadHandler::Start().

Referenced by Connect().

Bool_t TGo4TaskHandler::WaitThreadStop const char *  name  ) 
 

Wait for the thread of name to be stopped.

Returns false if thread has not reached stopped state within the defined stoptime and cycles.

Definition at line 625 of file TGo4TaskHandler.cxx.

References TGo4Log::Debug(), fgiTHREADSTOPCYCLES, fguTHREADSTOPTIME, fxThreadHandler, TGo4ThreadHandler::GetThread(), TGo4Thread::IsWaiting(), and TGo4Thread::Sleep().

Referenced by StopTransportThreads().

void TGo4TaskHandler::CloseChannels Option_t *  opt = ""  ) 
 

Close transport channels and clear queues.

Option may indicate root TSocket Close option, e.g. "force" to force socket close

Definition at line 405 of file TGo4TaskHandler.cxx.

References ClearQueues(), TGo4Socket::Close(), fxCommandTransport, fxDataTransport, and fxStatusTransport.

Referenced by DisConnect().

void TGo4TaskHandler::ClearQueues  ) 
 

Clear all entries of queues.

Definition at line 431 of file TGo4TaskHandler.cxx.

References TGo4Queue::Clear(), fxCommandQueue, fxDataQueue, and fxStatusQueue.

Referenced by CloseChannels(), and TGo4ClientTask::ConnectServer().

void TGo4TaskHandler::SetAdminAccount const char *  name,
const char *  passwd
[static]
 

Specify login name and password for administrator account.

This is used when client requests for a server connection. For multiple master clients at a slave server, there can be only one controller, but many observers with restricted command rights.

Definition at line 645 of file TGo4TaskHandler.cxx.

References fgxADMINISTRATORACCOUNT.

Referenced by TGo4ClientTask::ConnectServer(), and TGo4Analysis::SetAdministratorPassword().

void TGo4TaskHandler::SetCtrlAccount const char *  name,
const char *  passwd
[static]
 

Specify login name and password for controller account.

This is used when client requests for a server connection. For multiple master clients at a slave server, there can be only one controller. Master server at slave client has always controller role.

Definition at line 651 of file TGo4TaskHandler.cxx.

References fgxCONTROLLERACCOUNT.

Referenced by TGo4ClientTask::ConnectServer(), and TGo4Analysis::SetControllerPassword().

void TGo4TaskHandler::SetObservAccount const char *  name,
const char *  passwd
[static]
 

Specify login name and password for observer account.

This is used when client requests for a server connection. For multiple master clients at a slave server, there can be only one controller, but many observers with restricted command rights.

Definition at line 657 of file TGo4TaskHandler.cxx.

References fgxOBSERVERACCOUNT.

Referenced by TGo4ClientTask::ConnectServer(), and TGo4Analysis::SetObserverPassword().

const char * TGo4TaskHandler::Get_fgcOK  )  [static]
 

Definition at line 663 of file TGo4TaskHandler.cxx.

References fgcOK.

Referenced by TGo4HistogramServer::CheckLogin(), TGo4TaskManager::ClientLogin(), TGo4ObjClient::ConnectServer(), TGo4TaskManager::DisConnectClient(), TGo4ObjClient::ReceiveObject(), TGo4CommandRunnable::Run(), TGo4HistogramServer::SendObject(), and TGo4TaskManager::ServeClient().

const char * TGo4TaskHandler::Get_fgcERROR  )  [static]
 

Definition at line 668 of file TGo4TaskHandler.cxx.

References fgcERROR.

Referenced by TGo4TaskManager::AddClient(), TGo4HistogramServer::CheckLogin(), Connect(), TGo4CommandRunnable::Run(), TGo4HistogramServer::SendObject(), TGo4TaskManager::ServeClient(), ServerLogin(), ServerRequest(), and TGo4ServerTask::StopConnectorThread().

UInt_t TGo4TaskHandler::Get_fguPORTWAITTIME  )  [static]
 

Definition at line 673 of file TGo4TaskHandler.cxx.

References fguPORTWAITTIME.

Referenced by TGo4TaskHandlerRunnable::CheckTransportOpen(), TGo4HistogramServer::ConnectObjectClient(), and TGo4TaskManager::ServeClient().

Int_t TGo4TaskHandler::Get_fgiPORTWAITCYCLES  )  [static]
 

Definition at line 678 of file TGo4TaskHandler.cxx.

References fgiPORTWAITCYCLES.

Referenced by TGo4HistogramServer::ConnectObjectClient(), and TGo4TaskManager::ServeClient().


Friends And Related Function Documentation

friend class TGo4TaskManager [friend]
 

Definition at line 48 of file TGo4TaskHandler.h.


Member Data Documentation

const UInt_t TGo4TaskHandler::fguCONNECTORPORT = 5000 [static, protected]
 

Default port number of negotiation connection (raw transport).

Definition at line 35 of file TGo4TaskHandler.cxx.

Referenced by TGo4TaskHandler(), and TGo4TaskManager::TGo4TaskManager().

const Int_t TGo4TaskHandler::fgiTHREADSTOPCYCLES = 6 [static, protected]
 

cycles to wait for taskhandler thread stop on disconnection

Definition at line 48 of file TGo4TaskHandler.cxx.

Referenced by WaitThreadStop().

const UInt_t TGo4TaskHandler::fguTHREADSTOPTIME = 500 [static, protected]
 

time for each threadstop wait cycle

Definition at line 50 of file TGo4TaskHandler.cxx.

Referenced by WaitThreadStop().

const UInt_t TGo4TaskHandler::fguTRANSPORTCHECKDELAY = 5000 [static, protected]
 

Delay time (ms) to wait between two checks of transport connection.

Definition at line 37 of file TGo4TaskHandler.cxx.

const UInt_t TGo4TaskHandler::fguSTATUSQUEUESIZE = 1000 [static, protected]
 

Maximum entries allowed for status queue.

Definition at line 39 of file TGo4TaskHandler.cxx.

Referenced by TGo4TaskHandler().

const UInt_t TGo4TaskHandler::fguDATAQUEUESIZE = 1000 [static, protected]
 

Maximum entries allowed for data queue.

Definition at line 40 of file TGo4TaskHandler.cxx.

Referenced by TGo4TaskHandler().

const UInt_t TGo4TaskHandler::fguCOMMANDQUEUESIZE = 1000 [static, protected]
 

Maximum entries allowed for command queue.

Definition at line 41 of file TGo4TaskHandler.cxx.

Referenced by TGo4TaskHandler().

const Text_t TGo4TaskHandler::fgcCONNECT = "CONNECT-VERSION-300" [static, protected]
 

Initial string for connect request (raw transport).

Definition at line 52 of file TGo4TaskHandler.cxx.

Referenced by Connect(), and TGo4TaskManager::ServeClient().

const Text_t TGo4TaskHandler::fgcDISCONNECT = "DISCONNECT-VERSION-300" [static, protected]
 

Initial string for disconnect request (raw transport).

Definition at line 53 of file TGo4TaskHandler.cxx.

Referenced by DisConnect(), and TGo4TaskManager::ServeClient().

const Text_t TGo4TaskHandler::fgcMASTER = "Master-VERSION-300" [static, protected]
 

Task identifier for client connect negotiations (raw transport).

Definition at line 58 of file TGo4TaskHandler.cxx.

Referenced by TGo4TaskManager::ClientLogin(), and ServerLogin().

const Text_t TGo4TaskHandler::fgcSLAVE = "Slave-VERSION-300" [static, protected]
 

Task identifier for client connect negotiations (raw transport).

Definition at line 59 of file TGo4TaskHandler.cxx.

Referenced by TGo4TaskManager::ClientLogin(), and ServerLogin().

const Text_t TGo4TaskHandler::fgcCOMMANDTHREAD = "COMMAND-" [static, protected]
 

Suffix for command thread name.

Definition at line 61 of file TGo4TaskHandler.cxx.

Referenced by TGo4TaskHandler().

const Text_t TGo4TaskHandler::fgcSTATUSTHREAD = "STATUS-" [static, protected]
 

Suffix for status thread name.

Definition at line 62 of file TGo4TaskHandler.cxx.

Referenced by TGo4TaskHandler().

const Text_t TGo4TaskHandler::fgcDATATHREAD = "DATA-" [static, protected]
 

Suffix for data thread name.

Definition at line 63 of file TGo4TaskHandler.cxx.

Referenced by TGo4TaskHandler().

TNamed TGo4TaskHandler::fgxADMINISTRATORACCOUNT [static, private]
 

This keeps account for admin connection.

Name is accountname, title is password. May be set from outside by public methods SetObservAccount and SetObservPasswd. Later we might keep this with encryption...

Referenced by TGo4TaskManager::ClientLogin(), ServerLogin(), and SetAdminAccount().

TNamed TGo4TaskHandler::fgxOBSERVERACCOUNT [static, private]
 

This keeps account for observer connection.

Name is accountname, title is password. May be set from outside by public methods SetObservAccount and SetObservPasswd. Later we might keep this with encryption...

Referenced by TGo4TaskManager::ClientLogin(), ServerLogin(), and SetObservAccount().

TNamed TGo4TaskHandler::fgxCONTROLLERACCOUNT [static, private]
 

This keeps account for controller connection.

Name is accountname, title is password. May be set from outside by public methods SetCtrlAccount and SetCtrlPasswd. Later we might keep this with encryption...

Referenced by TGo4TaskManager::ClientLogin(), ServerLogin(), and SetCtrlAccount().

const char * TGo4TaskHandler::fgcERROR = "ERROR-VERSION-300" [static, private]
 

Error string for client connect negotiations (raw transport).

Definition at line 56 of file TGo4TaskHandler.cxx.

Referenced by Get_fgcERROR().

const char * TGo4TaskHandler::fgcOK = "OK-VERSION-300" [static, private]
 

Ok string for client connect negotiations (raw transport).

Definition at line 55 of file TGo4TaskHandler.cxx.

Referenced by Connect(), ConnectClientChannel(), ConnectServerChannel(), DisConnect(), Get_fgcOK(), and ServerLogin().

const UInt_t TGo4TaskHandler::fguPORTWAITTIME = 200 [static, private]
 

Time for each waitgetport cycle.

Definition at line 46 of file TGo4TaskHandler.cxx.

Referenced by Get_fguPORTWAITTIME(), and WaitGetPort().

const Int_t TGo4TaskHandler::fgiPORTWAITCYCLES = 150 [static, private]
 

Cycles to wait for a nonzero portnumber.

Definition at line 44 of file TGo4TaskHandler.cxx.

Referenced by Get_fgiPORTWAITCYCLES(), and WaitGetPort().

Bool_t TGo4TaskHandler::fbClientMode [private]
 

True if taskhandler runs in client mode.

Definition at line 309 of file TGo4TaskHandler.h.

Referenced by Connect(), DisConnect(), IsClientMode(), ServerRequest(), and TGo4TaskHandler().

Bool_t TGo4TaskHandler::fbMasterMode [private]
 

True if taskhandler runs in master mode (sends commands, receives data and status).

Otherwise false.

Definition at line 312 of file TGo4TaskHandler.h.

Referenced by IsMasterMode(), ServerLogin(), and TGo4TaskHandler().

Bool_t TGo4TaskHandler::fbIsAborting [private]
 

True if taskhandler is being aborted e.g.

by remove exception

Definition at line 315 of file TGo4TaskHandler.h.

Referenced by CreateStatus(), IsAborting(), and SetAborting().

TGo4ThreadManager* TGo4TaskHandler::fxThreadManager [private]
 

Link to threadmanager that owns the task handler, used for runnable ctors.

Definition at line 318 of file TGo4TaskHandler.h.

Referenced by ConnectServerChannel(), GetThreadManager(), ServerRequest(), TGo4TaskHandler(), and WaitGetPort().

TGo4ThreadHandler* TGo4TaskHandler::fxThreadHandler [private]
 

link to external threadhandler which is used for the transport service threads (runnables); these runnables are instantiated from the task handler ctor and passed to the thread handler who takes over the responsibility for the runnables (threadhandler internal mode threads) <{TGo4ThreadHandler}>

Definition at line 326 of file TGo4TaskHandler.h.

Referenced by StartTransportThreads(), StopTransportThreads(), TGo4TaskHandler(), WaitThreadStop(), and ~TGo4TaskHandler().

TGo4CommandInvoker* TGo4TaskHandler::fxInvoker [private]
 

Link to external command invoker instance used for direct command in client mode:.

Definition at line 329 of file TGo4TaskHandler.h.

Referenced by GetInvoker(), SetInvoker(), and TGo4TaskHandler().

TGo4Queue* TGo4TaskHandler::fxCommandQueue [private]
 

Buffers (queues) for the three transport channels:.

Definition at line 332 of file TGo4TaskHandler.h.

Referenced by ClearQueues(), GetCommandQueue(), TGo4TaskHandler(), and ~TGo4TaskHandler().

TGo4Queue* TGo4TaskHandler::fxStatusQueue [private]
 

Definition at line 333 of file TGo4TaskHandler.h.

Referenced by ClearQueues(), GetStatusQueue(), TGo4TaskHandler(), and ~TGo4TaskHandler().

TGo4Queue* TGo4TaskHandler::fxDataQueue [private]
 

Definition at line 334 of file TGo4TaskHandler.h.

Referenced by ClearQueues(), GetDataQueue(), TGo4TaskHandler(), and ~TGo4TaskHandler().

TGo4Socket* TGo4TaskHandler::fxCommandTransport [private]
 

Transport channels (e.g.

sockets) for command, status, data

Definition at line 337 of file TGo4TaskHandler.h.

Referenced by CloseChannels(), Connect(), GetCommandTransport(), TGo4TaskHandler(), and ~TGo4TaskHandler().

TGo4Socket* TGo4TaskHandler::fxStatusTransport [private]
 

Definition at line 338 of file TGo4TaskHandler.h.

Referenced by CloseChannels(), Connect(), GetStatusTransport(), TGo4TaskHandler(), and ~TGo4TaskHandler().

TGo4Socket* TGo4TaskHandler::fxDataTransport [private]
 

Definition at line 339 of file TGo4TaskHandler.h.

Referenced by CloseChannels(), Connect(), GetDataTransport(), TGo4TaskHandler(), and ~TGo4TaskHandler().

TString TGo4TaskHandler::fxComName [private]
 

Remember name of command thread.

Definition at line 342 of file TGo4TaskHandler.h.

Referenced by GetComName(), and TGo4TaskHandler().

TString TGo4TaskHandler::fxStatName [private]
 

Remember name of status thread.

Definition at line 345 of file TGo4TaskHandler.h.

Referenced by GetStatName(), and TGo4TaskHandler().

TString TGo4TaskHandler::fxDatName [private]
 

Remember name of data thread.

Definition at line 348 of file TGo4TaskHandler.h.

Referenced by GetDatName(), and TGo4TaskHandler().

TString TGo4TaskHandler::fxHostName [private]
 

Remember name of remote task handler.

Definition at line 351 of file TGo4TaskHandler.h.

Referenced by Connect(), and GetHostName().

UInt_t TGo4TaskHandler::fuNegPort [private]
 

Actual port number of negotiation connection (raw transport).

Definition at line 354 of file TGo4TaskHandler.h.

Referenced by CreateStatus(), ServerRequest(), SetNegotiationPort(), and TGo4TaskHandler().

Int_t TGo4TaskHandler::fiComPort [private]
 

Command connection port number.

Definition at line 357 of file TGo4TaskHandler.h.

Referenced by Connect(), CreateStatus(), and GetComPort().

Int_t TGo4TaskHandler::fiStatPort [private]
 

Status connection port number.

Definition at line 360 of file TGo4TaskHandler.h.

Referenced by Connect(), CreateStatus(), and GetStatPort().

Int_t TGo4TaskHandler::fiDatPort [private]
 

Data connection port number.

Definition at line 363 of file TGo4TaskHandler.h.

Referenced by Connect(), CreateStatus(), and GetDatPort().

Go4CommandMode_t TGo4TaskHandler::fiRole [private]
 

For server connection to client: This indicates role of connected client, if client is master.

Depending on role, some actions may be forbidden. Role is equivalent to allowed command execution mode.

Definition at line 370 of file TGo4TaskHandler.h.

Referenced by GetRole(), and SetRole().

TGo4StatusRunnable* TGo4TaskHandler::fxStatusRun [private]
 

link to status runnable which is managed by thread handler 1 1

Definition at line 375 of file TGo4TaskHandler.h.

Referenced by TGo4TaskHandler().

TGo4DataRunnable* TGo4TaskHandler::fxDataRun [private]
 

link to data runnable which is managed by thread handler 1 1

Definition at line 380 of file TGo4TaskHandler.h.

Referenced by TGo4TaskHandler().

TGo4CommandRunnable* TGo4TaskHandler::fxCommandRun [private]
 

link to command runnable which is managed by thread handler 1 1

Definition at line 385 of file TGo4TaskHandler.h.

Referenced by TGo4TaskHandler().


The documentation for this class was generated from the following files:
Generated on Fri Nov 28 13:01:20 2008 for Go4-v3.04-1 by  doxygen 1.4.2