c++ - Boost asio async_read (async_write) wrapper -


i'm trying code wrapper on boost::asio::ip::tcp::socket

something :

class socket {   public:     void async_read(asyncreadstream & s,                                          const boost::asio::mutablebuffersequence & buffers,                        completioncondition completion_condition,                     readhandler handler) {}; }; 

so able use ssl , non-ssl stream seamlessly... thing that, not seems find definition of each parameters pass them boost::asio::async_read (namespaces, etc...)

any appreciated ! thanks

your main requirements seems "use ssl , non-ssl streams seamlessly." that, can wrap various stream types in way exposes functions need use.

part of how deciding how you're going memory management. mutablebuffersequence not type, defines set of requirements type used on context.

if going use 1 of smallish number of approaches can use them in interface (as long meets mutablebuffersequence/constbuffersequence requirements, appropriate). downside of buffer management becomes part of interface.

if want maintain asio buffer management flexibility could

  • template code on stream type in order achieve seamless ssl/non-ssl requirement.

  • create wrapper various stream types templated methods on buffer type.

(updated response; shouldn't try respond question when have less 2 minutes!)


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -