first epoll function