18 Nov
2012
18 Nov
'12
7:13 p.m.
I was curious if some boost::asio guru would mind checking this out. I just posted my code in, I'd like to know if there's anything that could be done better.
I'm not a guru, but pay attention to 2 points: 1) If _buffers container has several elements, HandleWrite() won't call Write() anymore. In other words, _writing state flag handling is incorrect: the flag should be reset unconditionally in HandleWrite(). 2) The access to _buffers container is not synchronized, so you may call Client::Write() only from the thread that executes io_service::run().