TGo4ServerTask Class Reference

#include <TGo4ServerTask.h>

Inheritance diagram for TGo4ServerTask:

TGo4Task TGo4ThreadManager TGo4CommandReceiver TGo4ExampleServer

List of all members.

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.
TGo4TaskManagerGetTaskManager ()
TGo4TaskHandlerGetCurrentTaskHandler ()
 Get task handler of the currently activated client connection.
TGo4TaskHandlerGetTaskHandler ()
 Get task handler for client specified by name.
TGo4TaskHandlerGetTaskHandler (const char *name)
 Get task handler for client specified by name.
TGo4BufferQueueGetCommandQueue (const char *task=0)
TGo4BufferQueueGetStatusQueue (const char *task=0)
TGo4BufferQueueGetDataQueue (const char *task=0)
virtual TGo4CommandNextCommand ()
 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)
TGo4SocketGetConnectTransport ()
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/Go4LaunchPrefs.txt"
 Name of the Preferences file for the client startup.

Private Attributes

TString fxConnectorName
 remember name of connector thread
TGo4TaskManagerfxTaskManager
 1
TGo4TaskHandlerfxCurrentTaskHandler
 1
TGo4SocketfxConnectTransport
 link to the next TaskHandler transport instance that shall be connected by the Application Control Timer with the client
TGo4SocketfxDisConnectTransport
 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.
TGo4TaskConnectorTimerfxConnectorTimer
 timer responsible for the connection/disconnection of clients; independent of application control timer 1


Detailed Description

Definition at line 28 of file TGo4ServerTask.h.


Member Enumeration Documentation

Enumerator:
kSecureShell 
kGuiEmbed 

Definition at line 277 of file TGo4ServerTask.h.


Constructor & Destructor Documentation

TGo4ServerTask::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 
)

Definition at line 50 of file TGo4ServerTask.cxx.

TGo4ServerTask::~TGo4ServerTask (  )  [virtual]

Definition at line 94 of file TGo4ServerTask.cxx.


Member Function Documentation

void TGo4ServerTask::Quit (  )  [virtual]

Quit method used by quit command; may be overridden in special application.

Reimplemented from TGo4Task.

Definition at line 611 of file TGo4ServerTask.cxx.

void TGo4ServerTask::Shutdown (  ) 

Fast Quit() without waiting for proper disconnection.

For analysis server shutdown.

Definition at line 635 of file TGo4ServerTask.cxx.

void TGo4ServerTask::LockAll (  )  [virtual]

Lock all go4 mutexes in correct order to avoid deadlocking.

to be used from cintlocktimer

Reimplemented from TGo4Task.

Definition at line 661 of file TGo4ServerTask.cxx.

void TGo4ServerTask::UnLockAll (  )  [virtual]

UnLock all go4 mutexes in correct order to avoid deadlocking to be used from cintlocktimer.

Reimplemented from TGo4Task.

Definition at line 674 of file TGo4ServerTask.cxx.

TGo4TaskManager * TGo4ServerTask::GetTaskManager (  ) 

Definition at line 286 of file TGo4ServerTask.cxx.

TGo4TaskHandler * TGo4ServerTask::GetCurrentTaskHandler (  ) 

Get task handler of the currently activated client connection.

Definition at line 281 of file TGo4ServerTask.cxx.

TGo4TaskHandler * TGo4ServerTask::GetTaskHandler (  )  [virtual]

Get task handler for client specified by name.

Reimplemented from TGo4Task.

Definition at line 276 of file TGo4ServerTask.cxx.

TGo4TaskHandler * TGo4ServerTask::GetTaskHandler ( const char *  name  ) 

Get task handler for client specified by name.

Definition at line 271 of file TGo4ServerTask.cxx.

TGo4BufferQueue * TGo4ServerTask::GetCommandQueue ( const char *  task = 0  )  [virtual]

Reimplemented from TGo4Task.

Definition at line 464 of file TGo4ServerTask.cxx.

TGo4BufferQueue * TGo4ServerTask::GetStatusQueue ( const char *  task = 0  )  [virtual]

Reimplemented from TGo4Task.

Definition at line 477 of file TGo4ServerTask.cxx.

TGo4BufferQueue * TGo4ServerTask::GetDataQueue ( const char *  task = 0  )  [virtual]

Reimplemented from TGo4Task.

Definition at line 491 of file TGo4ServerTask.cxx.

TGo4Command * TGo4ServerTask::NextCommand (  )  [virtual]

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 505 of file TGo4ServerTask.cxx.

void TGo4ServerTask::SendStatus ( TGo4Status stat,
const char *  receiver = 0 
) [virtual]

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 531 of file TGo4ServerTask.cxx.

void TGo4ServerTask::SendStatusBuffer (  )  [virtual]

Send internal status buffer to the master(s).

Reimplemented from TGo4Task.

Definition at line 557 of file TGo4ServerTask.cxx.

Bool_t TGo4ServerTask::StartConnectorThread (  )  [virtual]

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 578 of file TGo4ServerTask.cxx.

Bool_t TGo4ServerTask::StopConnectorThread (  )  [virtual]

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 586 of file TGo4ServerTask.cxx.

Bool_t TGo4ServerTask::ConnectorThreadIsStopped (  ) 

Returns the waiting state fbIsWaiting of the Connector Thread;.

Definition at line 603 of file TGo4ServerTask.cxx.

void TGo4ServerTask::SetCurrentTask ( const char *  name  ) 

