Jump to ratings and reviews
Rate this book

Boost.Asio C++ Network Programming

Rate this book

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.

Approach

What you want is an easy level of abstraction, which is just what this book provides in conjunction with Boost.Asio. Switching to Boost.Asio is just a few extra #include directives away, with the help of this practical and engaging guide.

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.

200 pages, Paperback

First published January 1, 2013

5 people are currently reading
24 people want to read

About the author

Wisnu Anggoro

4 books1 follower

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
10 (41%)
4 stars
8 (33%)
3 stars
3 (12%)
2 stars
2 (8%)
1 star
1 (4%)
Displaying 1 - 6 of 6 reviews
Profile Image for Brian Salehi.
48 reviews9 followers
April 18, 2021
Don't get me wrong, that one star is the least rate I can give, and that only one star goes to the last chapter, seven, which gives a good overview of working with gdb which is totally irrelevant to the title of the book.
The code sample is messy and explanations are not comprehensive.
The writer is struggling to explain something new to the reader and he fails, while the whole book is as simple as 30 lines of code.
What makes teaching this topic challenging is that every detail needs deep explanations, e.g. threads, mutex, asynchronous processing and network socket interface.
I will update this review and suggest better resources for reading Boost. Asio.
1 review
March 17, 2013
Assynchronous programming is now becoming a must and apparently all languages are creating resources to make such programming paradigm easier or, at least, less hard.

In C++, the standard and multiplatform approach is to use Boost.Asio, which is detailed in the book.

What can I say? Most of the book deals with an advanced topic, so I consider this book good to those with a good background in C++ but without a background in Asio and asynchronous programming.

The pros I see on the book:

It has many code samples, some of which we can say are fully working applications;
It present both synchronous and as\synchronous examples of Asio (I consider it strange that Asio has synchronous functions but, as it has, the book does a good thing by presenting them);
It shows and explains how asynchronous code can be served by a single thread or by many threads;
It presents how the Asio is not limited to networking (even if that it's main use).
The cons I see on the book

Nothing is perfect... or, at least, it is hard to find something that two persons will agree as being "perfect". To me, the weak points are:

The book apparently tries to show how easy Asio is, which seems something beginners could use. Asio can be easier than other asynchronous libraries, but it is still not something we expect beginners to use;
I think the timeout examples are a bit misleading, as timeouts are not expected to be very short and because in the examples they are not destroyed when the action finishes on time, they will simple run later and do nothing;
I would prefer less advanced topics and more on co-routines, as I know that co-routines can make asynchronous programming really easier, but the topic was too short on the book.
As I said, it is hard to agree in what is good or not.

I consider this a good book even if I disagree on some points. I can say that it is a 8 out of 10 for me.
13 reviews
July 9, 2013
I have been working in game development for a while now and the longer I work the more I feel like knowing more about network development specifically in games and similar application. I have read a lot about network programming and this laid a great foundation for reading this book. You can use Boost.Asio to write client code as well as server code, it makes it a lot easier than writing your own TCP and UDP libraries.

The book is well organized with a great introduction to the basics of synchronous and asynchronous networking although if you don't know your way around TCP and UDP you might want to do some extra reading before picking up this book. Boost.Asio C++ Network Programming does have a good introduction to how to use the Boost.Asio libraries.

The installation of Boost.Asio is not covered at all but you can find a good guide online by just searching for it.

The book covers the use of Boost.Asio in great detail from a small "hello world" equivalent for network programmers showing synchronous and asynchronous implementations for it. The examples of more complex code is quite interesting and can easily be adapted for future use in your own projects.

There is a very small section on SSL but if are familiar with the principals it you can see how everything fit together.

I recommend this book as a guide to using Boost.Asio but if you are new to network programming in general this book is not for you.
Profile Image for Brian Salehi.
19 reviews2 followers
September 24, 2023
This is the least I can rate this book.
There are so many things wrong with this book I can't even explain properly. Bad code, wrong implementations, misleading explanations, off topic chapters, impractical examples, deprecated libraries.
Just don't read this book. Read the Boost manual. https://boost.org
Profile Image for Mishal Shah.
1 review58 followers
September 8, 2020
Covers a good introduction about Boost and is filled with examples to get hands-on experience!
Displaying 1 - 6 of 6 reviews

Can't find what you're looking for?

Get help and learn more about the design.