00001 #ifndef __ODC_MANAGER__ 00002 #define __ODC_MANAGER__ 00003 /******************************************************************************/ 00004 /* */ 00005 /* X r d O d c M a n a g e r . h h */ 00006 /* */ 00007 /* (c) 2003 by the Board of Trustees of the Leland Stanford, Jr., University */ 00008 /* All Rights Reserved */ 00009 /* Produced by Andrew Hanushevsky for Stanford University under contract */ 00010 /* DE-AC03-76-SFO0515 with the Department of Energy */ 00011 /******************************************************************************/ 00012 00013 // $Id: XrdOdcManager.hh,v 1.8 2007/07/31 02:24:56 abh Exp $ 00014 00015 #include <stdio.h> 00016 #include <sys/uio.h> 00017 00018 #include "XrdOdc/XrdOdcResp.hh" 00019 #include "XrdOuc/XrdOucErrInfo.hh" 00020 #include "XrdSys/XrdSysPthread.hh" 00021 00022 class XrdSysError; 00023 class XrdSysLogger; 00024 class XrdNetLink; 00025 class XrdNetWork; 00026 00027 class XrdOdcManager 00028 { 00029 public: 00030 00031 int delayResp(XrdOucErrInfo &Resp); 00032 00033 void relayResp(int msgid, char *msg); 00034 00035 int isActive() {return Active;} 00036 00037 XrdOdcManager *nextManager() {return Next;} 00038 00039 char *Name() {return Host;} 00040 char *NPfx() {return HPfx;} 00041 00042 int Send(char *msg, int mlen=0); 00043 int Send(const struct iovec *iov, int iovcnt); 00044 00045 void setTID(pthread_t tid) {mytid = tid;} 00046 00047 void *Start(); 00048 00049 void setNext(XrdOdcManager *np) {Next = np;} 00050 00051 void whatsUp(); 00052 00053 XrdOdcManager(XrdSysError *erp, char *host, int port, 00054 int cw, int nr); 00055 ~XrdOdcManager(); 00056 00057 private: 00058 void Hookup(); 00059 void Sleep(int slpsec); 00060 char *Receive(int &msgid); 00061 00062 XrdSysSemaphore syncResp; 00063 XrdOdcRespQ RespQ; 00064 00065 XrdOdcManager *Next; 00066 XrdSysMutex myData; 00067 XrdSysError *eDest; 00068 XrdNetLink *Link; 00069 XrdNetWork *Network; 00070 char *Host; 00071 char *HPfx; 00072 int Port; 00073 pthread_t mytid; 00074 int dally; 00075 int Active; 00076 int Silent; 00077 int nrMax; 00078 int maxMsgID; 00079 }; 00080 #endif
1.7.1