LLDB  mainline
Public Member Functions | Private Member Functions | Private Attributes | List of all members
lldb_private::TCPSocket Class Reference

#include <TCPSocket.h>

Inheritance diagram for lldb_private::TCPSocket:
Inheritance graph
[legend]
Collaboration diagram for lldb_private::TCPSocket:
Collaboration graph
[legend]

Public Member Functions

 TCPSocket (bool should_close, bool child_processes_inherit)
 
 TCPSocket (NativeSocket socket, bool should_close, bool child_processes_inherit)
 
 ~TCPSocket () override
 
uint16_t GetLocalPortNumber () const
 
std::string GetLocalIPAddress () const
 
uint16_t GetRemotePortNumber () const
 
std::string GetRemoteIPAddress () const
 
int SetOptionNoDelay ()
 
int SetOptionReuseAddress ()
 
Status Connect (llvm::StringRef name) override
 
Status Listen (llvm::StringRef name, int backlog) override
 
Status Accept (Socket *&conn_socket) override
 
Status CreateSocket (int domain)
 
bool IsValid () const override
 
std::string GetRemoteConnectionURI () const override
 
- Public Member Functions inherited from lldb_private::Socket
 ~Socket () override
 
int GetOption (int level, int option_name, int &option_value)
 
int SetOption (int level, int option_name, int option_value)
 
NativeSocket GetNativeSocket () const
 
SocketProtocol GetSocketProtocol () const
 
Status Read (void *buf, size_t &num_bytes) override
 
Status Write (const void *buf, size_t &num_bytes) override
 
virtual Status PreDisconnect ()
 
Status Close () override
 
bool IsValid () const override
 
WaitableHandle GetWaitableHandle () override
 
- Public Member Functions inherited from lldb_private::IOObject
 IOObject (FDType type)
 
virtual ~IOObject ()
 
FDType GetFdType () const
 

Private Member Functions

 TCPSocket (NativeSocket socket, const TCPSocket &listen_socket)
 
void CloseListenSockets ()
 

Private Attributes

std::map< int, SocketAddressm_listen_sockets
 

Additional Inherited Members

- Public Types inherited from lldb_private::Socket
enum  SocketProtocol { ProtocolTcp, ProtocolUdp, ProtocolUnixDomain, ProtocolUnixAbstract }
 
- Public Types inherited from lldb_private::IOObject
enum  FDType { eFDTypeFile, eFDTypeSocket }
 
typedef int WaitableHandle
 
- Static Public Member Functions inherited from lldb_private::Socket
static llvm::Error Initialize ()
 
static void Terminate ()
 
static std::unique_ptr< SocketCreate (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, Predicate< uint16_t > *predicate, int backlog=5)
 
static llvm::Expected< std::unique_ptr< Socket > > TcpConnect (llvm::StringRef host_and_port, bool child_processes_inherit)
 
static llvm::Expected< std::unique_ptr< UDPSocket > > UdpConnect (llvm::StringRef host_and_port, bool child_processes_inherit)
 
static Status UnixDomainConnect (llvm::StringRef host_and_port, bool child_processes_inherit, Socket *&socket)
 
static Status UnixDomainAccept (llvm::StringRef host_and_port, bool child_processes_inherit, Socket *&socket)
 
static Status UnixAbstractConnect (llvm::StringRef host_and_port, bool child_processes_inherit, Socket *&socket)
 
static Status UnixAbstractAccept (llvm::StringRef host_and_port, bool child_processes_inherit, Socket *&socket)
 
static bool DecodeHostAndPort (llvm::StringRef host_and_port, std::string &host_str, std::string &port_str, int32_t &port, Status *error_ptr)
 
- Static Public Attributes inherited from lldb_private::Socket
static const NativeSocket kInvalidSocketValue = -1
 
- Static Public Attributes inherited from lldb_private::IOObject
static const WaitableHandle kInvalidHandleValue = -1
 
