boost::asio::async_write, writing data larger than 65536 bytes

前端 未结 1 1482
鱼传尺愫
鱼传尺愫 2020-12-17 23:29

I\'m attempting to write jpeg frames via a socket to a client using async_write(). I used the boost asynchronous TCP daytime server example as a starting point.

相关标签:
1条回答
  • 2020-12-18 00:08

    An issue is that using the async_write function data will be send not immediately by the function but in some time after the start method is finished and the local message_ variable will be destroyed and the boost::asio::buffer does not copy the content of message_. It stores only a reference to it. The result is unpredictable. May be transmission of 65536 bytes is the result of this behavior.

    0 讨论(0)
提交回复
热议问题