Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:48

0001 //===-- DomainSocket.h ------------------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLDB_HOST_POSIX_DOMAINSOCKET_H
0010 #define LLDB_HOST_POSIX_DOMAINSOCKET_H
0011 
0012 #include "lldb/Host/Socket.h"
0013 #include <string>
0014 #include <vector>
0015 
0016 namespace lldb_private {
0017 class DomainSocket : public Socket {
0018 public:
0019   DomainSocket(NativeSocket socket, bool should_close);
0020   explicit DomainSocket(bool should_close);
0021 
0022   Status Connect(llvm::StringRef name) override;
0023   Status Listen(llvm::StringRef name, int backlog) override;
0024 
0025   using Socket::Accept;
0026   llvm::Expected<std::vector<MainLoopBase::ReadHandleUP>>
0027   Accept(MainLoopBase &loop,
0028          std::function<void(std::unique_ptr<Socket> socket)> sock_cb) override;
0029 
0030   std::string GetRemoteConnectionURI() const override;
0031 
0032   std::vector<std::string> GetListeningConnectionURI() const override;
0033 
0034 protected:
0035   DomainSocket(SocketProtocol protocol);
0036 
0037   virtual size_t GetNameOffset() const;
0038   virtual void DeleteSocketFile(llvm::StringRef name);
0039   std::string GetSocketName() const;
0040 
0041 private:
0042   DomainSocket(NativeSocket socket, const DomainSocket &listen_socket);
0043 };
0044 }
0045 
0046 #endif // LLDB_HOST_POSIX_DOMAINSOCKET_H