I found this question which asks how to read input asynchronously, but will only work with POSIX stream descriptors, which won\'t work on Windows. So, I found this tutorial
You need to initialize your stream_handle to the console input handle. You can't use the same stream_handle for input and for output because those are two different handles.
For input:
Example()
: /* ... */ input_handle( io_service, GetStdHandle(STD_INPUT_HANDLE) )
For output you would use CONSOLE_OUTPUT_HANDLE
. But that is probably overkill, you're unlikely to be pushing that much data into stdout on windows that you'd need to use an async write.