I am quite new to boost asio and I am experiencing random End of File in a multi threaded server.
I could reproduce my problem in this small example:
This is a bug of boost::asio 1.54.0
I found two similar threads on the internet:
There is also a bug report here.
I installed boost 1.53 and it is now working just fine.
This issue was a regression and has been fixed in Boost 1.55: http://www.boost.org/users/history/version_1_55_0.html