Android-cuttlefish cvd tool
Public Member Functions | Private Member Functions | List of all members
TcpSocket Class Reference
Inheritance diagram for TcpSocket:
Inheritance graph
[legend]
Collaboration diagram for TcpSocket:
Collaboration graph
[legend]

Public Member Functions

 TcpSocket (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
 
std::unique_ptr< SocketAccept () 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 ()
 

Private Member Functions

 DISALLOW_COPY_AND_ASSIGN (TcpSocket)
 

Additional Inherited Members

- Public Types inherited from Socket
enum class  Protocol { kTcp , kUdp }
 
- 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)
 
- 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

◆ TcpSocket()

TcpSocket::TcpSocket ( cutils_socket_t  sock)
inlineexplicit

Member Function Documentation

◆ Accept()

std::unique_ptr< Socket > TcpSocket::Accept ( )
overridevirtual

Reimplemented from Socket.

◆ DISALLOW_COPY_AND_ASSIGN()

TcpSocket::DISALLOW_COPY_AND_ASSIGN ( TcpSocket  )
private

◆ Receive()

ssize_t TcpSocket::Receive ( void *  data,
size_t  length,
int  timeout_ms 
)
overridevirtual

Implements Socket.

◆ Send() [1/2]

bool TcpSocket::Send ( const void *  data,
size_t  length 
)
overridevirtual

Implements Socket.

◆ Send() [2/2]

bool TcpSocket::Send ( std::vector< cutils_socket_buffer_t >  buffers)
overridevirtual

Implements Socket.


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