Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Can we support asio transport with Asio, rather than Boost.Asio? #324

Closed
unphased opened this issue Feb 15, 2014 · 8 comments
Closed

Can we support asio transport with Asio, rather than Boost.Asio? #324

unphased opened this issue Feb 15, 2014 · 8 comments

Comments

@unphased
Copy link

As far as I can tell, Asio is actually the "real" Asio, Boost.Asio is simply the version of it packaged with Boost which has a non-header-only dependency (Boost.System).

Since we all like the cleanliness of header-only, I was wondering about how feasible it was to use Asio with websocketpp, so that we can get actual async transport for websocketpp while maintaining header-onliness.

@zaphoyd
Copy link
Owner

zaphoyd commented Feb 15, 2014

This is a feature that I have on my to-do list already. In particular it would extend the library's boost free operation on a C++11 compiler to include the Asio transport as well.

In principle it should not be difficult, however it will not be a drop in replacement as the transport code is written today. WebSocket++ Asio transport uses some additional Boost specific features not present in standalone Asio under the assumption that because it is using Boost.Asio that the rest of Boost is available as well. I need to look into how to address those specific items.

@unphased
Copy link
Author

Okay, cool. That's sort of what I had assumed simply based on the way that you refer to websocketpp's dependencies. Thanks for confirming!

In the meantime I was surprised by how easy it was to get websocketpp sample code building on OS X using Boost. The nice truth is, getting Boost to work isn't really that hard on most platforms. Still, it helps to trim things down as much as possible.

@unphased unphased reopened this Feb 15, 2014
@unphased
Copy link
Author

Mind if I leave the issue open so maybe you can report back on any progress made for this?

@zaphoyd
Copy link
Owner

zaphoyd commented Feb 15, 2014

It is even easier on Linux platforms as boost is usually one apt-get away.

Yes, go ahead and leave this open

@zaphoyd zaphoyd added this to the 0.5.0 milestone Feb 18, 2014
@zaphoyd zaphoyd removed this from the 0.5.0 milestone Jan 22, 2015
@zaphoyd
Copy link
Owner

zaphoyd commented Apr 25, 2015

This issue has been addressed on the develop branch and will be included in 0.6.0. Define ASIO_STANDALONE before any WebSocket++ header to use standalone Asio rather than boost::asio. A full C++11 compiler is required to use standalone Asio.

@zaphoyd
Copy link
Owner

zaphoyd commented Jun 2, 2015

Support for standalone Asio has been released in 0.6.0.

@zaphoyd zaphoyd closed this as completed Jun 2, 2015
@ArosPrince
Copy link

I tried using it without boost. If I define ASIO_STANDALONE I still get a boost related error at type_traits.hpp on the line 46, because WEBSOCKETPP_CPP11_TYPE_TRAITS is not defined. Should I define that one as well? BTW it would be nice to have some instructions for. The only thing I found regarding the topic is this thread and the FAQ, but those don't mention anything else apart from ASIO_STANDALONE.

And also, I saw some warning during the compilation that I should not define ASIO_STANDALONE myself...

@ceztko
Copy link

ceztko commented Mar 31, 2019

@ArosPrince

Should I define that one as well?

You probably have MSVC. C++11 detection is non functional in websocketpp using MSVC beause it relies on __cplusplus valorization which is something MSVC still doesn't do yet. Just give an hint by defining manually _WEBSOCKETPP_CPP11_STRICT_ before including anything in websocketpp.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

4 participants