Android-cuttlefish cvd tool
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
openscreen::anonymous_namespace{udp_socket.cpp}::AdbUdpSocket Class Reference
Inheritance diagram for openscreen::anonymous_namespace{udp_socket.cpp}::AdbUdpSocket:
Inheritance graph
[legend]
Collaboration diagram for openscreen::anonymous_namespace{udp_socket.cpp}::AdbUdpSocket:
Collaboration graph
[legend]

Public Member Functions

 AdbUdpSocket (UdpSocket::Client *client, const IPEndpoint &local_endpoint, unique_fd fd)
 
 ~AdbUdpSocket () override
 
bool IsIPv4 () const override
 
bool IsIPv6 () const override
 
IPEndpoint GetLocalEndpoint () const override
 
void Bind () override
 
void SetMulticastOutboundInterface (NetworkInterfaceIndex ifindex) override
 
void JoinMulticastGroup (const IPAddress &address, NetworkInterfaceIndex ifindex) override
 
virtual void SendMessage (const void *data, size_t length, const IPEndpoint &dest) override
 
void SetDscp (DscpMode state) override
 
- Public Member Functions inherited from UdpSocket
 UdpSocket (Type type, cutils_socket_t sock)
 
bool Send (const void *data, size_t length) override
 
bool Send (std::vector< cutils_socket_buffer_t > buffers) override
 
ssize_t Receive (void *data, size_t length, int timeout_ms) override
 
- Public Member Functions inherited from Socket
virtual ~Socket ()
 
virtual bool Send (const void *data, size_t length)=0
 
virtual bool Send (std::vector< cutils_socket_buffer_t > buffers)=0
 
virtual ssize_t Receive (void *data, size_t length, int timeout_ms)=0
 
virtual ssize_t ReceiveAll (void *data, size_t length, int timeout_ms)
 
bool ReceiveTimedOut ()
 
virtual int Close ()
 
virtual std::unique_ptr< SocketAccept ()
 
int GetLocalPort ()
 

Static Public Member Functions

static void SetIPV4MulticastProperties (std::optional< IPAddress > local_ipv4, std::optional< IPAddress > multiaddr_ipv4, ip_mreq *result)
 
- Static Public Member Functions inherited from Socket
static std::string GetErrorMessage ()
 
static std::unique_ptr< SocketNewClient (Protocol protocol, const std::string &hostname, int port, std::string *error)
 
static std::unique_ptr< SocketNewServer (Protocol protocol, int port)
 

Private Member Functions

void MdnsBind (NetworkInterfaceIndex ifindex)
 
void ReceiveMessage ()
 
void OnError (Error::Code error_code)
 

Static Private Member Functions

static void OnFdeventResult (int fd, unsigned ev, void *opaque)
 

Private Attributes

Client *const client_
 
IPEndpoint local_endpoint_
 
unique_fd fd_
 
fdeventfde_ = nullptr
 
std::optional< NetworkInterfaceIndex > mdns_ifindex_
 

Additional Inherited Members

- Public Types inherited from UdpSocket
enum class  Type { kClient , kServer }
 
- Public Types inherited from Socket
enum class  Protocol { kTcp , kUdp }
 
- Protected Member Functions inherited from Socket
 Socket (cutils_socket_t sock)
 
bool WaitForRecv (int timeout_ms)
 
- Protected Attributes inherited from Socket
cutils_socket_t sock_ = INVALID_SOCKET
 
bool receive_timed_out_ = false
 
std::function< ssize_t(cutils_socket_t, cutils_socket_buffer_t *, size_t)> socket_send_buffers_function_ = &socket_send_buffers
 

Constructor & Destructor Documentation

◆ AdbUdpSocket()

openscreen::anonymous_namespace{udp_socket.cpp}::AdbUdpSocket::AdbUdpSocket ( UdpSocket::Client *  client,
const IPEndpoint &  local_endpoint,
unique_fd  fd 
)
inlineexplicit

◆ ~AdbUdpSocket()

openscreen::anonymous_namespace{udp_socket.cpp}::AdbUdpSocket::~AdbUdpSocket ( )
inlineoverride

Member Function Documentation

◆ Bind()

void openscreen::anonymous_namespace{udp_socket.cpp}::AdbUdpSocket::Bind ( )
inlineoverride

◆ GetLocalEndpoint()

IPEndpoint openscreen::anonymous_namespace{udp_socket.cpp}::AdbUdpSocket::GetLocalEndpoint ( ) const
inlineoverride

◆ IsIPv4()

bool openscreen::anonymous_namespace{udp_socket.cpp}::AdbUdpSocket::IsIPv4 ( ) const
inlineoverride

◆ IsIPv6()

bool openscreen::anonymous_namespace{udp_socket.cpp}::AdbUdpSocket::IsIPv6 ( ) const
inlineoverride

◆ JoinMulticastGroup()

void openscreen::anonymous_namespace{udp_socket.cpp}::AdbUdpSocket::JoinMulticastGroup ( const IPAddress &  address,
NetworkInterfaceIndex  ifindex 
)
inlineoverride

◆ MdnsBind()

void openscreen::anonymous_namespace{udp_socket.cpp}::AdbUdpSocket::MdnsBind ( NetworkInterfaceIndex  ifindex)
inlineprivate

◆ OnError()

void openscreen::anonymous_namespace{udp_socket.cpp}::AdbUdpSocket::OnError ( Error::Code  error_code)
inlineprivate

◆ OnFdeventResult()

static void openscreen::anonymous_namespace{udp_socket.cpp}::AdbUdpSocket::OnFdeventResult ( int  fd,
unsigned  ev,
void *  opaque 
)
inlinestaticprivate

◆ ReceiveMessage()

void openscreen::anonymous_namespace{udp_socket.cpp}::AdbUdpSocket::ReceiveMessage ( )
inlineprivate

◆ SendMessage()

virtual void openscreen::anonymous_namespace{udp_socket.cpp}::AdbUdpSocket::SendMessage ( const void *  data,
size_t  length,
const IPEndpoint &  dest 
)
inlineoverridevirtual

◆ SetDscp()

void openscreen::anonymous_namespace{udp_socket.cpp}::AdbUdpSocket::SetDscp ( DscpMode  state)
inlineoverride

◆ SetIPV4MulticastProperties()

static void openscreen::anonymous_namespace{udp_socket.cpp}::AdbUdpSocket::SetIPV4MulticastProperties ( std::optional< IPAddress >  local_ipv4,
std::optional< IPAddress >  multiaddr_ipv4,
ip_mreq *  result 
)
inlinestatic

◆ SetMulticastOutboundInterface()

void openscreen::anonymous_namespace{udp_socket.cpp}::AdbUdpSocket::SetMulticastOutboundInterface ( NetworkInterfaceIndex  ifindex)
inlineoverride

Member Data Documentation

◆ client_

Client* const openscreen::anonymous_namespace{udp_socket.cpp}::AdbUdpSocket::client_
private

◆ fd_

unique_fd openscreen::anonymous_namespace{udp_socket.cpp}::AdbUdpSocket::fd_
private

◆ fde_

fdevent* openscreen::anonymous_namespace{udp_socket.cpp}::AdbUdpSocket::fde_ = nullptr
private

◆ local_endpoint_

IPEndpoint openscreen::anonymous_namespace{udp_socket.cpp}::AdbUdpSocket::local_endpoint_
mutableprivate

◆ mdns_ifindex_

std::optional<NetworkInterfaceIndex> openscreen::anonymous_namespace{udp_socket.cpp}::AdbUdpSocket::mdns_ifindex_
private

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