/*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2014-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
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