Hi Arpan, Read Marat's response again. The likely issue here is not epoll or asio, but rather with your code trying to use composed operations like async_write() and async_read_until() with io_service.run_one().
4. Marat's code is using io_service.run - why should I not be using run_one?
run_one() will run until the io_service is stopped (and return 0), or until at most 1 completion handler is called (and return 1). As Marat notes, async_read_until() is a composed operation - it may result in multiple async_read_some() operations internally, each with their own completion handler. Since you use run_one(), you haven't allowed async_read_until() to complete in cases in which it needs to call multiple internal handlers.
Any thoughts on debugging or setting epoll options from asio interface to see what is going on?
Use io_service.run(). You can check its return value to see how many handlers it called. Thanks, Brad