util, transport: add configuration file support and make default unix socket configurable
add sample library configuration file
refs: #1364
Change-Id: I3cb36d078aa3f0b0a50d9a83a521e95448df0a93
diff --git a/src/transport/transport.hpp b/src/transport/transport.hpp
index da06da4..e678491 100644
--- a/src/transport/transport.hpp
+++ b/src/transport/transport.hpp
@@ -14,7 +14,12 @@
class Transport {
public:
- struct Error : public std::runtime_error { inline Error(const boost::system::error_code &code, const std::string &msg); };
+ class Error : public std::runtime_error
+ {
+ public:
+ inline Error(const boost::system::error_code &code, const std::string &msg);
+ inline Error(const std::string& msg);
+ };
typedef ptr_lib::function<void (const Block &wire)> ReceiveCallback;
typedef ptr_lib::function<void ()> ErrorCallback;
@@ -89,12 +94,19 @@
{
}
-inline Transport::Error::Error(const boost::system::error_code& code, const std::string& msg)
+inline
+Transport::Error::Error(const boost::system::error_code& code, const std::string& msg)
: std::runtime_error(msg + (code.value() ? " (" + code.category().message(code.value()) + ")" : ""))
{
}
inline
+Transport::Error::Error(const std::string& msg)
+ : std::runtime_error(msg)
+{
+}
+
+inline
Transport::~Transport()
{
}