1 //===-- DomainSocket.h ------------------------------------------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 #ifndef LLDB_HOST_POSIX_DOMAINSOCKET_H 10 #define LLDB_HOST_POSIX_DOMAINSOCKET_H 11 12 #include "lldb/Host/Socket.h" 13 14 namespace lldb_private { 15 class DomainSocket : public Socket { 16 public: 17 DomainSocket(bool should_close, bool child_processes_inherit); 18 19 Status Connect(llvm::StringRef name) override; 20 Status Listen(llvm::StringRef name, int backlog) override; 21 Status Accept(Socket *&socket) override; 22 23 std::string GetRemoteConnectionURI() const override; 24 25 protected: 26 DomainSocket(SocketProtocol protocol, bool child_processes_inherit); 27 28 virtual size_t GetNameOffset() const; 29 virtual void DeleteSocketFile(llvm::StringRef name); 30 std::string GetSocketName() const; 31 32 private: 33 DomainSocket(NativeSocket socket, const DomainSocket &listen_socket); 34 }; 35 } 36 37 #endif // LLDB_HOST_POSIX_DOMAINSOCKET_H 38