setFromPath(StringPiece{path, length});
}
+ /**
+ * Construct a SocketAddress from a local unix socket path.
+ *
+ * Raises std::invalid_argument on error.
+ *
+ * @param path The Unix domain socket path.
+ */
+ static SocketAddress makeFromPath(StringPiece path) {
+ SocketAddress addr;
+ addr.setFromPath(path);
+ return addr;
+ }
+
/**
* Initialize this SocketAddress from a socket's peer address.
*
size_t hash_value(const SocketAddress& address);
std::ostream& operator<<(std::ostream& os, const SocketAddress& addr);
-}
+} // namespace folly
namespace std {
return addr.hash();
}
};
-}
+} // namespace std