1 #ifndef XRC_INPUTBUFFER_H
2 #define XRC_INPUTBUFFER_H
43 #include "XrdSys/XrdSysPthread.hh"
44 #include "XrdSys/XrdSysSemWait.hh"
45 #include "XrdOuc/XrdOucHash.hh"
50 class XrdClientInputBuffer {
54 XrdClientVector<XrdClientMessage*> fMsgQue;
57 XrdSysRecMutex fMutex;
59 XrdOucHash<XrdSysSemWait> fSyncobjRepo;
65 XrdSysSemWait *GetSyncObjOrMakeOne(
int streamid);
67 int MsgForStreamidCnt(
int streamid);
70 XrdClientInputBuffer();
71 ~XrdClientInputBuffer();
73 inline bool IsMexEmpty() {
return (MexSize() == 0); }
74 inline bool IsSemEmpty() {
return (SemSize() == 0); }
75 inline int MexSize() {
76 XrdSysMutexHelper mtx(fMutex);
77 return fMsgQue.GetSize();
79 int PutMsg(XrdClientMessage *msg);
80 inline int SemSize() {
81 XrdSysMutexHelper mtx(fMutex);
82 return fSyncobjRepo.Num();
85 int WipeStreamid(
int streamid);
87 XrdClientMessage *GetMsg(
int streamid,
int secstimeout);