================
@@ -31,8 +31,11 @@ class DomainSocket : public Socket {
 
   std::vector<std::string> GetListeningConnectionURI() const override;
 
+  static Socket *Create(NativeSocket sockfd, bool should_close, Status &error);
----------------
labath wrote:

I have a bit of a problem with this name because, while it does create a new 
`Socket` object, it doesn't actually create a new socket os entity (which makes 
it different from say `Socket::Create`).
Another issue is that this only works on sockets that have been bound to an 
address already (which is enough for this use case, but it's another 
distinguishing feature).

With that in mind (and combining this with some interface modernizations). I'd 
propose an interface like:
```
static llvm::Expected<std::unique_ptr<DomainSocket>>
FromBoundNativeSocket(NativeSocket sockfd, bool should_close /*only if it's 
really necessary*/);
```

https://github.com/llvm/llvm-project/pull/136466
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to