deal with poor performacne when using coroutine
fix bug
Fix: clear write buffers corresponding to error
add switch config messages
use BOOST_PP_REPEAT for message type dispatching