9#ifndef LLDB_HOST_SOCKET_H
10#define LLDB_HOST_SOCKET_H
67 bool child_processes_inherit,
77 static llvm::Expected<std::unique_ptr<TCPSocket>>
78 TcpListen(llvm::StringRef host_and_port,
bool child_processes_inherit,
81 static llvm::Expected<std::unique_ptr<Socket>>
82 TcpConnect(llvm::StringRef host_and_port,
bool child_processes_inherit);
84 static llvm::Expected<std::unique_ptr<UDPSocket>>
85 UdpConnect(llvm::StringRef host_and_port,
bool child_processes_inherit);
87 int GetOption(
int level,
int option_name,
int &option_value);
88 int SetOption(
int level,
int option_name,
int option_value);
93 Status Read(
void *buf,
size_t &num_bytes)
override;
94 Status Write(
const void *buf,
size_t &num_bytes)
override;
102 static llvm::Expected<HostAndPort>
110 bool m_child_process_inherit);
112 virtual size_t Send(
const void *buf,
const size_t num_bytes);
static llvm::raw_ostream & error(Stream &strm)
virtual Status Listen(llvm::StringRef name, int backlog)=0
Status Read(void *buf, size_t &num_bytes) override
NativeSocket GetNativeSocket() const
static llvm::Expected< std::unique_ptr< UDPSocket > > UdpConnect(llvm::StringRef host_and_port, bool child_processes_inherit)
virtual Status Connect(llvm::StringRef name)=0
static const NativeSocket kInvalidSocketValue
WaitableHandle GetWaitableHandle() override
virtual std::string GetRemoteConnectionURI() const
static NativeSocket CreateSocket(const int domain, const int type, const int protocol, bool child_processes_inherit, Status &error)
SocketProtocol m_protocol
virtual size_t Send(const void *buf, const size_t num_bytes)
int SetOption(int level, int option_name, int option_value)
bool m_child_processes_inherit
virtual Status PreDisconnect()
static llvm::Expected< HostAndPort > DecodeHostAndPort(llvm::StringRef host_and_port)
int GetOption(int level, int option_name, int &option_value)
SocketProtocol GetSocketProtocol() const
static NativeSocket AcceptSocket(NativeSocket sockfd, struct sockaddr *addr, socklen_t *addrlen, bool child_processes_inherit, Status &error)
bool IsValid() const override
static void SetLastError(Status &error)
static llvm::Error Initialize()
static llvm::Expected< std::unique_ptr< Socket > > TcpConnect(llvm::StringRef host_and_port, bool child_processes_inherit)
Status Write(const void *buf, size_t &num_bytes) override
virtual Status Accept(Socket *&socket)=0
static std::unique_ptr< Socket > Create(const SocketProtocol protocol, bool child_processes_inherit, Status &error)
static llvm::Expected< std::unique_ptr< TCPSocket > > TcpListen(llvm::StringRef host_and_port, bool child_processes_inherit, int backlog=5)
A class that represents a running process on the host machine.
Stream & operator<<(Stream &s, const SourceLocationSpec &loc)
Dump a SourceLocationSpec object to a stream.
bool operator==(const HostAndPort &R) const