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

#include <UDPSocket.h>

Inheritance diagram for lldb_private::UDPSocket:
Inheritance graph
[legend]

Public Member Functions

 UDPSocket (bool should_close)
 
std::string GetRemoteConnectionURI () const override
 
- Public Member Functions inherited from lldb_private::Socket
 ~Socket () override
 
virtual Status Connect (llvm::StringRef name)=0
 
virtual Status Listen (llvm::StringRef name, int backlog)=0
 
virtual llvm::Expected< std::vector< MainLoopBase::ReadHandleUP > > Accept (MainLoopBase &loop, std::function< void(std::unique_ptr< Socket > socket)> sock_cb)=0
 
virtual Status Accept (const Timeout< std::micro > &timeout, Socket *&socket)
 
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
 
Status Close () override
 
bool IsValid () const override
 
WaitableHandle GetWaitableHandle () override
 
virtual std::string GetRemoteConnectionURI () const
 
virtual std::vector< std::string > GetListeningConnectionURI () const
 
- Public Member Functions inherited from lldb_private::IOObject
 IOObject (FDType type)
 
virtual ~IOObject ()
 
virtual Status Read (void *buf, size_t &num_bytes)=0
 
virtual Status Write (const void *buf, size_t &num_bytes)=0
 
virtual bool IsValid () const =0
 
virtual Status Close ()=0
 
FDType GetFdType () const
 
virtual WaitableHandle GetWaitableHandle ()=0
 

Static Public Member Functions

static llvm::Expected< std::unique_ptr< UDPSocket > > CreateConnected (llvm::StringRef name)
 
- Static Public Member Functions inherited from lldb_private::Socket
static const char * FindSchemeByProtocol (const SocketProtocol protocol)
 
static bool FindProtocolByScheme (const char *scheme, SocketProtocol &protocol)
 
static llvm::Error Initialize ()
 
static void Terminate ()
 
static std::unique_ptr< SocketCreate (const SocketProtocol protocol, Status &error)
 
static llvm::Expected< std::unique_ptr< TCPSocket > > TcpListen (llvm::StringRef host_and_port, int backlog=5)
 
static llvm::Expected< std::unique_ptr< Socket > > TcpConnect (llvm::StringRef host_and_port)
 
static llvm::Expected< std::unique_ptr< UDPSocket > > UdpConnect (llvm::StringRef host_and_port)
 
static int GetOption (NativeSocket sockfd, int level, int option_name, int &option_value)
 
static int SetOption (NativeSocket sockfd, int level, int option_name, int option_value)
 
static llvm::Expected< HostAndPortDecodeHostAndPort (llvm::StringRef host_and_port)
 

Private Member Functions

 UDPSocket (NativeSocket socket)
 
size_t Send (const void *buf, const size_t num_bytes) override
 
Status Connect (llvm::StringRef name) override
 
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
 

Private Attributes

SocketAddress m_sockaddr
 

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 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)
 
virtual size_t Send (const void *buf, const size_t num_bytes)
 
- Static Protected Member Functions inherited from lldb_private::Socket
static int CloseSocket (NativeSocket sockfd)
 
static Status GetLastError ()
 
static void SetLastError (Status &error)
 
static NativeSocket CreateSocket (const int domain, const int type, const int protocol, Status &error)
 
static NativeSocket AcceptSocket (NativeSocket sockfd, struct sockaddr *addr, socklen_t *addrlen, Status &error)
 
- Protected Attributes inherited from lldb_private::Socket
SocketProtocol m_protocol
 
NativeSocket m_socket
 
bool m_should_close_fd
 
- Protected Attributes inherited from lldb_private::IOObject
FDType m_fd_type
 

Detailed Description

Definition at line 15 of file UDPSocket.h.

Constructor & Destructor Documentation

◆ UDPSocket() [1/2]

UDPSocket::UDPSocket ( bool  should_close)
explicit

Definition at line 35 of file UDPSocket.cpp.

◆ UDPSocket() [2/2]

UDPSocket::UDPSocket ( NativeSocket  socket)
private

Definition at line 30 of file UDPSocket.cpp.

References lldb_private::Socket::m_socket.

Member Function Documentation

◆ Accept()

llvm::Expected< std::vector< MainLoopBase::ReadHandleUP > > lldb_private::UDPSocket::Accept ( MainLoopBase loop,
std::function< void(std::unique_ptr< Socket > socket)>  sock_cb 
)
inlineoverrideprivatevirtual

Implements lldb_private::Socket.

Definition at line 32 of file UDPSocket.h.

◆ Connect()

Status UDPSocket::Connect ( llvm::StringRef  name)
overrideprivatevirtual

◆ CreateConnected()

llvm::Expected< std::unique_ptr< UDPSocket > > UDPSocket::CreateConnected ( llvm::StringRef  name)
static

◆ GetRemoteConnectionURI()

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

◆ Listen()

Status UDPSocket::Listen ( llvm::StringRef  name,
int  backlog 
)
overrideprivatevirtual

◆ Send()

size_t UDPSocket::Send ( const void *  buf,
const size_t  num_bytes 
)
overrideprivatevirtual

Member Data Documentation

◆ m_sockaddr

SocketAddress lldb_private::UDPSocket::m_sockaddr
private

Definition at line 38 of file UDPSocket.h.

Referenced by GetRemoteConnectionURI(), and Send().


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