According to the MSDN doc for closesocket:
"A Winsock client must never issue closesocket on s concurrently with another Winsock function call."
For example, what happens if an IO completion thread detects an error and closes the socket:
client_socket_.lowest_layer().close(ec);
while concurrently another thread is about to call:
async_write(client_socket_,...)
Could both of these calls hit their underlying closesocket() and WSASend() APIs, thus causing a potential crash?
I've seen these types of crashes in ordinary C++, but wasn't sure if Boost C++ had some kind of builtin mechanism to prevent it? If not, then do these calls require a scoped locked mutex etc.,..
Thanks.