Loading...
Searching...
No Matches
XrdCmsClientMsg Class Reference

`#include <XrdCmsClientMsg.hh>`

Collaboration diagram for XrdCmsClientMsg:

## Public Member Functions

| XrdCmsClientMsg ()
| ~XrdCmsClientMsg ()
int | getResult ()
int | ID ()
void | Lock ()
void | Recycle ()
void | UnLock ()
int | Wait4Reply (int wtime)

## Static Public Member Functions

static XrdCmsClientMsg * | Alloc (XrdOucErrInfo *erp)
static int | Init ()
static int | inQ ()
static int | Reply (const char *Man, XrdCms::CmsRRHdr &hdr, XrdOucBuffer *buff)

## Detailed Description

Definition at line 40 of file XrdCmsClientMsg.hh.

## Constructor & Destructor Documentation

## XrdCmsClientMsg()

XrdCmsClientMsg::XrdCmsClientMsg | ( |  | ) |

inline

Definition at line 64 of file XrdCmsClientMsg.hh.

: Hold(0) {next = 0; inwaitq = 0; Resp = 0; Result = 0;}

Referenced by Alloc(), Init(), and Reply().

Here is the caller graph for this function:

## ~XrdCmsClientMsg()

XrdCmsClientMsg::~XrdCmsClientMsg | ( |  | ) |

inline

Definition at line 65 of file XrdCmsClientMsg.hh.

{}

## Member Function Documentation

## Alloc()

XrdCmsClientMsg * XrdCmsClientMsg::Alloc | ( | XrdOucErrInfo * | erp | ) |

static

Definition at line 60 of file XrdCmsClientMsg.cc.

{
XrdCmsClientMsg *mp;
int lclid;
// Allocate a message object
//
FreeMsgQ.Lock();
if (nextfree) {mp = nextfree; nextfree = mp->next;}
else {FreeMsgQ.UnLock(); return (XrdCmsClientMsg *)0;}
lclid = nextid = (nextid + MidIncr) & IncMask;
numinQ++;
FreeMsgQ.UnLock();
// Initialize it
//
mp->Hold.Lock();
mp->id = (mp->id & MidMask) | lclid;
mp->Resp = erp;
mp->next = 0;
mp->inwaitq = 1;
// Return the message object
//
return mp;
}
XrdCmsClientMsg::XrdCmsClientMsg
XrdCmsClientMsg()
Definition XrdCmsClientMsg.hh:64
XrdSysCondVar::Lock
void Lock()
Definition XrdSysPthread.hh:82

References XrdCmsClientMsg(), and XrdSysCondVar::Lock().

Here is the call graph for this function:

## getResult()

int XrdCmsClientMsg::getResult | ( |  | ) |

inline

Definition at line 46 of file XrdCmsClientMsg.hh.

{return Result;}

## ID()

int XrdCmsClientMsg::ID | ( |  | ) |

inline

Definition at line 48 of file XrdCmsClientMsg.hh.

{return id;}

## Init()

int XrdCmsClientMsg::Init | ( |  | ) |

static

Definition at line 91 of file XrdCmsClientMsg.cc.

{
int i;
XrdCmsClientMsg *msgp;
// Allocate the fixed number of msg blocks. These will never be freed!
//
if (!(msgp = new XrdCmsClientMsg[MaxMsgs]())) return 1;
msgTab = &msgp[0];
nextid = MaxMsgs;
// Place all of the msg blocks on the free list
//
for (i = 0; i < MaxMsgs; i++)
{msgp->next = nextfree; nextfree = msgp; msgp->id = i; msgp++;}
// All done
//
return 0;
}

References XrdCmsClientMsg().

Referenced by XrdCmsClientConfig::Configure().

Here is the call graph for this function:
Here is the caller graph for this function:

## inQ()

int XrdCmsClientMsg::inQ | ( |  | ) |

inline static

Definition at line 52 of file XrdCmsClientMsg.hh.

{return numinQ;}

Referenced by XrdCmsClientMan::whatsUp().

Here is the caller graph for this function:

## Lock()

void XrdCmsClientMsg::Lock | ( |  | ) |

inline

Definition at line 54 of file XrdCmsClientMsg.hh.

{Hold.Lock();}

## Recycle()

void XrdCmsClientMsg::Recycle | ( |  | ) |

Definition at line 118 of file XrdCmsClientMsg.cc.

{
static XrdOucErrInfo dummyResp;
// Remove this from he wait queue and substitute a safe resp object. We do
// this because a reply may be pending and will post when we release the lock
//
inwaitq = 0;
Resp = &dummyResp;
Hold.UnLock();
// Place message object on re-usable queue
//
FreeMsgQ.Lock();
next = nextfree;
nextfree = this;
if (numinQ >= 0) numinQ--;
FreeMsgQ.UnLock();
}

## Reply()

int XrdCmsClientMsg::Reply | ( | const char * | Man,
|  | XrdCms::CmsRRHdr & | hdr,
|  | XrdOucBuffer * | buff )

static

Definition at line 142 of file XrdCmsClientMsg.cc.

{
EPNAME("Reply")
XrdCmsClientMsg *mp;
// Find the appropriate message
//
if (!(mp = XrdCmsClientMsg::RemFromWaitQ(hdr.streamid)))
{DEBUG("to non-existent message; id=" <<hdr.streamid);
return 0;
}
// Decode the response
//
mp->Result = XrdCmsParser::Decode(Man,hdr,buff,(XrdOucErrInfo *)(mp->Resp));
// Signal a reply and return
//
mp->Hold.Signal();
mp->Hold.UnLock();
return 1;
}
DEBUG
#define DEBUG(x)
Definition XrdBwmTrace.hh:54
EPNAME
#define EPNAME(x)
Definition XrdBwmTrace.hh:56
if
if(ec< 0) ec
XrdCmsParser::Decode
static int Decode(const char *Man, XrdCms::CmsRRHdr &hdr, XrdOucBuffer *dBuff, XrdOucErrInfo *eInfo)
Definition XrdCmsParser.cc:291
XrdCms::CmsRRHdr::streamid
kXR_unt32 streamid
Definition YProtocol.hh:83

References XrdCmsClientMsg(), DEBUG, XrdCmsParser::Decode(), EPNAME, XrdSysCondVar::Signal(), XrdCms::CmsRRHdr::streamid, and XrdSysCondVar::UnLock().

Referenced by XrdCmsClientMan::Start().

Here is the call graph for this function:
Here is the caller graph for this function:

## UnLock()

void XrdCmsClientMsg::UnLock | ( |  | ) |

inline

Definition at line 60 of file XrdCmsClientMsg.hh.

{Hold.UnLock();}

## Wait4Reply()

int XrdCmsClientMsg::Wait4Reply | ( | int | wtime | ) |

inline

Definition at line 62 of file XrdCmsClientMsg.hh.

{return Hold.Wait(wtime);}

The documentation for this class was generated from the following files:

- XrdCmsClientMsg.hh
- XrdCmsClientMsg.cc