It has come to my attention that th boost websocket makes no guarantees about the order in which it sends messages dispatched using async_write.
As a result in order to guarantee that the server receives messages in the order that we dispatch them we should introduce a write queue onto which messages are pushed and from which they are drawn.
Implementation
For the queue a std:: dqeue is likely the best option.
Write should be modified to call this and we should implement an on_write method to read from the queue until it is empty.
Overview
It has come to my attention that th boost websocket makes no guarantees about the order in which it sends messages dispatched using
async_write
. As a result in order to guarantee that the server receives messages in the order that we dispatch them we should introduce a write queue onto which messages are pushed and from which they are drawn.Implementation
For the queue a
std:: dqeue
is likely the best option. Write should be modified to call this and we should implement anon_write
method to read from the queue until it is empty.