Book Image

Boost.Asio C++ Network Programming Cookbook

By : Dmytro Radchuk
Book Image

Boost.Asio C++ Network Programming Cookbook

By: Dmytro Radchuk

Overview of this book

Starting with recipes demonstrating the execution of basic Boost.Asio operations, the book goes on to provide ready-to-use implementations of client and server applications from simple synchronous ones to powerful multithreaded scalable solutions. Finally, you are presented with advanced topics such as implementing a chat application, implementing an HTTP client, and adding SSL support. All the samples presented in the book are ready to be used in real projects just out of the box. As well as excellent practical examples, the book also includes extended supportive theoretical material on distributed application design and construction.
Table of Contents (13 chapters)
Boost.Asio C++ Network Programming Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Chapter 2. I/O Operations

In this chapter, we will cover the following recipes:

  • Using fixed length I/O buffers

  • Using extensible stream-oriented I/O buffers

  • Writing to a TCP socket synchronously

  • Reading from a TCP socket synchronously

  • Writing to a TCP socket asynchronously

  • Reading from a TCP socket asynchronously

  • Canceling asynchronous operations

  • Shutting down and closing a socket