Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Vendor asio #391

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Vendor asio #391

wants to merge 5 commits into from

Conversation

rpavlik
Copy link
Member

@rpavlik rpavlik commented Mar 14, 2016

Adds a new vendored-in library, ASIO - http://think-async.com/Asio/Documentation - that can be used for cross-platform networking, as well as asynchronous or synchronous serial port and other IO operations. It's a C++ standards-track library that has a good track record and adds no new dependencies, not even additional usage of Boost in its latest version (and it's header-only).

Is used in a forthcoming (1.0) change that will watch an old port and warn if anyone tries to connect to it, but I wanted to get this in and available before 1.0.

This also includes a small patch to the clang-format style so that if you update your version of clang-format you don't start mysteriously sorting includes.

rpavlik added 5 commits March 14, 2016 11:37
This got moved into the style file in new versions, and defaulted to
true, so I was getting surprised by larger than expected diffs.
Specifically, mswsock is the one containing AcceptEx for ahead-of-time
linking.
@russell-taylor
Copy link
Contributor

I worry about library creep. Both because potential users can be (incorrectly, but nonetheless) turned off when they see how many other libraries OSVR requires them to pull in and because of experience with incompatible versions and trying to track library changes. How can it take a new library to do something we were already doing?

@godbyk
Copy link
Contributor

godbyk commented Mar 14, 2016

How does this version of asio differ from the implementation in boost or the proposed implementation in the standard C++ library?

@rpavlik
Copy link
Member Author

rpavlik commented Mar 16, 2016

The version in boost is automatically generated from this version at boost release time. As far as I can tell, this is the closest code to the proposed standard.

Re: library creep, it's a vendored in header only library, so most users won't notice. If by "we were doing before" you mean in VRPN, yes, there's socket code in there, but it's not factored out to be easily reusable. Additionally, asio uses (optionally, if available on the platform at runtime) faster platform specific backend code like io completion ports on Windows. (I was actually considering seeing if I could use the existing implementation hiding in VRPN to allow an optional asio socket implementation, similar to your optional chrono time backend, and see what that did to performance and or the handshake issue)

@rpavlik
Copy link
Member Author

rpavlik commented Mar 16, 2016

(There's literally a script called boostify in the source tree. I could have used the version in boost but given the anti boost bias out there, as well as the fact that the non boost version can be vendored easier and updated faster than boost release cycles, it seemed wise to go this route instead)

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

Successfully merging this pull request may close these issues.

3 participants