Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TXSlave.h
Go to the documentation of this file.
1 // @(#)root/proofx:$Id$
2 // Author: G. Ganis Oct 2005
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TXSlave
13 #define ROOT_TXSlave
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TXSlave //
19 // //
20 // This is the version of TSlave for slave servers based on XRD. //
21 // See TSlave for details. //
22 // //
23 //////////////////////////////////////////////////////////////////////////
24 
25 #include "TSlave.h"
26 #include "TXHandler.h"
27 
28 class TObjString;
29 class TSocket;
30 class TSignalHandler;
31 
32 class TXSlave : public TSlave, public TXHandler {
33 
34 friend class TProof;
35 friend class TXProofMgr;
36 
37 private:
38  Bool_t fValid;
39  Int_t fNWrks; // Number of workers when submaster in remote plite
40  TSignalHandler *fIntHandler; //interrupt signal handler (ctrl-c)
41 
42  void Init(const char *host, Int_t stype);
43  void ParseBuffer();
44 
45  // Static methods
46  static Int_t GetProofdProtocol(TSocket *s);
47 
48 protected:
49  void FlushSocket();
50  void Interrupt(Int_t type);
51  Int_t Ping();
52  TObjString *SendCoordinator(Int_t kind, const char *msg = 0, Int_t int2 = 0);
53  Int_t SendGroupPriority(const char *grp, Int_t priority);
54  void SetAlias(const char *alias);
55  void StopProcess(Bool_t abort, Int_t timeout);
56 
57 public:
58  TXSlave(const char *url, const char *ord, Int_t perf,
59  const char *image, TProof *proof, Int_t stype,
60  const char *workdir, const char *msd, Int_t nwk = 1);
61  virtual ~TXSlave();
62 
63  void Close(Option_t *opt = "");
64  void DoError(int level, const char *location, const char *fmt,
65  va_list va) const;
66 
67  Bool_t HandleError(const void *in = 0); // Error Handler
68  Bool_t HandleInput(const void *in = 0); // Input handler
69 
70  void SetInterruptHandler(Bool_t on = kTRUE);
71 
72  Int_t SetupServ(Int_t stype, const char *conffile);
73 
74  void Touch();
75 
76  ClassDef(TXSlave,0) //Xrd PROOF slave server
77 };
78 
79 #endif