LLDB mainline
DomainSocket.h
Go to the documentation of this file.
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#include <string>
14#include <vector>
15
16namespace lldb_private {
17class DomainSocket : public Socket {
18public:
19 DomainSocket(NativeSocket socket, bool should_close);
20 explicit DomainSocket(bool should_close);
21
22 Status Connect(llvm::StringRef name) override;
23 Status Listen(llvm::StringRef name, int backlog) override;
24
25 using Socket::Accept;
26 llvm::Expected<std::vector<MainLoopBase::ReadHandleUP>>
27 Accept(MainLoopBase &loop,
28 std::function<void(std::unique_ptr<Socket> socket)> sock_cb) override;
29
30 std::string GetRemoteConnectionURI() const override;
31
32 std::vector<std::string> GetListeningConnectionURI() const override;
33
34protected:
36
37 virtual size_t GetNameOffset() const;
38 virtual void DeleteSocketFile(llvm::StringRef name);
39 std::string GetSocketName() const;
40
41private:
42 DomainSocket(NativeSocket socket, const DomainSocket &listen_socket);
43};
44}
45
46#endif // LLDB_HOST_POSIX_DOMAINSOCKET_H
Status Listen(llvm::StringRef name, int backlog) override
llvm::Expected< std::vector< MainLoopBase::ReadHandleUP > > Accept(MainLoopBase &loop, std::function< void(std::unique_ptr< Socket > socket)> sock_cb) override
virtual size_t GetNameOffset() const
virtual void DeleteSocketFile(llvm::StringRef name)
Status Connect(llvm::StringRef name) override
std::string GetSocketName() const
std::string GetRemoteConnectionURI() const override
std::vector< std::string > GetListeningConnectionURI() const override
virtual llvm::Expected< std::vector< MainLoopBase::ReadHandleUP > > Accept(MainLoopBase &loop, std::function< void(std::unique_ptr< Socket > socket)> sock_cb)=0
An error handling class.
Definition: Status.h:115
A class that represents a running process on the host machine.
int NativeSocket
Definition: Socket.h:41