| 336 | } |
| 337 | |
| 338 | bool CEpoll::_ModifyEvent(base::CMemSharePtr<CEventHandler>& event, int32_t event_flag, uint64_t sock) { |
| 339 | epoll_event* content = (epoll_event*)event->_data; |
| 340 | content->events |= event_flag|EPOLLET; |
| 341 | content->data.ptr = (void*)&event->_client_socket; |
| 342 | int res = epoll_ctl(_epoll_handler, EPOLL_CTL_MOD, sock, content); |
| 343 | if (res == -1) { |
| 344 | if (errno == ENOENT) { |
| 345 | res = epoll_ctl(_epoll_handler, EPOLL_CTL_ADD, sock, content); |
| 346 | } |
| 347 | if (res == -1) { |
| 348 | base::LOG_ERROR("modify event to epoll faild! error :%d, sock: %d", errno, sock); |
| 349 | return false; |
| 350 | } |
| 351 | } |
| 352 | base::LOG_DEBUG("modify a event to epoll, event flag: %d, sock : %d", event->_event_flag_set, sock); |
| 353 | return true; |
| 354 | } |
| 355 | |
| 356 | bool CEpoll::_ResetOneShot(base::CMemSharePtr<CEventHandler>& event, int32_t event_flag, uint64_t sock) { |
| 357 | // if per epoll handle, do nothing. |
nothing calls this directly
no outgoing calls
no test coverage detected