xrootd
XrdCmsClientMan.hh
Go to the documentation of this file.
1 #ifndef __CMS_CLIENTMAN__
2 #define __CMS_CLIENTMAN__
3 /******************************************************************************/
4 /* */
5 /* X r d C m s C l i e n t M a n . h h */
6 /* */
7 /* (c) 2007 by the Board of Trustees of the Leland Stanford, Jr., University */
8 /* All Rights Reserved */
9 /* Produced by Andrew Hanushevsky for Stanford University under contract */
10 /* DE-AC02-76-SFO0515 with the Department of Energy */
11 /******************************************************************************/
12 
13 #include <stdio.h>
14 #include <sys/uio.h>
15 
16 #include "XProtocol/YProtocol.hh"
17 
18 #include "XrdCms/XrdCmsResp.hh"
19 #include "XrdNet/XrdNetBuffer.hh"
20 #include "XrdOuc/XrdOucErrInfo.hh"
21 #include "XrdSys/XrdSysPthread.hh"
22 
23 class XrdInet;
24 class XrdLink;
25 class XrdNetBuffer;
26 
28 {
29 public:
30 
31 static char doDebug;
32 
33 int delayResp(XrdOucErrInfo &Resp);
34 
35 inline int isActive() {return Active;}
36 
38 
39 char *Name() {return Host;}
40 char *NPfx() {return HPfx;}
41 
42 int Send(char *msg, int mlen=0);
43 int Send(const struct iovec *iov, int iovcnt, int iotot=0);
44 
45 void *Start();
46 
47 inline int Suspended() {if (Suspend) chkStatus(); return Suspend;}
48 
49 void setNext(XrdCmsClientMan *np) {Next = np;}
50 
51 static void setNetwork(XrdInet *nP) {Network = nP;}
52 
53 static void setConfig(const char *cfn) {ConfigFN = cfn;}
54 
55 int whatsUp(const char *user, const char *path);
56 
57 inline int waitTime() {return repWait;}
58 
59  XrdCmsClientMan(char *host,int port,int cw,int nr,int rw,int rd);
61 
62 private:
63 int Hookup();
64 int Receive();
65 void relayResp();
66 void chkStatus();
67 void setStatus();
68 
71 static XrdInet *Network;
72 static const char *ConfigFN;
73 static const int chkVal = 256;
74 
77 
81 char *Host;
82 char *HPfx;
83 int Port;
84 int manMask;
85 int dally;
86 int Active;
87 int Silent;
88 int Suspend;
89 int RecvCnt;
90 int SendCnt;
91 int nrMax;
93 int repWait;
94 int repWMax;
97 int qTime;
99 time_t lastUpdt;
100 time_t lastTOut;
103 };
104 #endif