POSIX poll() support

This commit is contained in:
Aleksandar Fabijanic
2012-04-28 19:07:15 +00:00
parent 5086b562fd
commit a68b9a114f
4 changed files with 248 additions and 109 deletions

View File

@@ -142,7 +142,7 @@ public:
bool poll(const Poco::Timespan& timeout, int mode) const;
/// Determines the status of the socket, using a
/// call to select().
/// call to poll() or select().
///
/// The mode argument is constructed by combining the values
/// of the SelectMode enumeration.
@@ -315,6 +315,23 @@ protected:
/// Returns the socket descriptor for this socket.
private:
#if defined(POCO_HAVE_FD_POLL)
class FDCompare
/// Utility functor used to compare socket file descriptors.
/// Used in poll() member function.
{
public:
FDCompare(int fd): _fd(fd) { }
inline bool operator()(const Socket& socket) const
{ return socket.sockfd() == _fd; }
private:
FDCompare();
int _fd;
};
#endif
SocketImpl* _pImpl;
};
@@ -604,6 +621,15 @@ inline bool Socket::supportsIPv4()
}
inline bool Socket::supportsIPv6()
{
#if defined(POCO_HAVE_IPv6)
return true;
#else
return false;
#endif
}
} } // namespace Poco::Net