|
reSIProcate/rutil
9694
|
Object-oriented wrapper for your platform's file-descriptor set. More...
#include <Socket.hxx>
Public Member Functions | |
| FdSet () | |
| int | select (struct timeval &tv) |
| int | selectMilliSeconds (unsigned long ms) |
| bool | readyToRead (Socket fd) |
| bool | readyToWrite (Socket fd) |
| bool | hasException (Socket fd) |
| void | setRead (Socket fd) |
| void | setWrite (Socket fd) |
| void | setExcept (Socket fd) |
| void | clear (Socket fd) |
| void | reset () |
Public Attributes | |
| fd_set | read |
| fd_set | write |
| fd_set | except |
| int | size |
| int | numReady |
Object-oriented wrapper for your platform's file-descriptor set.
Definition at line 121 of file Socket.hxx.
| resip::FdSet::FdSet | ( | ) | [inline] |
| void resip::FdSet::clear | ( | Socket | fd | ) | [inline] |
Definition at line 194 of file Socket.hxx.
References except, read, and write.
Referenced by resip::FdPollImplFdSet::killCache().
| bool resip::FdSet::hasException | ( | Socket | fd | ) | [inline] |
Definition at line 154 of file Socket.hxx.
References except.
Referenced by resip::FdPollImplFdSet::processFdSet().
{
return (FD_ISSET(fd,&except) != 0);
}
| bool resip::FdSet::readyToRead | ( | Socket | fd | ) | [inline] |
Definition at line 144 of file Socket.hxx.
References read.
Referenced by resip::SelectInterruptor::process(), and resip::FdPollImplFdSet::processFdSet().
{
return (FD_ISSET(fd, &read) != 0);
}
| bool resip::FdSet::readyToWrite | ( | Socket | fd | ) | [inline] |
Definition at line 149 of file Socket.hxx.
References write.
Referenced by resip::FdPollImplFdSet::processFdSet().
{
return (FD_ISSET(fd, &write) != 0);
}
| void resip::FdSet::reset | ( | ) | [inline] |
| int resip::FdSet::select | ( | struct timeval & | tv | ) | [inline] |
| int resip::FdSet::selectMilliSeconds | ( | unsigned long | ms | ) | [inline] |
Definition at line 136 of file Socket.hxx.
References select().
Referenced by stunTest(), and resip::FdPollImplFdSet::waitAndProcess().
{
struct timeval tv;
tv.tv_sec = (ms/1000);
tv.tv_usec = (ms%1000)*1000;
return select(tv);
}

| void resip::FdSet::setExcept | ( | Socket | fd | ) | [inline] |
Definition at line 182 of file Socket.hxx.
Referenced by resip::FdPollImplFdSet::addPollItem(), resip::FdPollImplFdSet::buildFdSet(), and resip::FdPollImplFdSet::modPollItem().
{
#ifndef WIN32 // windows fd are not int's and don't start at 0 - this won't work in windows
assert( fd < (int)FD_SETSIZE ); // redefinitn FD_SETSIZE will not work
#else
assert(except.fd_count < FD_SETSIZE); // Ensure there is room to add new FD
#endif
FD_SET(fd,&except);
size = ( int(fd+1) > size) ? int(fd+1) : size;
}
| void resip::FdSet::setRead | ( | Socket | fd | ) | [inline] |
Definition at line 159 of file Socket.hxx.
Referenced by resip::FdPollImplFdSet::addPollItem(), resip::SelectInterruptor::buildFdSet(), resip::FdPollImplFdSet::buildFdSet(), resip::FdPollImplFdSet::modPollItem(), and stunTest().
{
assert( FD_SETSIZE >= 8 );
#ifndef WIN32 // windows fd are not int's and don't start at 0 - this won't work in windows
assert( fd < (int)FD_SETSIZE ); // redefineing FD_SETSIZE will not work
#else
assert(read.fd_count < FD_SETSIZE); // Ensure there is room to add new FD
#endif
FD_SET(fd, &read);
size = ( int(fd+1) > size) ? int(fd+1) : size;
}
| void resip::FdSet::setWrite | ( | Socket | fd | ) | [inline] |
Definition at line 171 of file Socket.hxx.
Referenced by resip::FdPollImplFdSet::addPollItem(), resip::FdPollImplFdSet::buildFdSet(), and resip::FdPollImplFdSet::modPollItem().
{
#ifndef WIN32 // windows fd are not int's and don't start at 0 - this won't work in windows
assert( fd < (int)FD_SETSIZE ); // redefinitn FD_SETSIZE will not work
#else
assert(write.fd_count < FD_SETSIZE); // Ensure there is room to add new FD
#endif
FD_SET(fd, &write);
size = ( int(fd+1) > size) ? int(fd+1) : size;
}
| fd_set resip::FdSet::except |
Definition at line 213 of file Socket.hxx.
Referenced by clear(), FdSet(), hasException(), reset(), select(), and setExcept().
Definition at line 215 of file Socket.hxx.
| fd_set resip::FdSet::read |
Definition at line 211 of file Socket.hxx.
Referenced by resip::AresDns::buildFdSet(), resip::DnsStub::buildFdSet(), clear(), FdSet(), resip::AresDns::process(), resip::DnsStub::process(), readyToRead(), reset(), select(), and setRead().
Definition at line 214 of file Socket.hxx.
Referenced by resip::AresDns::buildFdSet(), resip::DnsStub::buildFdSet(), reset(), select(), setExcept(), setRead(), and setWrite().
| fd_set resip::FdSet::write |
Definition at line 212 of file Socket.hxx.
Referenced by resip::AresDns::buildFdSet(), resip::DnsStub::buildFdSet(), clear(), FdSet(), resip::AresDns::process(), resip::DnsStub::process(), readyToWrite(), reset(), select(), and setWrite().
1.7.5.1