开发者

What is the advantage of using the mutable buffer objects in boost ASIO compared to char arrays?

开发者 https://www.devze.com 2023-01-09 13:49 出处:网络
I\'m designing/developing a UDP server application and plan to use boost. What are the mutable buffer objec开发者_Python百科ts for and what advantage is it over an standard

I'm designing/developing a UDP server application and plan to use boost. What are the mutable buffer objec开发者_Python百科ts for and what advantage is it over an standard char array?


Use fixed length buffers such as boost::array when you know a priori how much data you expect to receive or send. ASIO streambufs let you receive an unknown quantity of data. In particular, async_read_until requires you to use streambufs.

0

精彩评论

暂无评论...
验证码 换一张
取 消