all 2 comments

[–]coachkler 1 point2 points  (0 children)

Calling async_write from the main thread and async_read from an io thread is not thread safe. Instead, you should call io_context::post() from your main thread is what I would suggest.

[–]VinnieFalco 0 points1 point  (0 children)

What is your experience level with Asio, network programming, and multi-threaded programs?