I want to do asynchronous read from cin therefore I have a piece of code
client.h
...
boost::asio::posix::stream_descriptor input;
boost::asio::stre
Can you try with this minimal reproducer? It works on my Ubuntu 64-bit box:
#include
#include
#include
int main()
{
using namespace boost::asio;
io_service io;
posix::stream_descriptor input(io);
input.assign(STDIN_FILENO);
streambuf input_buffer;
std::function loop = [&] {
async_read_until(input, input_buffer, '\n', [&](boost::system::error_code ec, size_t) {
if (ec)
std::cerr << ec.message();
else {
std::cout << "LOOP: '" << &input_buffer << "'\n";
loop();
}
});
};
loop();
io.run();
}
Update I think I can reproduce the problem on Coliru: can you check the output of ulimit -a?