[Lldb-commits] [lldb] Fix connecting via abstract socket (PR #136466)
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Wed Apr 23 03:55:56 PDT 2025
================
@@ -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
More information about the lldb-commits
mailing list