26 #include <QSharedPointer>
27 #include <util/constants.h>
28 #include <ktorrent_export.h>
31 #include <util/win32.h>
49 virtual int fd()
const = 0;
57 typedef QSharedPointer<PollClient> Ptr;
75 int add(
int fd,Mode mode);
78 int add(PollClient::Ptr pc);
81 int poll(
int timeout = -1);
84 bool ready(
int index,Mode mode)
const;
90 std::vector<struct pollfd> fd_vec;
91 bt::Uint32 num_sockets;
92 std::map<int,PollClient::Ptr> poll_clients;
int add(int fd, Mode mode)
Add a file descriptor to the poll (returns the index of it)
int add(PollClient::Ptr pc)
Add a poll client.
bool ready(int index, Mode mode) const
Check if a socket at an index is read.
virtual void reset()=0
Reset the client called after poll finishes.
virtual void handleData()=0
Handle data.
void reset()
Reset the poll.
virtual int fd() const =0
Get the filedescriptor to poll.
int poll(int timeout=-1)
Poll all sockets.