Skip to content

Instantly share code, notes, and snippets.

@rightfold
Created September 17, 2014 17:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rightfold/9152ad29eefbba087c9c to your computer and use it in GitHub Desktop.
Save rightfold/9152ad29eefbba087c9c to your computer and use it in GitHub Desktop.
#pragma once
#include <boost/asio.hpp>
#include <sol.hpp>
namespace asio_sol {
void install_io_service(sol::state& lua) {
sol::userdata<boost::asio::io_service> io_service(
"io_service",
"run", [] (boost::asio::io_service& s) { s.run(); }
);
auto asio = lua["asio"].get<sol::table>();
asio.set_userdata(io_service);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment