Free Sample
+ Collection

Boost.Asio C++ Network Programming

John Torjo

Enhance your skills with practical examples for C++ network programming
RRP $21.99
RRP $34.99
Print + eBook

Want this title & more?

$12.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781782163268
Paperback156 pages

About This Book

  • Augment your C++ network programming using Boost.Asio
  • Discover how Boost.Asio handles synchronous and asynchronous programming models
  • Practical examples of client/server applications
  • Learn how to deal with threading when writing network applications
  • Harness the power of Boost with plenty of examples that you can build upon

Who This Book Is For

This book is great for developers that need to do network programming, who don’t want to delve into the complicated issues of a raw networking API. You should be familiar with core Boost concepts, such as smart pointers and shared_from_this, resource classes (noncopyable), functors and boost::bind, boost mutexes, and the boost date/time library. Readers should also be familiar with “blocking” versus “non-blocking” operations.

Table of Contents

Chapter 1: Getting Started with Boost.Asio
What is Boost.Asio?
Synchronous versus asynchronous
Exceptions versus error codes
Threading in Boost.Asio
Not just networking
The io_service class
Chapter 2: Boost.Asio Fundamentals
The Network API
Asynchronous programming
Staying alive
Chapter 3: Echo Server/Clients
TCP Echo server/clients
UDP Echo server/clients
Chapter 4: Client and Server
The synchronous client/server
The asynchronous client/server
Chapter 5: Synchronous Versus Asynchronous
Mixing synchronous and asynchronous programming
Passing client to server messages and vice versa
Synchronous I/O in client applications
Synchronous I/O in server applications
Asynchronous I/O in client applications
Asynchronous I/O in server applications
Asynchronous operations
Implementing proxies
Chapter 6: Boost.Asio – Other Features
std streams and std buffer I/O
Chapter 7: Boost.Asio – Advanced Topics
Asio versus Boost.Asio
Boost.Asio Windows features
Boost.Asio POSIX features

What You Will Learn

  • How to easily reference Boost.Asio programming
  • Synchronous versus asynchronous using Boost.Asio
  • How threading affects programming using Boost.Asio
  • Create your own echo client and server
  • More examples of client/server applications, both synchronous and asynchronous
  • Implement your own asynchronous operations
  • Co-routines: asynchronous operations with a synchronous feel
  • Use Boost.Asio for SSL Networking
  • Debug Boost.Asio
  • Use Boost.Asio for more than just networking


In Detail

Network programming is not new and it’s no secret that it’s not an easy task. Boost.Asio provides an excellent level of abstraction, making sure that with a minimal amount of coding you can create beautiful client/server applications, and have fun in the process!

'Boost.Asio C++ Network Programming" shows how to build client/server applications using a library that is part of the popular peer-reviewed Boost C++ Libraries. It analyzes whether you should go synchronous or asynchronous and the role that threading plays, whilst providing examples you can run and extend for yourself.

After covering the fundamentals of Boost.Asio you’ll discover how you can build synchronous and asynchronous clients and servers. You will also see how you can have your own asynchronous functions play nice with Boost.Asio. As a bonus, we will introduce co-routines, which make asynchronous programming a piece of cake. Nowadays, network programming is a must, no matter what type of programmer you are. "Boost.Asio C++ Network Programming" shows just how simple networking can be, if you’re using the right tools.


Read More

Recommended for You