Boost
C++ Libraries
...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
This is an older version of Boost and was released in 2013. The current version is 1.89.0.
Boost.Asio includes classes that implement iostreams on top of sockets. These hide away the complexities associated with endpoint resolution, protocol independence, etc. To create a connection one might simply write:
ip::tcp::iostream stream("www.boost.org", "http"); if (!stream) { // Can't connect. }
The iostream class can also be used in conjunction with an acceptor to create simple servers. For example:
io_service ios; ip::tcp::endpoint endpoint(tcp::v4(), 80); ip::tcp::acceptor acceptor(ios, endpoint); for (;;) { ip::tcp::iostream stream; acceptor.accept(*stream.rdbuf()); ... }
ip::tcp::iostream, basic_socket_iostream, iostreams examples.
These iostream templates only support char,
not wchar_t, and do not perform
any code conversion.