9#ifndef LLDB_CORE_COMMUNICATION_H
10#define LLDB_CORE_COMMUNICATION_H
109 virtual size_t Read(
void *dst,
size_t dst_len,
144 size_t WriteAll(
const void *src,
size_t src_len,
159 virtual void SetConnection(std::unique_ptr<Connection> connection);
An abstract communications class.
size_t ReadFromConnection(void *dst, size_t dst_len, const Timeout< std::micro > &timeout, lldb::ConnectionStatus &status, Status *error_ptr)
bool GetCloseOnEOF() const
virtual size_t Read(void *dst, size_t dst_len, const Timeout< std::micro > &timeout, lldb::ConnectionStatus &status, Status *error_ptr)
Read bytes from the current connection.
lldb::ConnectionSP m_connection_sp
The connection that is current in use by this communications class.
lldb::ConnectionStatus Connect(const char *url, Status *error_ptr)
Connect using the current connection by passing url to its connect function.
bool IsConnected() const
Check if the connection is valid.
virtual void SetConnection(std::unique_ptr< Connection > connection)
Sets the connection that it to be used by this class.
virtual ~Communication()
Destructor.
size_t WriteAll(const void *src, size_t src_len, lldb::ConnectionStatus &status, Status *error_ptr)
Repeatedly attempt writing until either src_len bytes are written or a permanent failure occurs.
Communication()
Construct the Communication object.
virtual lldb::ConnectionStatus Disconnect(Status *error_ptr=nullptr)
Disconnect the communications connection if one is currently connected.
static std::string ConnectionStatusAsString(lldb::ConnectionStatus status)
lldb_private::Connection * GetConnection()
const Communication & operator=(const Communication &)=delete
void SetCloseOnEOF(bool b)
bool HasConnection() const
size_t Write(const void *src, size_t src_len, lldb::ConnectionStatus &status, Status *error_ptr)
The actual write function that attempts to write to the communications protocol.
Communication(const Communication &)=delete
std::mutex m_write_mutex
Don't let multiple threads write at the same time...
A communication connection class.
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::Connection > ConnectionSP
ConnectionStatus
Connection Status Types.