Boost logo

Boost :

Subject: [boost] Networking TS + Beast, NEW Tutorials, Read this to learn std::net !!!
From: Mike (mike.dev_at_[hidden])
Date: 2019-03-15 07:24:12


> All in all nice intro, unfortunately it requires users to understand
> templates quite well, but honestly not sure if it is avoidable, with
   a
> gazillion customization points in ASIO.
   Anyone aware of a wrapper library around ASIO
   that doesn't offer all those customization points
   and maybe not the full functionality/ efficiency
   but is easier to use?

   Am 15.03.19, 01:09, Ivan Matek via Boost <boost_at_[hidden]>
   schrieb:

     Here are comments from somebody who "knows C++" but does not know a
     lot
     about NW and has read only the 1st
     <[1]https://www.boost.org/doc/libs/master/libs/beast/doc/html/beast/
     using_io/asio_refresher.html>
     page.
     // get iterators representing the range of characters in the buffer
     auto begin = range::begin(buffer.data());
     auto end = range::end(buffer.data());
     Quite a weird pattern, where buffer does not have member begin, end.
     Maybe a sentence or two describing the rationale and complexity
     would be
     nice.
     I know it is O(1), but it is weird that begin/end are called on
     pointer.
     std::size_t read_lineI am tired, but is this function O(n^2)?
     cb += bytes_transferred; // adjust the pointer and sizeI would maybe
     switch to write instead of write_some to keep the code shorter, and
     mention write_some as another option in text.
     [](error_code ec, std::size_t bytes_transferred)
     For learning purposes I would capture something in lambda by value
     and
     note that reference capture would be buggy.
     using type = std::allocator<void>;
     Personal preference: not a fan of typedefs for relatively short
     types
     used once.
     All in all nice intro, unfortunately it requires users to understand
     templates quite well, but honestly not sure if it is avoidable, with
     a
     gazillion customization points in ASIO.
     _______________________________________________
     Unsubscribe & other changes:
     [2]http://lists.boost.org/mailman/listinfo.cgi/boost

References

   1. https://www.boost.org/doc/libs/master/libs/beast/doc/html/beast/using_io/asio_refresher.html
   2. http://lists.boost.org/mailman/listinfo.cgi/boost


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk