Re: [boost] [asio] SSL operation sporadically returns "Access is denied"

29 Sep
2006
29 Sep
'06
1:29 p.m.
Hi Chris,
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 incorrect.
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? Thanks, Scott
6829
Age (days ago)
6829
Last active (days ago)
0 comments
1 participants
participants (1)
-
Scott