Boost.Asio C++ Network Programming
By John Torjo
Publisher: Packt Publishing
Final Release Date: February 2013
Pages: 156

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.


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.

Product Details
Recommended for You
Customer Reviews


by PowerReviews
oreillyBoost.Asio C++ Network Programming

(based on 1 review)

Ratings Distribution

  • 5 Stars



  • 4 Stars



  • 3 Stars



  • 2 Stars



  • 1 Stars



Reviewed by 1 customer

Displaying review 1

Back to top

(1 of 1 customers found this review helpful)


It sure is fun to write networking code

By setec astronomy

from Graz, Austria

About Me Developer, Maker

Verified Reviewer


  • Helpful examples


  • Did I Mention Repetative
  • Difficult to understand
  • No Clear Didactic Concept
  • Repetitive

Best Uses

    Comments about oreilly Boost.Asio C++ Network Programming:

    At least that is the message that the author tries to convey almost on every page. Literally. And it sure as hell is complicated, because that is also frequently stated throughout the text. Not to mention confusing.

    I am halfway through with the book and I am about to give up. Having done my fair share of low-level network programming using Berkley and Winsock sockets over the years and having played a bit with asio in the past, I was just looking for a book that provides a nice, rounded introduction to boost::asio, ideally as a kind of walk-through which concentrates especially on the parts where the boost::asio online documentation falls a bit flat.

    My biggest gripe about the book is therefore the (imho) lack of a didactic concept. The author seems to have not been able to figure out whether he wanted to just flesh out some examples circulating on the internet while also providing an annotated version of the boost::asio reference or whether he wanted to aim at a proper, stand alone book. I am suspecting the latter because chapters 3 and 4 provide some value and show some thought about how to structure information to make it easier to digest for readers.

    This, however, assumes that you make it past chapter 1 (which is similar to other quick-start chapters I have read so far in that it kind of gives you an overview of the capabilities of the library without delving too much into detail but is special insofar as you have to throw the "not too much detail" part out of the window as it runs you down through the whole library, kitchen sink included) and the "it's not a reference, we call it Boost.Asio Fundamentals" chapter 2. Both chapters feel to me like copy and paste jobs from the rest of the book (chapter 1) or the boost library (chapter 2) online documentation and provide (again, imho) no value for the reader apart from building up the suspense a little before going to the "proper" programming chapters.

    This contributes to the repetitive character of the whole book and diminishes it's value as a good introductory text that can be read, ideally linearly (or, as the author would probably call it: synchronously :-) ) in one run.

    As a matter of personal taste (and because I have been told that I am making the same mistake in my technical writings): it is probably not a good idea to confront your readers with structures like

    "this is option a, which is easy but rubbish. then you have option b which is better but more complicated. But the source code looks much easier to understand than option a because I used, quite deliberately, an example involving 10 threads to compare a and b which clearly shows that b is superior. Plus at this point on page 42, I have told you about 100 times that you can do both synchronous and asynchronous implementations but not both. You still have no idea what the code I present does but I hope to have made it clear that there are essentially two options for you, right? Then there is option c which is rad and 1337 but totally complicated. have I scared you enough with this complexity? Are you prepared to delve into this solution even though it is (I have to mention it again) totally complicated? good, because we will cover it some-when later or so, let's go to something completely different now"

    (loosely paraphrased and hyperbolically written, but I hope you get my point)

    Repetitive as this review gets as well, I have to stress again that the book has some merit: The examples (and especially the example source code) provide some good starting point to understand the whole thing. Chapters 3 and 4 provide you with some additional information which is even presented somewhat accessible. And for some folks without an internet connection, Chapter 2 may even provide you with an good offline digest of the online reference.

    Personally, I found the boost::asio related questions on stack overflow and the blog post about serial interfaces by fede.tft on the internet much more helpful than this book in understanding Asio.

    Displaying review 1

    Back to top

    Buy 2 Get 1 Free Free Shipping Guarantee
    Buying Options
    Immediate Access - Go Digital what's this?
    Ebook:  $21.99
    Formats:  ePub, Mobi, PDF