From: Scott (cheesy4poofs_at_[hidden])
Date: 2006-09-29 09:29:04
> In the client, I have 2 threads. The main thread is the one
> that sends
> random messages to the server. The other thread handles all incoming
> responses and prints out the number of bytes received. Both
> threads share
> the same io_service. It is my understanding from the docs
> that multiple
> threads can all share an io_service, but please let me know
> if the code is
I started thinking about my own client code and read up on the socket class.
The docs say the socket object is unsafe for shared objects. So I put locks
around every async_read or async_write operation. However, it still fails.
Is the problem with my code the fact that 2 threads are using the same
socket? Is that just not possible?