#include <TGo4ServerTask.h>
Inheritance diagram for TGo4ServerTask:
Public Types | |
enum | ELaunchmodes { kSecureShell = BIT(0), kGuiEmbed = BIT(1) } |
Public Member Functions | |
TGo4ServerTask (const char *name, UInt_t negotiationport=0, Bool_t blockingmode=kFALSE, Bool_t standalone=kFALSE, Bool_t autostart=kTRUE, Bool_t autocreate=kTRUE, Bool_t ismaster=kTRUE) | |
virtual | ~TGo4ServerTask () |
virtual void | Quit () |
Quit method used by quit command; may be overridden in special application. | |
void | Shutdown () |
Fast Quit() without waiting for proper disconnection. | |
virtual void | LockAll () |
Lock all go4 mutexes in correct order to avoid deadlocking. | |
virtual void | UnLockAll () |
UnLock all go4 mutexes in correct order to avoid deadlocking to be used from cintlocktimer. | |
TGo4TaskManager * | GetTaskManager () |
TGo4TaskHandler * | GetCurrentTaskHandler () |
Get task handler of the currently activated client connection. | |
TGo4TaskHandler * | GetTaskHandler () |
Get task handler for client specified by name. | |
TGo4TaskHandler * | GetTaskHandler (const char *name) |
Get task handler for client specified by name. | |
TGo4BufferQueue * | GetCommandQueue (const char *task=0) |
TGo4BufferQueue * | GetStatusQueue (const char *task=0) |
TGo4BufferQueue * | GetDataQueue (const char *task=0) |
virtual TGo4Command * | NextCommand () |
Delivers next command. | |
virtual void | SendStatus (TGo4Status *stat, const char *receiver=0) |
Send status object via status channel to the master. | |
virtual void | SendStatusBuffer () |
Send internal status buffer to the master(s). | |
virtual Bool_t | StartConnectorThread () |
starts the thread that listens to the connector port for a client negotiation request; used after launching an rsh client from server | |
virtual Bool_t | StopConnectorThread () |
stops the thread that listens to the connector port for a client negotiation request; used before launching an rsh client from server. | |
Bool_t | ConnectorThreadIsStopped () |
Returns the waiting state fbIsWaiting of the Connector Thread;. | |
void | SetCurrentTask (const char *name) |
sets current client task (i.e. | |
void | SetConnect (TGo4Socket *trans, const char *host, UInt_t port, Bool_t keepserv=kFALSE) |
void | SetDisConnect (TGo4Socket *trans) |
TGo4Socket * | GetConnectTransport () |
const char * | GetConnectorName () const |
const char * | GetConnectHost () const |
virtual Int_t | TimerConnect () |
this method is used by the connectortimer Notify to connect or disconnect a transportchannel (TSocket) on demand; the connection process itself is handled by the connector runnable which uses services of the TaskManager class | |
virtual Int_t | RemoveAllClients (Bool_t force=false) |
Remove all connected client task from this server. | |
virtual Bool_t | RemoveClient (const char *name, Bool_t clientwait=kTRUE, Bool_t isterminating=kFALSE) |
Remove the client task specified by name from this server. | |
Bool_t | RemoveCurrentClient () |
removes the currently active client from server (disconnect) | |
Int_t | WaitForOpen () |
Int_t | WaitForClose () |
// * Overrides the ThreadManager Initialization; is used to setup the // * client connections on demand; checks for fbConnectRequest flag // | |
Int_t | WaitForConnection () |
Static Public Member Functions | |
static const char * | Get_fgcLAUNCHPREFSFILE () |
Static Protected Attributes | |
static const Int_t | fgiOPENWAITCYCLES = 100 |
maximum cycles to wait until transport is open | |
static const UInt_t | fguOPENWAITCYCLETIME = 100 |
time for each open wait cycle | |
static const Int_t | fgiCLOSEWAITCYCLES = 100 |
maximum cycles to wait until transport is closed | |
static const UInt_t | fguCLOSEWAITCYCLETIME = 100 |
time for each close wait cycle | |
static const Int_t | fgiCONNECTWAITCYCLES = 20 |
maximum cycles to wait until transport is connected | |
static const UInt_t | fguCONNECTWAITCYCLETIME = 200 |
time for each connect wait cycle | |
static const UInt_t | fguCONNECTTIMERPERIOD = 100 |
period of task connector timer | |
static const char * | fgcLAUNCHPREFSFILE = "etc/Go4LaunchClientPrefs.txt" |
Name of the Preferences file for the client startup. | |
Private Attributes | |
TString | fxConnectorName |
remember name of connector thread | |
TGo4TaskManager * | fxTaskManager |
1 | |
TGo4TaskHandler * | fxCurrentTaskHandler |
1 | |
TGo4Socket * | fxConnectTransport |
link to the next TaskHandler transport instance that shall be connected by the Application Control Timer with the client | |
TGo4Socket * | fxDisConnectTransport |
link to the next TaskHandler transport instance that shall be disconnected by the Application Control Timer with the client | |
TString | fxConnectHost |
hostname for timer connect | |
UInt_t | fuConnectPort |
port number for timer connect | |
Bool_t | fbKeepServerSocket |
True if open in server mode shall keep the server socket instance. | |
Bool_t | fbConnectRequest |
True if fxConnectTransport shall be Open() by AppControlTimer. | |
Bool_t | fbDisConnectRequest |
True if fxConnectTransport shall be Close() by AppControlTimer. | |
Bool_t | fbConnectIsOpen |
True if fxConnectTransport waits in server Open() call. | |
Bool_t | fbConnectIsDone |
True if fxConnectTransport has returned from Open(), i.e. | |
Bool_t | fbConnectIsClose |
True if fxConnectTransport has returned from Close(), i.e. | |
TGo4TaskConnectorTimer * | fxConnectorTimer |
timer responsible for the connection/disconnection of clients; independent of application control timer 1 |
|
Definition at line 279 of file TGo4ServerTask.h. |
|
Definition at line 53 of file TGo4ServerTask.cxx. References fguCONNECTTIMERPERIOD, fxConnectorName, fxConnectorTimer, fxTaskManager, TGo4ThreadManager::fxWorkHandler, GetConnectorName(), TGo4CommandInvoker::Instance(), TGo4ThreadManager::Launch(), TGo4ThreadHandler::NewThread(), and TGo4CommandInvoker::Register(). |
|
Definition at line 97 of file TGo4ServerTask.cxx. References fxConnectorTimer, fxTaskManager, TGo4ThreadManager::GetWorkHandler(), and TGo4CommandInvoker::UnRegister(). |
|
Quit method used by quit command; may be overridden in special application.
Reimplemented from TGo4Task. Definition at line 613 of file TGo4ServerTask.cxx. References TGo4Log::Debug(), TGo4Task::Get_fgiTERMID(), TGo4Task::IsMaster(), RemoveAllClients(), TGo4Task::SendStatusMessage(), TGo4Task::Terminate(), and TGo4Task::WakeCommandQueue(). |
|
Fast Quit() without waiting for proper disconnection. For analysis server shutdown. Definition at line 624 of file TGo4ServerTask.cxx. References TGo4Log::Debug(), fguCONNECTTIMERPERIOD, TGo4Task::Get_fgiTERMID(), TGo4Task::GetSlave(), RemoveAllClients(), TGo4Task::SendStatusMessage(), TGo4TaskOwner::SetTask(), TGo4Thread::Sleep(), TGo4Slave::Stop(), TGo4Task::StopWorkThreads(), TGo4Slave::Terminate(), and TGo4Task::WakeCommandQueue(). Referenced by TGo4ComServerQuit::ExeCom(). |
|
Lock all go4 mutexes in correct order to avoid deadlocking. to be used from cintlocktimer Reimplemented from TGo4Task. Definition at line 645 of file TGo4ServerTask.cxx. References TGo4Task::fxStatusMutex, fxTaskManager, TGo4TaskManager::GetMutex(), and TGo4LockGuard::LockMainMutex(). |
|
UnLock all go4 mutexes in correct order to avoid deadlocking to be used from cintlocktimer.
Reimplemented from TGo4Task. Definition at line 658 of file TGo4ServerTask.cxx. References TGo4Task::fxStatusMutex, fxTaskManager, TGo4TaskManager::GetMutex(), and TGo4LockGuard::UnLockMainMutex(). |
|
Definition at line 288 of file TGo4ServerTask.cxx. References fxTaskManager. Referenced by TGo4AnalysisProxy::ConnectorPort(), TGo4TaskOwner::GetTaskManagerMutex(), TGo4AnalysisProxy::LaunchAsClient(), and TGo4ConnectorRunnable::TGo4ConnectorRunnable(). |
|
Get task handler of the currently activated client connection.
Definition at line 283 of file TGo4ServerTask.cxx. References fxCurrentTaskHandler. Referenced by GetCommandQueue(), GetDataQueue(), GetStatusQueue(), GetTaskHandler(), TGo4TaskOwner::IsConnected(), RemoveClient(), RemoveCurrentClient(), TGo4TaskManager::RemoveTaskHandler(), TGo4LoggingRunnable::Run(), and TGo4ControllerRunnable::Run(). |
|
Get task handler for client specified by name.
Reimplemented from TGo4Task. Definition at line 278 of file TGo4ServerTask.cxx. References GetCurrentTaskHandler(). Referenced by GetCommandQueue(), GetDataQueue(), GetStatusQueue(), and RemoveClient(). |
|
Get task handler for client specified by name.
Definition at line 273 of file TGo4ServerTask.cxx. References fxTaskManager, and TGo4TaskManager::GetTaskHandler(). |
|
Reimplemented from TGo4Task. Definition at line 466 of file TGo4ServerTask.cxx. References TGo4TaskHandler::GetCommandQueue(), GetCurrentTaskHandler(), and GetTaskHandler(). |
|
Reimplemented from TGo4Task. Definition at line 479 of file TGo4ServerTask.cxx. References GetCurrentTaskHandler(), TGo4TaskHandler::GetStatusQueue(), and GetTaskHandler(). Referenced by TGo4ExampleServer::StopWorkThreads(). |
|
Reimplemented from TGo4Task. Definition at line 493 of file TGo4ServerTask.cxx. References GetCurrentTaskHandler(), TGo4TaskHandler::GetDataQueue(), and GetTaskHandler(). Referenced by TGo4ExampleServer::StopWorkThreads(). |
|
Delivers next command. This implementation will poll over command queues of all existing connections. Command is labeled with name of ordering task, so data may be returned to command sender only. Reimplemented from TGo4Task. Definition at line 507 of file TGo4ServerTask.cxx. References fxTaskManager, TGo4TaskHandler::GetCommandQueue(), TGo4TaskManager::GetMutex(), TGo4TaskHandler::GetRole(), TGo4Queue::IsEmpty(), TGo4Task::IsMaster(), TGo4TaskManager::NextTaskHandler(), TGo4Command::SetMode(), TGo4Command::SetTaskName(), and TGo4BufferQueue::WaitObjectFromBuffer(). |
|
Send status object via status channel to the master. Master name may be specified, if more than one master is connected. By default, object is send to all connected tasks Reimplemented from TGo4Task. Definition at line 533 of file TGo4ServerTask.cxx. References TGo4BufferQueue::AddBufferFromObject(), TGo4Log::Debug(), fxTaskManager, TGo4TaskManager::GetMutex(), TGo4TaskHandler::GetStatusQueue(), TGo4Task::IsMaster(), TGo4TaskManager::NextTaskHandler(), and TGo4Task::SendStatus(). |
|
Send internal status buffer to the master(s).
Reimplemented from TGo4Task. Definition at line 559 of file TGo4ServerTask.cxx. References TGo4BufferQueue::AddBuffer(), TGo4Log::Debug(), TGo4Task::fxStatusBuffer, TGo4Task::fxStatusMutex, fxTaskManager, TGo4TaskManager::GetMutex(), TGo4TaskHandler::GetStatusQueue(), TGo4Task::IsMaster(), and TGo4TaskManager::NextTaskHandler(). |
|
starts the thread that listens to the connector port for a client negotiation request; used after launching an rsh client from server
Definition at line 580 of file TGo4ServerTask.cxx. References GetConnectorName(), and TGo4ThreadManager::GetWorkHandler(). Referenced by TGo4AnalysisProxy::LaunchAsClient(). |
|
stops the thread that listens to the connector port for a client negotiation request; used before launching an rsh client from server. A dummy connection is performed to release socket pending in listening state, thus runnable may wait afterwards , and no server socket is listening on spawning the client. Tests showed that any child process took over the listening server socket, which is not desired here and probably a bug of the system. Definition at line 588 of file TGo4ServerTask.cxx. References TGo4Socket::Close(), fxTaskManager, TGo4TaskHandler::Get_fgcERROR(), GetConnectorName(), TGo4TaskManager::GetNegotiationPort(), TGo4ThreadManager::GetWorkHandler(), TGo4Socket::Open(), and TGo4Socket::Send(). |
|
Returns the waiting state fbIsWaiting of the Connector Thread;.
Definition at line 605 of file TGo4ServerTask.cxx. References GetConnectorName(), TGo4ThreadManager::GetWorkHandler(), and TGo4Thread::IsWaiting(). |
|
sets current client task (i.e. taskhandler) by name Definition at line 220 of file TGo4ServerTask.cxx. References TGo4Log::Debug(), fxCurrentTaskHandler, fxTaskManager, TGo4TaskManager::GetLastTaskHandler(), TGo4TaskManager::GetTaskHandler(), TGo4Task::IsWorkStopped(), TGo4Task::StartWorkThreads(), and TGo4Task::StopWorkThreads(). Referenced by TGo4TaskManager::AddClient(), and TGo4TaskManager::RemoveTaskHandler(). |
|
Definition at line 293 of file TGo4ServerTask.cxx. References fbConnectRequest, fbKeepServerSocket, fuConnectPort, fxConnectHost, and fxConnectTransport. Referenced by TGo4TaskHandler::ConnectServerChannel(), and TGo4TaskManager::ServeClient(). |
|
Definition at line 302 of file TGo4ServerTask.cxx. References fbDisConnectRequest, and fxDisConnectTransport. Referenced by TGo4TaskManager::ServeClient(). |
|
Definition at line 461 of file TGo4ServerTask.cxx. References fxConnectTransport. |
|
Definition at line 131 of file TGo4ServerTask.h. References fxConnectorName. Referenced by ConnectorThreadIsStopped(), StartConnectorThread(), StopConnectorThread(), and TGo4ServerTask(). |
|
Definition at line 133 of file TGo4ServerTask.h. References fxConnectHost. Referenced by TimerConnect(). |
|
this method is used by the connectortimer Notify to connect or disconnect a transportchannel (TSocket) on demand; the connection process itself is handled by the connector runnable which uses services of the TaskManager class
Definition at line 308 of file TGo4ServerTask.cxx. References TGo4Socket::Close(), fbConnectIsClose, fbConnectIsDone, fbConnectIsOpen, fbConnectRequest, fbDisConnectRequest, fbKeepServerSocket, fuConnectPort, fxConnectTransport, fxDisConnectTransport, GetConnectHost(), TGo4Socket::IsOpen(), and TGo4Socket::Open(). Referenced by TGo4TaskConnectorTimer::Notify(). |
|
Remove all connected client task from this server. with option force=true, remove without waiting Definition at line 175 of file TGo4ServerTask.cxx. References fxTaskManager, TGo4TaskManager::NextTaskHandler(), and RemoveClient(). Referenced by Quit(), and Shutdown(). |
|
Remove the client task specified by name from this server. If clientwait=true, remove with client handshake. If isterminating=true, do not restart workthreads after removing the client. Definition at line 105 of file TGo4ServerTask.cxx. References TGo4Log::Debug(), TGo4TaskManager::DisConnectClient(), fxTaskManager, GetCurrentTaskHandler(), GetTaskHandler(), TGo4Task::IsMaster(), kComQuit, TGo4Task::SendStopBuffers(), TGo4Task::StartWorkThreads(), TGo4Task::StopWorkThreads(), TGo4Task::SubmitEmergencyCommand(), TGo4Task::SubmitEmergencyData(), and TGo4TaskManager::WaitForClientRemoved(). Referenced by TGo4Master::DisconnectSlave(), TGo4ComRemoveClient::ExeCom(), RemoveAllClients(), and RemoveCurrentClient(). |
|
removes the currently active client from server (disconnect)
Definition at line 203 of file TGo4ServerTask.cxx. References TGo4Log::Debug(), GetCurrentTaskHandler(), and RemoveClient(). |
|
Definition at line 391 of file TGo4ServerTask.cxx. References fbConnectIsOpen, fgiOPENWAITCYCLES, fguOPENWAITCYCLETIME, and TGo4Thread::Sleep(). Referenced by TGo4TaskHandler::ConnectServerChannel(), and TGo4TaskManager::ServeClient(). |
|
// * Overrides the ThreadManager Initialization; is used to setup the // * client connections on demand; checks for fbConnectRequest flag //
Definition at line 413 of file TGo4ServerTask.cxx. References fbConnectIsClose, fgiCLOSEWAITCYCLES, fguCLOSEWAITCYCLETIME, and TGo4Thread::Sleep(). Referenced by TGo4TaskManager::ServeClient(). |
|
Definition at line 434 of file TGo4ServerTask.cxx. References fbConnectIsDone, fguCONNECTWAITCYCLETIME, TGo4ThreadManager::IsTerminating(), and TGo4Thread::Sleep(). Referenced by TGo4TaskHandler::ConnectServerChannel(), and TGo4TaskManager::ServeClient(). |
|
Definition at line 669 of file TGo4ServerTask.cxx. References fgcLAUNCHPREFSFILE. Referenced by TGo4AnalysisProxy::GetLaunchString(). |
|
maximum cycles to wait until transport is open
Definition at line 41 of file TGo4ServerTask.cxx. Referenced by WaitForOpen(). |
|
time for each open wait cycle
Definition at line 42 of file TGo4ServerTask.cxx. Referenced by WaitForOpen(). |
|
maximum cycles to wait until transport is closed
Definition at line 43 of file TGo4ServerTask.cxx. Referenced by WaitForClose(). |
|
time for each close wait cycle
Definition at line 44 of file TGo4ServerTask.cxx. Referenced by WaitForClose(). |
|
maximum cycles to wait until transport is connected
Definition at line 45 of file TGo4ServerTask.cxx. |
|
time for each connect wait cycle
Definition at line 46 of file TGo4ServerTask.cxx. Referenced by WaitForConnection(). |
|
period of task connector timer
Definition at line 47 of file TGo4ServerTask.cxx. Referenced by Shutdown(), and TGo4ServerTask(). |
|
Name of the Preferences file for the client startup.
Definition at line 50 of file TGo4ServerTask.cxx. Referenced by Get_fgcLAUNCHPREFSFILE(). |
|
remember name of connector thread
Definition at line 206 of file TGo4ServerTask.h. Referenced by GetConnectorName(), and TGo4ServerTask(). |
|
Definition at line 210 of file TGo4ServerTask.h. Referenced by GetTaskHandler(), GetTaskManager(), LockAll(), NextCommand(), RemoveAllClients(), RemoveClient(), SendStatus(), SendStatusBuffer(), SetCurrentTask(), StopConnectorThread(), TGo4ServerTask(), UnLockAll(), and ~TGo4ServerTask(). |
|
1
Definition at line 213 of file TGo4ServerTask.h. Referenced by GetCurrentTaskHandler(), and SetCurrentTask(). |
|
link to the next TaskHandler transport instance that shall be connected by the Application Control Timer with the client
Definition at line 219 of file TGo4ServerTask.h. Referenced by GetConnectTransport(), SetConnect(), and TimerConnect(). |
|
link to the next TaskHandler transport instance that shall be disconnected by the Application Control Timer with the client
Definition at line 225 of file TGo4ServerTask.h. Referenced by SetDisConnect(), and TimerConnect(). |
|
hostname for timer connect
Definition at line 230 of file TGo4ServerTask.h. Referenced by GetConnectHost(), and SetConnect(). |
|
port number for timer connect
Definition at line 235 of file TGo4ServerTask.h. Referenced by SetConnect(), and TimerConnect(). |
|
True if open in server mode shall keep the server socket instance.
Definition at line 241 of file TGo4ServerTask.h. Referenced by SetConnect(), and TimerConnect(). |
|
True if fxConnectTransport shall be Open() by AppControlTimer.
Definition at line 246 of file TGo4ServerTask.h. Referenced by SetConnect(), and TimerConnect(). |
|
True if fxConnectTransport shall be Close() by AppControlTimer.
Definition at line 251 of file TGo4ServerTask.h. Referenced by SetDisConnect(), and TimerConnect(). |
|
True if fxConnectTransport waits in server Open() call.
Definition at line 257 of file TGo4ServerTask.h. Referenced by TimerConnect(), and WaitForOpen(). |
|
True if fxConnectTransport has returned from Open(), i.e. connection was established Definition at line 263 of file TGo4ServerTask.h. Referenced by TimerConnect(), and WaitForConnection(). |
|
True if fxConnectTransport has returned from Close(), i.e. connection was established Definition at line 269 of file TGo4ServerTask.h. Referenced by TimerConnect(), and WaitForClose(). |
|
timer responsible for the connection/disconnection of clients; independent of application control timer 1
Definition at line 276 of file TGo4ServerTask.h. Referenced by TGo4ServerTask(), and ~TGo4ServerTask(). |