00001 #ifndef __XRD_POLLPOLL_H__ 00002 #define __XRD_POLLPOLL_H__ 00003 /******************************************************************************/ 00004 /* */ 00005 /* X r d P o l l P o l l . h h */ 00006 /* */ 00007 /* (c) 2004 by the Board of Trustees of the Leland Stanford, Jr., University */ 00008 /* All Rights Reserved. See XrdInfo.cc for complete License Terms */ 00009 /* Produced by Andrew Hanushevsky for Stanford University under contract */ 00010 /* DE-AC03-76-SFO0515 with the Department of Energy */ 00011 /******************************************************************************/ 00012 00013 // $Id: XrdPollPoll.hh 22437 2008-03-04 14:35:16Z rdm $ 00014 00015 #include <poll.h> 00016 00017 #include "Xrd/XrdPoll.hh" 00018 00019 class XrdLink; 00020 00021 class XrdPollPoll : XrdPoll 00022 { 00023 public: 00024 00025 void Detach(XrdLink *lp); 00026 00027 void Disable(XrdLink *lp, const char *etxt=0); 00028 00029 int Enable(XrdLink *lp); 00030 00031 void Start(XrdSysSemaphore *syncp, int &rc); 00032 00033 XrdPollPoll(struct pollfd *pp, int numfd); 00034 ~XrdPollPoll(); 00035 00036 protected: 00037 void doDetach(int pti); 00038 void Exclude(XrdLink *lp); 00039 int Include(XrdLink *lp); 00040 00041 private: 00042 00043 void doRequests(int maxreq); 00044 void dqLink(XrdLink *lp); 00045 void LogEvent(int req, int pollfd, int cmdfd); 00046 void Recover(int numleft); 00047 void Restart(int ecode); 00048 00049 struct pollfd *PollTab; //<--- 00050 int PollTNum; // PollMutex protects these elements 00051 XrdLink *PollQ; //<--- 00052 XrdSysMutex PollMutex; 00053 int maxent; 00054 }; 00055 #endif