xrootd
XrdPollE.hh
Go to the documentation of this file.
1 #ifndef __XRD_POLLDEV_H__
2 #define __XRD_POLLDEV_H__
3 /******************************************************************************/
4 /* */
5 /* X r d P o l l D e v . h h */
6 /* */
7 /* (c) 2004 by the Board of Trustees of the Leland Stanford, Jr., University */
8 /* All Rights Reserved. See XrdInfo.cc for complete License Terms */
9 /* Produced by Andrew Hanushevsky for Stanford University under contract */
10 /* DE-AC03-76-SFO0515 with the Department of Energy */
11 /******************************************************************************/
12 
13 // $Id$
14 
15 #include <sys/epoll.h>
16 
17 #include "Xrd/XrdPoll.hh"
18 
19 class XrdPollE : public XrdPoll
20 {
21 public:
22 
23  void Disable(XrdLink *lp, const char *etxt=0);
24 
25  int Enable(XrdLink *lp);
26 
27  void Start(XrdSysSemaphore *syncp, int &rc);
28 
29  XrdPollE(struct epoll_event *ptab, int numfd, int pfd)
30  {PollTab = ptab; PollMax = numfd; PollDfd = pfd;}
31  ~XrdPollE();
32 
33 protected:
34  void Exclude(XrdLink *lp);
35  int Include(XrdLink *lp);
36  char *x2Text(unsigned int evf);
37 
38 private:
39 void remFD(XrdLink *lp, unsigned int events);
40 
41 #ifdef EPOLLONESHOT
42  static const int ePollOneShot = EPOLLONESHOT;
43 #else
44  static const int ePollOneShot = 0;
45 #endif
46  static const int ePollEvents = EPOLLIN | EPOLLHUP | EPOLLPRI | EPOLLERR |
48 
49 struct epoll_event *PollTab;
50  int PollDfd;
51  int PollMax;
52 };
53 #endif