Home > Frameworks > boost::asio

boost::asio

Asio is the first BIG boost framework I encountered.  The documentation reading was fantastic, which I supplemented with some googling.  In short, Asio seems to be considered one of the very best communication library around, and it’s easy to see why.

First, it supports about every plateforms and operating systems I can think of.  It encapsulate all the best communication features from all these systems into a cohesive, single interface.  That is, when built for BSD or OS X, Asio uses kqueues; for Windows it uses Overlapped IO;  for Linux it uses epoll; etc.  The same request codes can be called in synchronous or asynchronous ways, and the later implement its own internal threading.

Asio knows a wide range of protocoles, from TCP to UDP, IPv4 and IPv6 addressing, SSL connections, etc.  It provides a timer system and a fully std::iostream compatible interface.

After learning about it, I wonder why I would ever need to use any other libraries for my communications.  It is that powerful.  And did I mentioned how simple it is to use?

Instead of coming up with a little piece of code from scratch, I toyed around with a simple source code by Richel Bilderbeek we can download HERE (for the server) and HERE (for the client).

Only a glance at the code, we see that most of the code is to handle the application specific packet format.  The actual code to setup server and client communication is merely a few lines.

Advertisements
Categories: Frameworks
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: