37 #include <sys/types.h>
54 char *XrdFrcReqAgent::c2sFN = 0;
61 : Persona(Me),myName(
""),theQ(qVal)
70 default: pingMsg =
"!\n" ;
break;
85 else if (Request.
Prty < 0)Request.
Prty = 0;
94 rQueue[
static_cast<int>(Request.
Prty)]->
Add(&Request);
127 while(rQueue[i]->
List(myLfn,
sizeof(myLfn), Offs, Items, Num))
128 {std::cout <<myLfn <<std::endl; n++;}
146 while(rQueue[Prty]->
List(myLfn,
sizeof(myLfn), Offs, Items, Num))
147 {std::cout <<myLfn <<std::endl; n++;}
165 return rQueue[Prty]->
List(Buff, Bsz, Offs, Items, 1) != 0;
175 static int udpOK = 0;
180 if (udpOK || !
stat(c2sFN, &buf))
181 {udpMsg.
Send(Msg ? Msg : pingMsg); udpOK = 1;}
192 char buff[2048], *qPath;
198 {sprintf(buff,
"%sxfrd.udp", aPath);
199 c2sFN = strdup(buff);
212 if ((myClid = getenv(
"XRDCMSCLUSTERID")))
213 {
int Uid =
static_cast<int>(geteuid());
214 int Gid =
static_cast<int>(getegid());
215 memset(&Request, 0,
sizeof(Request));
217 sprintf(Request.
User,
"%d %d", Uid, Gid);
218 sprintf(Request.
ID,
"%d",
static_cast<int>(getpid()));
228 {sprintf(buff,
"%s%sQ.%d", qPath, Persona, i);
230 if (!rQueue[i]->Init())
return 0;
231 if (myClid) rQueue[i]->
Add(&Request);
int stat(const char *path, struct stat *buf)
void Ping(const char *Msg=0)
void Add(XrdFrcRequest &Request)
XrdFrcReqAgent(const char *Me, int qVal)
int Start(char *aPath, int aMode)
void Del(XrdFrcRequest &Request)
int List(XrdFrcRequest::Item *Items, int Num)
int NextLFN(char *Buff, int Bsz, int Prty, int &Offs)
char * List(char *Buff, int bsz, int &Offs, XrdFrcRequest::Item *ITList=0, int ITNum=0)
void Add(XrdFrcRequest *rP)
static const int Register
static char * makeQDir(const char *Path, int Mode)
int Send(const char *buff, int blen=0, const char *dest=0, int tmo=-1)
static const char * InstName(int TranOpt=0)