Boost.Asio async_send question

后端 未结 7 1935
半阙折子戏
半阙折子戏 2021-01-05 14:14

I\'m using Boost.Asio for a server application that I\'m writing.

async_send requires the caller to keep ownership of the data that is being sent until

7条回答
  •  逝去的感伤
    2021-01-05 15:07

    Krit explained the data corruption, so I'll give you an implementation suggestion instead.

    I would suggest that you use a separate vector for each send operation that is currently being executed. You probably don't want one for each connection since you might want to send several messages on the same connection sequentially without waiting for completion of the previous ones.

提交回复
热议问题