在ACE_Dev_Poll_Reactor::dispatch_io_event中找到了这段:
const __uint32_t err_event = EPOLLHUP | EPOLLERR;
const ACE_HANDLE handle = this->event_.data.fd;
__uint32_t revents = this->event_.events;
// Figure out what to do first in order to make it easier to manage
// the bit twiddling and possible pfds increment before releasing
// the token for dispatch.
// Note that if there's an error (such as the handle was closed
// without being removed from the event set) the EPOLLHUP and/or
// EPOLLERR bits will be set in revents.
eh = info->event_handler;
if (ACE_BIT_ENABLED (revents, out_event))
{
disp_mask = ACE_Event_Handler::WRITE_MASK;
callback = &ACE_Event_Handler::handle_output;
ACE_CLR_BITS (revents, out_event);
}
else if (ACE_BIT_ENABLED (revents, exc_event))
{
disp_mask = ACE_Event_Handler::EXCEPT_MASK;
callback = &ACE_Event_Handler::handle_exception;
ACE_CLR_BITS (revents, exc_event);
}
else if (ACE_BIT_ENABLED (revents, in_event))
{
disp_mask = ACE_Event_Handler::READ_MASK;
callback = &ACE_Event_Handler::handle_input;
ACE_CLR_BITS (revents, in_event);
}
else if (ACE_BIT_ENABLED (revents, err_event))
{
this->remove_handler_i (handle,
ACE_Event_Handler::ALL_EVENTS_MASK,
grd,
info->event_handler);
出现 ACE_BIT_ENABLED (revents, err_event)条件为真,说明文件描述符发生错误或被挂断,但小弟不明白ACE_Dev_Poll_Reactor在什么情况下出现文件描述符发生错误,请各位高手帮忙看看,谢谢了!