[asio] Can I call socket.close() in different thread?

20 Nov
2008
20 Nov
'08
9:39 p.m.
Hi I use a thread pool to run one io_service instance, after a socket connected to a server, I want to call _socket.close() to close it. But I don't know how to do this in thread safe way. In the document, socket class is "Shared objects: Unsafe", becase I use thread pool, so I don't know which thread will call close on the socket. What should I do? Thanks, Wang Yun
5995
Age (days ago)
5995
Last active (days ago)
0 comments
1 participants
participants (1)
-
Wang Yun