
4 Nov
2008
4 Nov
'08
3:04 p.m.
That's great news. The only unsolved problem now is how to safely stop the synchronous read operation from another thread when I want to close the socket since close() or shutdown() do not seem to be thread safe yet (and as far as I know, cancel() can't be used on Windows XP).
From my experience, it's worth getting used to the asynchronous i/o. It's much more flexible (in case you need cancellations, timeouts etc.), and with asio it is also quite convenient and simple. Besides, using the asynchronous paradigm might make some of i/o threading (and locking) unnecessary, thus simplifying the overall design.