#include <XrdPoll.hh>
|
static const char * | TraceID = "Poll" |
|
Definition at line 40 of file XrdPoll.hh.
◆ XrdPoll::PipeData.Parms
union XrdPoll::PipeData.Parms |
◆ XrdPoll::PipeData.Parms.Arg
struct XrdPoll::PipeData.Parms.Arg |
Definition at line 120 of file XrdPoll.hh.
Class Members |
int |
ent |
|
int |
fd |
|
◆ XrdPoll()
◆ ~XrdPoll()
virtual XrdPoll::~XrdPoll |
( |
| ) |
|
|
inlinevirtual |
◆ Attach()
◆ Detach()
Definition at line 177 of file XrdPoll.cc.
183 if (!(pp = pInfo.
Poller))
return;
192 if (!pp->numAttached)
193 {
Log.
Emsg(
"Poll",
"Underflow detaching", pInfo.
Link.
ID); abort();}
196 TRACEI(POLL,
"FD " <<pInfo.
FD <<
" detached from poller " <<pp->
PID
197 <<
"; num=" <<pp->numAttached);
char * ID
Pointer to the client's link identity.
virtual void Exclude(XrdPollInfo &pInfo)=0
References XrdSysError::Emsg(), Exclude(), XrdPollInfo::FD, XrdLink::ID, XrdPollInfo::Link, XrdGlobal::Log, PID, XrdPollInfo::Poller, and TRACEI.
Referenced by XrdLinkXeq::Close().
◆ Disable()
virtual void XrdPoll::Disable |
( |
XrdPollInfo & |
pInfo, |
|
|
const char * |
etxt = 0 |
|
) |
| |
|
pure virtual |
◆ Enable()
◆ Exclude()
◆ Finish()
int XrdPoll::Finish |
( |
XrdPollInfo & |
pInfo, |
|
|
const char * |
etxt = 0 |
|
) |
| |
|
static |
Definition at line 204 of file XrdPoll.cc.
211 {
TRACEI(POLL,
"Link " <<pInfo.
FD <<
" already terminating; "
212 <<(etxt ? etxt :
"") <<
" request ignored.");
219 if (!etxt) etxt =
"reason unknown";
221 TRACEI(POLL,
"Link " <<pInfo.
FD <<
" terminating: " <<etxt);
XrdProtocol * setProtocol(XrdProtocol *pp, bool runit=false, bool push=false)
int setEtext(const char *text)
XrdProtocol * getProtocol()
Obtain current protocol object pointer.
References XrdPollInfo::FD, XrdLink::getProtocol(), XrdPollInfo::Link, XrdLink::setEtext(), XrdLink::setProtocol(), and TRACEI.
Referenced by XrdPollE::Disable(), XrdPollPoll::Disable(), XrdPollE::Start(), and XrdPollPoll::Start().
◆ getRequest()
int XrdPoll::getRequest |
( |
| ) |
|
|
protected |
Definition at line 232 of file XrdPoll.cc.
246 while(rc < 0 && (errno == EAGAIN || errno == EINTR));
247 if (rc < 1)
return 0;
253 while(rlen < 0 && errno == EINTR);
255 {
if (rlen)
Log.
Emsg(
"Poll", errno,
"read from request pipe");
264 TRACE(POLL,
"Poller " <<
PID <<
" still needs " <<
PipeBlen <<
" req pipe bytes");
ssize_t read(int fildes, void *buf, size_t nbyte)
References XrdSysError::Emsg(), XrdGlobal::Log, read(), and TRACE.
◆ Include()
◆ newPoller()
XrdPoll * XrdPoll::newPoller |
( |
int |
pollid, |
|
|
int |
numfd |
|
) |
| |
|
staticprotected |
Definition at line 45 of file XrdPollE.icc.
47 int pfd, wfd, bytes, alignment, pagsz = getpagesize();
48 struct epoll_event *pp;
53 if ((pfd = epoll_create(maxfd)) >= 0)
fcntl(pfd, F_SETFD, FD_CLOEXEC);
56 if ((pfd = epoll_create1(EPOLL_CLOEXEC)) < 0)
58 {
Log.
Emsg(
"Poll", errno,
"create epoll device");
return 0;}
60 if ((wfd = eventfd(0, EFD_CLOEXEC)) < 0)
62 "create an eventfd as the wait-poller descriptor");
69 bytes = maxfd *
sizeof(
struct epoll_event);
70 alignment = (bytes < pagsz ? 1024 : pagsz);
71 if (posix_memalign((
void **)&pp, alignment, bytes))
72 {
Log.
Emsg(
"Poll", ENOMEM,
"create poll table");
80 memset((
void *)pp, 0, bytes);
int fcntl(int fd, int cmd,...)
References close, XrdSysError::Emsg(), fcntl(), and XrdGlobal::Log.
◆ Poll2Text()
char * XrdPoll::Poll2Text |
( |
short |
events | ) |
|
|
static |
◆ Setup()
int XrdPoll::Setup |
( |
int |
numfd | ) |
|
|
static |
Definition at line 291 of file XrdPoll.cc.
311 TRACE(POLL,
"Starting poller " <<i);
314 {
Log.
Emsg(
"Poll", retc,
"create poller thread");
return 0;}
316 PArg.PollSync.Wait();
318 {
Log.
Emsg(
"Poll", PArg.retcode,
"start poller");
void * XrdStartPolling(void *parg)
#define XRDSYSTHREAD_BIND
static XrdPoll * newPoller(int pollid, int numfd)
static int Run(pthread_t *, void *(*proc)(void *), void *arg, int opts=0, const char *desc=0)
References XrdSysError::Emsg(), XrdGlobal::Log, XrdPollArg::Poller, XrdPollArg::retcode, XrdSysThread::Run(), TRACE, XRD_NUMPOLLERS, XrdStartPolling(), and XRDSYSTHREAD_BIND.
◆ Start()
◆ Stats()
int XrdPoll::Stats |
( |
char * |
buff, |
|
|
int |
blen, |
|
|
int |
do_sync = 0 |
|
) |
| |
|
static |
Definition at line 332 of file XrdPoll.cc.
334 static const char statfmt[] =
"<stats id=\"poll\"><att>%d</att>"
335 "<en>%d</en><ev>%d</ev><int>%d</int></stats>";
336 int i, numatt = 0, numen = 0, numev = 0, numint = 0;
349 numatt += pp->numAttached;
357 return snprintf(buff, blen, statfmt, numatt, numen, numev, numint);
References numEnabled, numEvents, numInterrupts, and XRD_NUMPOLLERS.
◆ CmdFD
◆ numEnabled
◆ numEvents
◆ numInterrupts
int XrdPoll::numInterrupts |
|
protected |
◆ PID
◆ PipeBlen
◆ PipeBuff
◆ PipePoll
struct pollfd XrdPoll::PipePoll |
|
protected |
◆ Pollers
XrdPoll * XrdPoll::Pollers = {0, 0, 0} |
|
static |
◆ PollPipe
◆ ReqBuff
◆ ReqFD
◆ TID
◆ TraceID
const char * XrdPoll::TraceID = "Poll" |
|
staticprotected |
The documentation for this class was generated from the following files: