#include "endpoint_description.h" #include #include namespace bts { namespace qbus { std::string endpoint_description(boost::asio::ip::tcp::endpoint const&ep) { try { return (boost::format ("%s:%d") % ep.address ().to_string () % ep.port()).str(); } catch (boost::system::system_error &) { return ""; } } std::string local_endpoint_description(boost::asio::ip::tcp::socket const&s) { try { return endpoint_description(s.local_endpoint()); } catch (boost::system::system_error &) { return ""; } } std::string remote_endpoint_description(boost::asio::ip::tcp::socket const&s) { try { return endpoint_description(s.remote_endpoint()); } catch (boost::system::system_error &) { return ""; } } }}