On 06/18/2014 08:48 PM, Nicholas Yue wrote: write_msgs_.pop_front(); if (!write_msgs_.empty()) Swap these two lines; otherwise you do not write the last message.
write_msgs_.pop_front(); if (!write_msgs_.empty())