xrootd
Loading...
Searching...
No Matches
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 <cstdio>
34#include <sys/uio.h>
35
37
38#include "XrdCms/XrdCmsResp.hh"
43
44class XrdInet;
45class XrdLink;
46
48{
49public:
50
51static char doDebug;
52
54
56
58
59char *Name() {return Host;}
60char *NPfx() {return HPfx;}
61
62int manPort() {return Port;}
63
64int Send(unsigned int &iMan, char *msg, int mlen=0);
65int Send(unsigned int &iMan, const struct iovec *iov,
66 int iovcnt, int iotot=0);
67
68void *Start();
69
70inline int Suspended() {AtomicBeg(myData);
71 int sVal = AtomicGet(Suspend);
73 if (!sVal) return sVal;
74 return chkStatus();
75 }
76
77void setNext(XrdCmsClientMan *np) {Next = np;}
78
79static void setNetwork(XrdInet *nP) {Network = nP;}
80
81static void setConfig(const char *cfn) {ConfigFN = cfn;}
82
83int whatsUp(const char *user, const char *path,
84 unsigned int iMan);
85
87
88 XrdCmsClientMan(char *host,int port,int cw,int nr,int rw,int rd);
90
91private:
92int Hookup();
93int Receive();
94void relayResp();
96void setStatus();
97
101static const char *ConfigFN;
102static const int chkVal = 256;
103
106
110char *Host;
111char *HPfx;
113unsigned int manInst;
129time_t lastUpdt;
130time_t lastTOut;
133};
134#endif
#define AtomicBeg(Mtx)
Definition XrdSysAtomics.hh:63
#define AtomicGet(x)
Definition XrdSysAtomics.hh:71
#define AtomicEnd(Mtx)
Definition XrdSysAtomics.hh:64
#define AtomicRet(mtx, x)
Definition XrdSysAtomics.hh:76
Definition XrdCmsClientMan.hh:48
int Active
Definition XrdCmsClientMan.hh:116
int maxDelay
Definition XrdCmsClientMan.hh:126
void setNext(XrdCmsClientMan *np)
Definition XrdCmsClientMan.hh:77
int Silent
Definition XrdCmsClientMan.hh:117
int repWait
Definition XrdCmsClientMan.hh:123
int waitTime()
Definition XrdCmsClientMan.hh:86
static XrdOucBuffPool BuffPool
Definition XrdCmsClientMan.hh:99
int Send(unsigned int &iMan, char *msg, int mlen=0)
static const char * ConfigFN
Definition XrdCmsClientMan.hh:101
int nrMax
Definition XrdCmsClientMan.hh:121
XrdCmsRespQ RespQ
Definition XrdCmsClientMan.hh:105
char * HPfx
Definition XrdCmsClientMan.hh:111
int manMask
Definition XrdCmsClientMan.hh:114
time_t lastTOut
Definition XrdCmsClientMan.hh:130
int Suspend
Definition XrdCmsClientMan.hh:118
XrdCmsClientMan * nextManager()
Definition XrdCmsClientMan.hh:57
char * Name()
Definition XrdCmsClientMan.hh:59
static XrdSysMutex manMutex
Definition XrdCmsClientMan.hh:98
int delayResp(XrdOucErrInfo &Resp)
int RecvCnt
Definition XrdCmsClientMan.hh:119
char * NPfx()
Definition XrdCmsClientMan.hh:60
XrdOucBuffer * NetBuff
Definition XrdCmsClientMan.hh:132
static void setConfig(const char *cfn)
Definition XrdCmsClientMan.hh:81
unsigned int manInst
Definition XrdCmsClientMan.hh:113
int minDelay
Definition XrdCmsClientMan.hh:125
int repWMax
Definition XrdCmsClientMan.hh:124
time_t lastUpdt
Definition XrdCmsClientMan.hh:129
static void setNetwork(XrdInet *nP)
Definition XrdCmsClientMan.hh:79
static XrdInet * Network
Definition XrdCmsClientMan.hh:100
XrdSysSemaphore syncResp
Definition XrdCmsClientMan.hh:104
int SendCnt
Definition XrdCmsClientMan.hh:120
int chkCount
Definition XrdCmsClientMan.hh:128
int whatsUp(const char *user, const char *path, unsigned int iMan)
XrdLink * Link
Definition XrdCmsClientMan.hh:109
static char doDebug
Definition XrdCmsClientMan.hh:51
int qTime
Definition XrdCmsClientMan.hh:127
int isActive()
Definition XrdCmsClientMan.hh:55
int Suspended()
Definition XrdCmsClientMan.hh:70
XrdCms::CmsRRHdr Response
Definition XrdCmsClientMan.hh:131
static const int chkVal
Definition XrdCmsClientMan.hh:102
int dally
Definition XrdCmsClientMan.hh:115
char * Host
Definition XrdCmsClientMan.hh:110
int Send(unsigned int &iMan, const struct iovec *iov, int iovcnt, int iotot=0)
int Port
Definition XrdCmsClientMan.hh:112
int manPort()
Definition XrdCmsClientMan.hh:62
int maxMsgID
Definition XrdCmsClientMan.hh:122
XrdCmsClientMan(char *host, int port, int cw, int nr, int rw, int rd)
XrdCmsClientMan * Next
Definition XrdCmsClientMan.hh:107
XrdSysMutex myData
Definition XrdCmsClientMan.hh:108
Definition XrdCmsResp.hh:124
Definition XrdInet.hh:48
Definition XrdOucBuffer.hh:55
Definition XrdOucBuffer.hh:141
Definition XrdOucErrInfo.hh:101
Definition XrdSysPthread.hh:165
Definition XrdSysPthread.hh:494
Definition YProtocol.hh:83
Definition XrdOucIOVec.hh:65