++m_count_active_steps;
try {
+
+ FdSetType local_read_fds;
+ FdSetType local_write_fds;
+
// step 1 ; collect
{ // step 1.1: collect fds for read/write operations
++itIOList)
{
if (! *itIOList) continue; // skip NULL entries
- bool want_read = (*itIOList)->wantRead();
- bool want_write = (*itIOList)->wantWrite();
int read_fd = (*itIOList)->m_read_fd;
int write_fd = (*itIOList)->m_write_fd;
+ bool want_read = (read_fd >= 0) and (*itIOList)->wantRead();
+ bool want_write = (write_fd >= 0) and (*itIOList)->wantWrite();
+ if (read_fd >= 0 )
+ {
+ local_read_fds.insert( read_fd );
+ }
+ if (write_fd >= 0)
+ {
+ local_write_fds.insert( write_fd );
+ }
if (!want_read && !want_write) continue;
if (want_read)
{
io->m_marked_for_writing= true;
}
}
- if (0!= (itPollItem->revents & POLLERR))
+ if ( 0!= (itPollItem->revents & POLLERR))
{
IOImplementation *io= poll_data.m_write_fd_io_map[ itPollItem->fd ];
if (0!= (itPollItem->events & POLLOUT))
#include <string>
#include <list>
+#include <set>
#include <pointer_func.hpp>
return m_write_fd;
}
+ inline bool isMarkedForReading() const { return m_marked_for_reading; }
+ inline bool isMarkedForWriting() const { return m_marked_for_writing; }
+
protected:
virtual void doRead();
class Backend
{
public:
+ typedef std::set< int > FdSetType;
+
+ public:
bool doOneStep(int ms_timeout= -1);
void run();