I have an io_context that is run by multiple threads. I'm using sockets and timers. I know that I need to wrap all async_writes by a strand to prevent concurrent writes to the socket.
But can two threads concurrently access the socket to issue an async_read and an async_write at the same time?
Or what about shutdown() or close() being called while another thread calls async_read? Or cancel() on a timer?
Do I need to protect the socket/timer with a mutex or strand in this cases?