#include <TGo4TaskManager.h>
Public Methods | |
TGo4TaskManager (const char *name, TGo4ServerTask *server, UInt_t negotiationport=0) | |
virtual | ~TGo4TaskManager () |
Int_t | ServeClient () |
used by connector runnable to wait for a client connect/disonnect request. More... | |
Go4CommandMode_t | ClientLogin () |
Check account and password of the client that requests a connection to this server. More... | |
Int_t | ConnectClient (const char *client, const char *host, Go4CommandMode_t role=kGo4ComModeController) |
used by connector runnable to wait for a client request to connect to this server task. More... | |
Int_t | DisConnectClient (const char *name, Bool_t clientwait=kTRUE) |
disonnect an existing client by name, wait for negotiation OK if clientwait is true. More... | |
Int_t | DisConnectClient (TGo4TaskHandler *taskhandler, Bool_t clientwait=kTRUE) |
disonnect an existing client by name, wait for negotiation OK if clientwait is true. More... | |
Bool_t | AddClient (const char *client, const char *host, Go4CommandMode_t role) |
adds client task of name to manager: create server task handler and try to connect to client Command execution role depends on previous login passowrd. More... | |
Bool_t | AddTaskHandler (TGo4TaskHandler *han) |
adds external task handler to array. More... | |
TGo4TaskHandler * | NewTaskHandler (const char *name) |
creates new task handler with given name and adds it into array. More... | |
Bool_t | RemoveTaskHandler (const char *name) |
removes task handler from array by name. More... | |
TGo4TaskHandler * | GetTaskHandler (const char *name) |
returns certain task handler by name. More... | |
TGo4TaskHandler * | GetLastTaskHandler () |
returns last task handler in list. More... | |
TGo4TaskHandler * | NextTaskHandler (Bool_t reset=kFALSE) |
For iteration over all connected task handlers. More... | |
TMutex * | GetMutex () |
UInt_t | GetTaskCount () const |
Number of entries in taskhandler list, i.e. More... | |
UInt_t | GetNegotiationPort () |
returns the portnumber for client server negotiation port which is actually used by the running taskmanager. More... | |
Int_t | WaitForClientRemoved () |
Bool_t | HasControllerTask () |
Static Public Attributes | |
const Int_t | fgiDISCONCYCLES = 360 |
cycles to wait for client disconnection. More... | |
const UInt_t | fguDISCONTIME = 500 |
time for each disonnection wait cycle. More... | |
Private Methods | |
TGo4TaskManager () | |
TGo4TaskManager (const TGo4TaskManager &right) | |
TGo4TaskManager & | operator= (const TGo4TaskManager &right) |
Private Attributes | |
TGo4ServerTask * | fxServer |
TGo4Socket * | fxTransport |
TObjArray * | fxTaskList |
More... | |
TMutex * | fxListMutex |
TIterator * | fxTaskIter |
Iterator over list of tasks. More... | |
UInt_t | fuTaskCount |
More... | |
UInt_t | fuNegotiationPort |
port number for the server client negotiation connections. More... | |
Bool_t | fbClientIsRemoved |
True if the last specified client is removed from server. More... | |
Bool_t | fbHasControllerConnection |
true if this server already has one connection to a master client that has the controller role. More... |
|
Definition at line 36 of file TGo4TaskManager.cxx. References TGo4TaskHandler::fguCONNECTORPORT, fuNegotiationPort, fxListMutex, fxServer, fxTaskIter, fxTaskList, and fxTransport. |
|
Definition at line 61 of file TGo4TaskManager.cxx. References TGo4Socket::Close(), fxListMutex, fxTaskIter, fxTaskList, and fxTransport. |
|
|
|
|
|
used by connector runnable to wait for a client connect/disonnect request.
Definition at line 74 of file TGo4TaskManager.cxx. References ClientLogin(), ConnectClient(), TGo4Log::Debug(), DisConnectClient(), TGo4TaskHandler::fgcCONNECT, TGo4TaskHandler::fgcDISCONNECT, TGo4TaskHandler::fgcERROR, TGo4TaskHandler::fgcOK, TGo4TaskHandler::fgiPORTWAITCYCLES, TGo4TaskHandler::fguPORTWAITTIME, TGo4ThreadManager::fguTEXTLENGTH, fuNegotiationPort, fxServer, fxTransport, GetNegotiationPort(), Go4CommandMode_t, TGo4ThreadManager::IsTerminating(), kGo4ComModeRefused, TGo4Socket::RecvRaw(), TGo4Socket::Send(), TGo4ServerTask::SetConnect(), TGo4ServerTask::SetDisConnect(), TGo4Thread::Sleep(), TGo4ServerTask::WaitForClose(), TGo4ServerTask::WaitForConnection(), and TGo4ServerTask::WaitForOpen(). Referenced by TGo4ConnectorRunnable::Run(). |
|
Check account and password of the client that requests a connection to this server. Return value specifies client access priorities as defined in TGo4Command.h Returns 0 in case of incorrect login. Definition at line 201 of file TGo4TaskManager.cxx. References TGo4Log::Debug(), TGo4TaskHandler::fgcMASTER, TGo4TaskHandler::fgcOK, TGo4TaskHandler::fgcSLAVE, TGo4TaskHandler::fgxADMINISTRATORACCOUNT, TGo4TaskHandler::fgxCONTROLLERACCOUNT, TGo4TaskHandler::fgxOBSERVERACCOUNT, fxServer, fxTransport, Go4CommandMode_t, TGo4Task::IsMaster(), kGo4ComModeAdministrator, kGo4ComModeController, kGo4ComModeObserver, kGo4ComModeRefused, TGo4Socket::RecvRaw(), and TGo4Log::Warn(). Referenced by ServeClient(). |
|
used by connector runnable to wait for a client request to connect to this server task. May specify mode of allowed commands in case of client is master. Definition at line 291 of file TGo4TaskManager.cxx. References AddClient(), fxListMutex, fxTaskList, and Go4CommandMode_t. Referenced by ServeClient(). |
|
disonnect an existing client by name, wait for negotiation OK if clientwait is true.
Definition at line 307 of file TGo4TaskManager.cxx. References GetTaskHandler(), and TGo4Log::Info(). Referenced by TGo4ServerTask::RemoveClient(), and ServeClient(). |
|
disonnect an existing client by name, wait for negotiation OK if clientwait is true.
Definition at line 321 of file TGo4TaskManager.cxx. References TGo4Log::Debug(), TGo4TaskHandler::DisConnect(), fbClientIsRemoved, fbHasControllerConnection, TGo4TaskHandler::fgcOK, fuTaskCount, fxServer, fxTransport, TGo4TaskHandler::GetRole(), kGo4ComModeObserver, TGo4Socket::RecvRaw(), RemoveTaskHandler(), and TGo4Task::SendStopBuffers(). |
|
adds client task of name to manager: create server task handler and try to connect to client Command execution role depends on previous login passowrd.
Definition at line 370 of file TGo4TaskManager.cxx. References TGo4TaskHandler::Connect(), TGo4Log::Error(), fbHasControllerConnection, TGo4TaskHandler::fgcERROR, fuTaskCount, fxServer, fxTransport, TGo4TaskHandler::GetComPort(), TGo4TaskHandler::GetDatPort(), TGo4Command::GetModeDescription(), TGo4TaskHandler::GetRole(), TGo4TaskHandler::GetStatPort(), Go4CommandMode_t, TGo4Log::Info(), kGo4ComModeObserver, NewTaskHandler(), RemoveTaskHandler(), TGo4Socket::Send(), TGo4Task::SendStatusMessage(), TGo4ServerTask::SetCurrentTask(), TGo4TaskHandler::SetRole(), and TGo4Log::Warn(). Referenced by ConnectClient(). |
|
adds external task handler to array.
Definition at line 404 of file TGo4TaskManager.cxx. References fxListMutex, and fxTaskList. Referenced by NewTaskHandler(). |
|
creates new task handler with given name and adds it into array.
Definition at line 427 of file TGo4TaskManager.cxx. References AddTaskHandler(), fxServer, and TGo4Task::IsMaster(). Referenced by AddClient(). |
|
removes task handler from array by name.
Definition at line 445 of file TGo4TaskManager.cxx. References fxListMutex, fxServer, fxTaskList, TGo4ServerTask::GetCurrentTaskHandler(), TGo4ServerTask::SetCurrentTask(), and TGo4Task::StartWorkThreads(). Referenced by AddClient(), and DisConnectClient(). |
|
returns certain task handler by name.
Definition at line 483 of file TGo4TaskManager.cxx. References fxListMutex, and fxTaskList. Referenced by DisConnectClient(), TGo4ServerTask::GetTaskHandler(), and TGo4ServerTask::SetCurrentTask(). |
|
returns last task handler in list.
Definition at line 494 of file TGo4TaskManager.cxx. References fxListMutex, and fxTaskList. Referenced by TGo4ServerTask::SetCurrentTask(). |
|
For iteration over all connected task handlers. If reset is true, internal iterator will be reset. Otherwies, continue iterating list until last entry. Returns 0 when iteration finishes. Definition at line 505 of file TGo4TaskManager.cxx. References fxListMutex, and fxTaskIter. Referenced by TGo4ServerTask::NextCommand(), TGo4ServerTask::RemoveAllClients(), TGo4ServerTask::SendStatus(), and TGo4ServerTask::SendStatusBuffer(). |
|
Definition at line 104 of file TGo4TaskManager.h. References fxListMutex. Referenced by TGo4ServerTask::NextCommand(), TGo4ServerTask::SendStatus(), and TGo4ServerTask::SendStatusBuffer(). |
|
Number of entries in taskhandler list, i.e. number of connected clients Definition at line 107 of file TGo4TaskManager.h. References fuTaskCount. |
|
returns the portnumber for client server negotiation port which is actually used by the running taskmanager.
Definition at line 540 of file TGo4TaskManager.cxx. References fuNegotiationPort, fxTransport, and TGo4Socket::GetPort(). Referenced by TGo4ServerTask::LaunchClient(), ServeClient(), and TGo4ServerTask::StopConnectorThread(). |
|
Definition at line 515 of file TGo4TaskManager.cxx. References fbClientIsRemoved, fgiDISCONCYCLES, fguDISCONTIME, fxServer, TGo4ThreadManager::IsTerminating(), and TGo4Thread::Sleep(). Referenced by TGo4ServerTask::RemoveClient(). |
|
Definition at line 119 of file TGo4TaskManager.h. References fbHasControllerConnection. |
|
|
|
cycles to wait for client disconnection.
Definition at line 32 of file TGo4TaskManager.cxx. Referenced by WaitForClientRemoved(). |
|
time for each disonnection wait cycle.
Definition at line 34 of file TGo4TaskManager.cxx. Referenced by WaitForClientRemoved(). |
|
Definition at line 141 of file TGo4TaskManager.h. Referenced by AddClient(), ClientLogin(), DisConnectClient(), NewTaskHandler(), RemoveTaskHandler(), ServeClient(), TGo4TaskManager(), and WaitForClientRemoved(). |
|
Definition at line 143 of file TGo4TaskManager.h. Referenced by AddClient(), ClientLogin(), DisConnectClient(), GetNegotiationPort(), ServeClient(), TGo4TaskManager(), and ~TGo4TaskManager(). |
|
Definition at line 147 of file TGo4TaskManager.h. Referenced by AddTaskHandler(), ConnectClient(), GetLastTaskHandler(), GetTaskHandler(), RemoveTaskHandler(), TGo4TaskManager(), and ~TGo4TaskManager(). |
|
Definition at line 149 of file TGo4TaskManager.h. Referenced by AddTaskHandler(), ConnectClient(), GetLastTaskHandler(), GetMutex(), GetTaskHandler(), NextTaskHandler(), RemoveTaskHandler(), TGo4TaskManager(), and ~TGo4TaskManager(). |
|
Iterator over list of tasks.
Definition at line 152 of file TGo4TaskManager.h. Referenced by NextTaskHandler(), TGo4TaskManager(), and ~TGo4TaskManager(). |
|
Definition at line 160 of file TGo4TaskManager.h. Referenced by AddClient(), DisConnectClient(), and GetTaskCount(). |
|
port number for the server client negotiation connections.
Definition at line 165 of file TGo4TaskManager.h. Referenced by GetNegotiationPort(), ServeClient(), and TGo4TaskManager(). |
|
True if the last specified client is removed from server. flag is set by connector thread who performs the DisconnectClient of TaskManager; is reset by WaitForClientRemoved method. Definition at line 172 of file TGo4TaskManager.h. Referenced by DisConnectClient(), and WaitForClientRemoved(). |
|
true if this server already has one connection to a master client that has the controller role. Only one controller or administrator taskhandler is allowed per server. Definition at line 177 of file TGo4TaskManager.h. Referenced by AddClient(), DisConnectClient(), and HasControllerTask(). |