- Protected Member Functions inherited from lldb_private::Socket
 Socket (SocketProtocol protocol, bool should_close, bool m_child_process_inherit)
 
virtual size_t Send (const void *buf, const size_t num_bytes)
 
- Static Protected Member Functions inherited from lldb_private::Socket
static void SetLastError (Status &error)
 
static NativeSocket CreateSocket (const int domain, const int type, const int protocol, bool child_processes_inherit, Status &error)
 
static NativeSocket AcceptSocket (NativeSocket sockfd, struct sockaddr *addr, socklen_t *addrlen, bool child_processes_inherit, Status &error)
 
- Protected Attributes inherited from lldb_private::Socket
SocketProtocol m_protocol
 
NativeSocket m_socket
 
bool m_child_processes_inherit
 
bool m_should_close_fd
 
- Protected Attributes inherited from lldb_private::IOObject
FDType m_fd_type
 

Detailed Description

Definition at line 17 of file TCPSocket.h.

Constructor & Destructor Documentation

◆ TCPSocket() [1/3]

TCPSocket::TCPSocket ( bool  should_close,
bool  child_processes_inherit 
)

Definition at line 60 of file TCPSocket.cpp.

Referenced by Accept().

◆ TCPSocket() [2/3]

TCPSocket::TCPSocket ( NativeSocket  socket,
bool  should_close,
bool  child_processes_inherit 
)

Definition at line 69 of file TCPSocket.cpp.

References lldb_private::Socket::m_socket.

◆ ~TCPSocket()

TCPSocket::~TCPSocket ( )
override

Definition at line 75 of file TCPSocket.cpp.

References CloseListenSockets().

◆ TCPSocket() [3/3]

TCPSocket::TCPSocket ( NativeSocket  socket,
const TCPSocket listen_socket 
)
private

Definition at line 63 of file TCPSocket.cpp.

References lldb_private::Socket::m_socket.

Member Function Documentation

◆ Accept()

Status TCPSocket::Accept ( Socket *&  conn_socket)
overridevirtual

◆ CloseListenSockets()

void TCPSocket::CloseListenSockets ( )
private

Definition at line 248 of file TCPSocket.cpp.

References CLOSE_SOCKET, and m_listen_sockets.

Referenced by ~TCPSocket().

◆ Connect()

Status TCPSocket::Connect ( llvm::StringRef  name)
overridevirtual

◆ CreateSocket()

Status TCPSocket::CreateSocket ( int  domain)

◆ GetLocalIPAddress()

std::string TCPSocket::GetLocalIPAddress ( ) const

◆ GetLocalPortNumber()

uint16_t TCPSocket::GetLocalPortNumber ( ) const

◆ GetRemoteConnectionURI()

std::string TCPSocket::GetRemoteConnectionURI ( ) const
overridevirtual

◆ GetRemoteIPAddress()

std::string TCPSocket::GetRemoteIPAddress ( ) const

◆ GetRemotePortNumber()

uint16_t TCPSocket::GetRemotePortNumber ( ) const

◆ IsValid()

bool TCPSocket::IsValid ( ) const
overridevirtual

◆ Listen()

Status TCPSocket::Listen ( llvm::StringRef  name,
int  backlog 
)
overridevirtual

◆ SetOptionNoDelay()

int TCPSocket::SetOptionNoDelay ( )

Definition at line 314 of file TCPSocket.cpp.

References lldb_private::Socket::SetOption().

Referenced by Connect().

◆ SetOptionReuseAddress()

int TCPSocket::SetOptionReuseAddress ( )

Definition at line 318 of file TCPSocket.cpp.

References lldb_private::Socket::SetOption().

Member Data Documentation

◆ m_listen_sockets

std::map<int, SocketAddress> lldb_private::TCPSocket::m_listen_sockets
private

Definition at line 56 of file TCPSocket.h.

Referenced by Accept(), CloseListenSockets(), GetLocalPortNumber(), IsValid(), and Listen().


The documentation for this class was generated from the following files: