use select/epoll function