Jump to content
  • Advertisement
Sign in to follow this  

experience with boost::ASIO

This topic is 3947 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

While reading the Multiplayer and Network Programming FAQ, I stumbled across the existence of boost::ASIO, which I am now considering to use. Has any of you some experience with this library ? Is it worth the dive ?

Share this post


Link to post
Share on other sites
Advertisement
It's a complicated and confusing library. If you have need of asynchronous networking stuff, it's more cross-platform and easier to program than, say, IOCP. Otherwise you won't be interested.

Share this post


Link to post
Share on other sites
If you can stomach the template meta-programming (it's completely templated), then it's fine.

Also bear in mind that, while being network IO library, it's a complete asynchronous programming toolkit. All programming is based on reactor and pro-actor patterns internally, implemented with lock-less primitives. Explicit synchronization is available with software implementation of fibers (called strands).

While toying around with it, I managed to replicate the stackless Python functionality in no time. Performance-wise it's decent. While a few extra cycles could be squeezed out of it, the out-of-box implementation is essentially the same as raw IOCP, but with usual boost-like reobustness.

Due to heavy reliance on function pointers it may benefit from recently improvements to Boost, but I haven't tested that yet.

I'm also using non-boost version, which is essentially the same, but has a tad simpler namespace.

If you're comfortable with traits, and designing application solely on templated classes, then ASIO will provide just the most optimal code you can think of. You can obviously use more conservative inheritance models to wrap access.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!