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 /* This file is part of the XRootD software suite. */
13 /* */
14 /* XRootD is free software: you can redistribute it and/or modify it under */
15 /* the terms of the GNU Lesser General Public License as published by the */
16 /* Free Software Foundation, either version 3 of the License, or (at your */
17 /* option) any later version. */
18 /* */
19 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */
20 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
21 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
22 /* License for more details. */
23 /* */
24 /* You should have received a copy of the GNU Lesser General Public License */
25 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
26 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
27 /* */
28 /* The copyright holder's institutional names and contributor's names may not */
29 /* be used to endorse or promote products derived from this software without */
30 /* specific prior written permission of the institution or contributor. */
31 /******************************************************************************/
32 
33 #include <stdio.h>
34 #include <sys/uio.h>
35 
36 #include "XProtocol/YProtocol.hh"
37 
38 #include "XrdCms/XrdCmsResp.hh"
39 #include "XrdNet/XrdNetBuffer.hh"
40 #include "XrdOuc/XrdOucErrInfo.hh"
41 #include "XrdSys/XrdSysPthread.hh"
42 
43 class XrdInet;
44 class XrdLink;
45 class XrdNetBuffer;
46 
48 {
49 public:
50 
51 static char doDebug;
52 
53 int delayResp(XrdOucErrInfo &Resp);
54 
55 inline int isActive() {return Active;}
56 
58 
59 char *Name() {return Host;}
60 char *NPfx() {return HPfx;}
61 
62 int Send(char *msg, int mlen=0);
63 int Send(const struct iovec *iov, int iovcnt, int iotot=0);
64 
65 void *Start();
66 
67 inline int Suspended() {if (Suspend) chkStatus(); return Suspend;}
68 
69 void setNext(XrdCmsClientMan *np) {Next = np;}
70 
71 static void setNetwork(XrdInet *nP) {Network = nP;}
72 
73 static void setConfig(const char *cfn) {ConfigFN = cfn;}
74 
75 int whatsUp(const char *user, const char *path);
76 
77 inline int waitTime() {return repWait;}
78 
79  XrdCmsClientMan(char *host,int port,int cw,int nr,int rw,int rd);
81 
82 private:
83 int Hookup();
84 int Receive();
85 void relayResp();
86 void chkStatus();
87 void setStatus();
88 
91 static XrdInet *Network;
92 static const char *ConfigFN;
93 static const int chkVal = 256;
94 
97 
101 char *Host;
102 char *HPfx;
103 int Port;
105 int dally;
106 int Active;
107 int Silent;
111 int nrMax;
117 int qTime;
119 time_t lastUpdt;
120 time_t lastTOut;
123 };
124 #endif