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

Introduction

I/O operations are the key operations in the networking infrastructure of any distributed application. They are directly involved in the process of data exchange. Input operations are used to receive data from remote applications, whereas output operations allow sending data to them.

In this chapter, we will see several recipes that show how to perform I/O operations ...

Get Boost.Asio C++ Network Programming Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.