我的印象是 boost::asio 默认会使用 epoll 设置而不是 select 实现,但是在运行了一些测试之后,我的设置看起来像是在使用 select。
操作系统:RHEL 4
内核:2.6
GCC:3.4.6
我写了一个小测试程序来验证正在使用哪个反应器头,看起来它使用的是选择反应器而不是 epoll 反应器。
#include <boost/asio.hpp>
#include <string>
#include <iostream>
std::string output;
#if defined(BOOST_ASIO_EPOLL_REACTOR_HPP)
int main(void)
{
std::cout << "you have epoll enabled." << std::endl;
}
#elif defined(BOOST_ASIO_DETAIL_SELECT_REACTOR_HPP)
int main(void)
{
std::cout << "you have select enabled." << std::endl;
}
#else
int main(void)
{
std::cout << "this shit is confusing." << std::endl;
}
#endif
我可能做错了什么?