|
reSIProcate/rutil
9694
|
#include <FdPoll.hxx>

Public Member Functions | |
| FdPollGrp () | |
| virtual | ~FdPollGrp () |
| virtual const char * | getImplName () const =0 |
| virtual FdPollItemHandle | addPollItem (Socket sock, FdPollEventMask newMask, FdPollItemIf *item)=0 |
| virtual void | modPollItem (FdPollItemHandle handle, FdPollEventMask newMask)=0 |
| virtual void | delPollItem (FdPollItemHandle handle)=0 |
| virtual void | registerFdSetIOObserver (FdSetIOObserver &observer)=0 |
| virtual void | unregisterFdSetIOObserver (FdSetIOObserver &observer)=0 |
| virtual bool | waitAndProcess (int ms=0)=0 |
| Wait at most {ms} milliseconds. | |
| virtual int | getEPollFd () const |
| get the epoll-fd (epoll_create()) This is fd (type int), not Socket. | |
| virtual void | buildFdSet (FdSet &fdSet)=0 |
| virtual bool | processFdSet (FdSet &fdset)=0 |
Static Public Member Functions | |
| static FdPollGrp * | create (const char *implName=NULL) |
| factory | |
| static const char * | getImplList () |
| Return candidate impl names with vertical bar (|) between them Intended for help messages. | |
Protected Member Functions | |
| void | processItem (FdPollItemIf *item, FdPollEventMask mask) |
Definition at line 68 of file FdPoll.hxx.
| FdPollGrp::FdPollGrp | ( | ) |
Definition at line 52 of file FdPoll.cxx.
{
}
| FdPollGrp::~FdPollGrp | ( | ) | [virtual] |
Definition at line 56 of file FdPoll.cxx.
{
}
| virtual FdPollItemHandle resip::FdPollGrp::addPollItem | ( | Socket | sock, |
| FdPollEventMask | newMask, | ||
| FdPollItemIf * | item | ||
| ) | [pure virtual] |
Implemented in resip::FdPollImplFdSet.
Referenced by resip::FdPollItemBase::FdPollItemBase(), resip::AresDnsPollItem::resetPollGrp(), and resip::DnsStub::setPollGrp().
| virtual void resip::FdPollGrp::buildFdSet | ( | FdSet & | fdSet | ) | [pure virtual] |
Implemented in resip::FdPollImplFdSet.
| FdPollGrp * FdPollGrp::create | ( | const char * | implName = NULL | ) | [static] |
factory
Definition at line 873 of file FdPoll.cxx.
Referenced by resip::DnsThread::DnsThread().
{
if ( implName==0 || implName[0]==0 || strcmp(implName,"event")==0 )
implName = 0; // pick the first (best) one supported
#ifdef RESIP_POLL_IMPL_EPOLL
if ( implName==0 || strcmp(implName,"epoll")==0 )
{
return new FdPollImplEpoll();
}
#endif
if ( implName==0 || strcmp(implName,"fdset")==0 )
{
return new FdPollImplFdSet();
}
assert(0);
return NULL;
}
| virtual void resip::FdPollGrp::delPollItem | ( | FdPollItemHandle | handle | ) | [pure virtual] |
Implemented in resip::FdPollImplFdSet.
Referenced by resip::DnsStub::setPollGrp(), and resip::FdPollItemBase::~FdPollItemBase().
| int FdPollGrp::getEPollFd | ( | ) | const [virtual] |
get the epoll-fd (epoll_create()) This is fd (type int), not Socket.
It may be -1 if epoll is not enabled.
Definition at line 81 of file FdPoll.cxx.
{
return -1;
}
| const char * FdPollGrp::getImplList | ( | ) | [static] |
Return candidate impl names with vertical bar (|) between them Intended for help messages.
Definition at line 892 of file FdPoll.cxx.
{
// .kw. this isn't really scalable approach if we get a lot of impls
// but it works for now
#ifdef RESIP_POLL_IMPL_EPOLL
return "event|epoll|fdset";
#else
return "event|fdset";
#endif
}
| virtual const char* resip::FdPollGrp::getImplName | ( | ) | const [pure virtual] |
Implemented in resip::FdPollImplFdSet.
| virtual void resip::FdPollGrp::modPollItem | ( | FdPollItemHandle | handle, |
| FdPollEventMask | newMask | ||
| ) | [pure virtual] |
Implemented in resip::FdPollImplFdSet.
Referenced by resip::AresDnsPollItem::socket_poll_cb().
| virtual bool resip::FdPollGrp::processFdSet | ( | FdSet & | fdset | ) | [pure virtual] |
Implemented in resip::FdPollImplFdSet.
| void FdPollGrp::processItem | ( | FdPollItemIf * | item, |
| FdPollEventMask | mask | ||
| ) | [protected] |
Definition at line 61 of file FdPoll.cxx.
References ErrLog, and resip::FdPollItemIf::processPollEvent().
Referenced by resip::FdPollImplFdSet::processFdSet().
{
try
{
item->processPollEvent( mask );
}
catch(BaseException& e)
{
// kill it or something?
ErrLog(<<"Exception thrown for FdPollItem: " << e);
}
item = NULL; // WATCHOUT: item may have been deleted
/*
* If FPEM_Error was reported, should really make sure it was deleted
* or disabled from polling. Otherwise were in stuck in an infinite loop.
* But difficult to do that checking robustly until we serials the items.
*/
}

| virtual void resip::FdPollGrp::registerFdSetIOObserver | ( | FdSetIOObserver & | observer | ) | [pure virtual] |
Implemented in resip::FdPollImplFdSet.
Referenced by resip::AresDns::setPollGrp().
| virtual void resip::FdPollGrp::unregisterFdSetIOObserver | ( | FdSetIOObserver & | observer | ) | [pure virtual] |
Implemented in resip::FdPollImplFdSet.
Referenced by resip::AresDns::setPollGrp().
| virtual bool resip::FdPollGrp::waitAndProcess | ( | int | ms = 0 | ) | [pure virtual] |
Wait at most {ms} milliseconds.
If any file activity has already occurs or occurs before {ms} expires, then FdPollItem will be informed (via cb method) and this method will return. Returns true iff any file activity occured. ms<0: wait forever, ms=0: don't wait, ms>0: wait this long NOTE: "forever" may be a little as 60sec or as much as forever
Implemented in resip::FdPollImplFdSet.
1.7.5.1