Add readWithPriority to PriorityMPMCQueue
[folly.git] / folly / SocketAddress.h
index 31d441f7ed26e471b45efd7cc03d77f64dfb07df..21c35a0546eab2c573ebffba5a509e04dbb19e8c 100644 (file)
@@ -306,6 +306,19 @@ class SocketAddress {
     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.
    *
@@ -600,7 +613,7 @@ class SocketAddress {
 size_t hash_value(const SocketAddress& address);
 
 std::ostream& operator<<(std::ostream& os, const SocketAddress& addr);
-}
+} // namespace folly
 
 namespace std {
 
@@ -611,4 +624,4 @@ struct hash<folly::SocketAddress> {
     return addr.hash();
   }
 };
-}
+} // namespace std