sets current client task (i.e.

taskhandler) by name

Definition at line 218 of file TGo4ServerTask.cxx.

void TGo4ServerTask::SetConnect ( TGo4Socket trans,
const char *  host,
UInt_t  port,
Bool_t  keepserv = kFALSE 
)

Definition at line 291 of file TGo4ServerTask.cxx.

void TGo4ServerTask::SetDisConnect ( TGo4Socket trans  ) 

Definition at line 300 of file TGo4ServerTask.cxx.

TGo4Socket * TGo4ServerTask::GetConnectTransport (  ) 

Definition at line 459 of file TGo4ServerTask.cxx.

const char* TGo4ServerTask::GetConnectorName (  )  const [inline]

Definition at line 129 of file TGo4ServerTask.h.

const char* TGo4ServerTask::GetConnectHost (  )  const [inline]

Definition at line 131 of file TGo4ServerTask.h.

Int_t TGo4ServerTask::TimerConnect (  )  [virtual]

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 306 of file TGo4ServerTask.cxx.

Int_t TGo4ServerTask::RemoveAllClients ( Bool_t  force = false  )  [virtual]

Remove all connected client task from this server.

with option force=true, remove without waiting

Definition at line 173 of file TGo4ServerTask.cxx.

Bool_t TGo4ServerTask::RemoveClient ( const char *  name,
Bool_t  clientwait = kTRUE,
Bool_t  isterminating = kFALSE 
) [virtual]

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 102 of file TGo4ServerTask.cxx.

Bool_t TGo4ServerTask::RemoveCurrentClient (  ) 

removes the currently active client from server (disconnect)

Definition at line 201 of file TGo4ServerTask.cxx.

Int_t TGo4ServerTask::WaitForOpen (  ) 

Definition at line 389 of file TGo4ServerTask.cxx.

Int_t TGo4ServerTask::WaitForClose (  ) 

Overrides the ThreadManager Initialization; is used to setup the client connections on demand; checks for fbConnectRequest flag.

Definition at line 411 of file TGo4ServerTask.cxx.

Int_t TGo4ServerTask::WaitForConnection (  ) 

Definition at line 432 of file TGo4ServerTask.cxx.

const char * TGo4ServerTask::Get_fgcLAUNCHPREFSFILE (  )  [static]

Definition at line 685 of file TGo4ServerTask.cxx.


Member Data Documentation

const Int_t TGo4ServerTask::fgiOPENWAITCYCLES = 100 [static, protected]

maximum cycles to wait until transport is open

Definition at line 176 of file TGo4ServerTask.h.

const UInt_t TGo4ServerTask::fguOPENWAITCYCLETIME = 100 [static, protected]

time for each open wait cycle

Definition at line 179 of file TGo4ServerTask.h.

const Int_t TGo4ServerTask::fgiCLOSEWAITCYCLES = 100 [static, protected]

maximum cycles to wait until transport is closed

Definition at line 182 of file TGo4ServerTask.h.

const UInt_t TGo4ServerTask::fguCLOSEWAITCYCLETIME = 100 [static, protected]

time for each close wait cycle

Definition at line 185 of file TGo4ServerTask.h.

const Int_t TGo4ServerTask::fgiCONNECTWAITCYCLES = 20 [static, protected]

maximum cycles to wait until transport is connected

Definition at line 188 of file TGo4ServerTask.h.

const UInt_t TGo4ServerTask::fguCONNECTWAITCYCLETIME = 200 [static, protected]

time for each connect wait cycle

Definition at line 191 of file TGo4ServerTask.h.

const UInt_t TGo4ServerTask::fguCONNECTTIMERPERIOD = 100 [static, protected]

period of task connector timer

Definition at line 194 of file TGo4ServerTask.h.

const char * TGo4ServerTask::fgcLAUNCHPREFSFILE = "etc/Go4LaunchPrefs.txt" [static, protected]

Name of the Preferences file for the client startup.

Definition at line 197 of file TGo4ServerTask.h.

remember name of connector thread

Definition at line 204 of file TGo4ServerTask.h.

1

Definition at line 208 of file TGo4ServerTask.h.

1

Definition at line 211 of file TGo4ServerTask.h.

link to the next TaskHandler transport instance that shall be connected by the Application Control Timer with the client

Definition at line 217 of file TGo4ServerTask.h.

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

Definition at line 223 of file TGo4ServerTask.h.

TString TGo4ServerTask::fxConnectHost [private]

hostname for timer connect

Definition at line 228 of file TGo4ServerTask.h.

port number for timer connect

Definition at line 233 of file TGo4ServerTask.h.

True if open in server mode shall keep the server socket instance.

Definition at line 239 of file TGo4ServerTask.h.

True if fxConnectTransport shall be Open() by AppControlTimer.

Definition at line 244 of file TGo4ServerTask.h.

True if fxConnectTransport shall be Close() by AppControlTimer.

Definition at line 249 of file TGo4ServerTask.h.

True if fxConnectTransport waits in server Open() call.

Definition at line 255 of file TGo4ServerTask.h.

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

connection was established

Definition at line 261 of file TGo4ServerTask.h.

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

connection was established

Definition at line 267 of file TGo4ServerTask.h.

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

Definition at line 274 of file TGo4ServerTask.h.


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

Generated on Thu Oct 28 12:31:33 2010 for Go4-Taskhandlerv4.04-2 by  doxygen 1.5.6