Seems to be I have found the root of the problem. When I call MHD_get_fdset2() the values are next:
1. daemon->epoll_fd == -1 (as I said before). 2. daemon->worker_pool[0].epoll_fd == 7 (as it was set initially). Someone should fix this, because at the moment I don't know how to do this correctly. -- With Best Regards, Vitaliy V. Tokarev