Android-cuttlefish cvd tool
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
cuttlefish::ChannelMonitor Class Reference

#include <channel_monitor.h>

Collaboration diagram for cuttlefish::ChannelMonitor:
Collaboration graph
[legend]

Public Member Functions

 ChannelMonitor (VirtualModemSimulator &modem, cuttlefish::SharedFD server)
 
 ~ChannelMonitor ()
 
 ChannelMonitor (const ChannelMonitor &)=delete
 
ChannelMonitoroperator= (const ChannelMonitor &)=delete
 
ClientId SetRemoteClient (SharedFD client, bool is_accepted)
 
void SendRemoteCommand (ClientId client, std::string &response)
 
void CloseRemoteConnection (ClientId client)
 
void SendUnsolicitedCommand (std::string &response)
 

Private Member Functions

void AcceptIncomingConnection ()
 
void OnClientSocketClosed (int sock)
 
void ReadCommand (Client &client)
 
void MonitorLoop ()
 

Static Private Member Functions

static void removeInvalidClients (std::vector< std::unique_ptr< Client > > &clients)
 

Private Attributes

VirtualModemSimulatormodem_
 
std::thread monitor_thread_
 
cuttlefish::SharedFD server_
 
cuttlefish::SharedFD read_pipe_
 
cuttlefish::SharedFD write_pipe_
 
std::vector< std::unique_ptr< Client > > clients_
 
std::vector< std::unique_ptr< Client > > remote_clients_
 

Constructor & Destructor Documentation

◆ ChannelMonitor() [1/2]

cuttlefish::ChannelMonitor::ChannelMonitor ( VirtualModemSimulator modem,
cuttlefish::SharedFD  server 
)

◆ ~ChannelMonitor()

cuttlefish::ChannelMonitor::~ChannelMonitor ( )

◆ ChannelMonitor() [2/2]

cuttlefish::ChannelMonitor::ChannelMonitor ( const ChannelMonitor )
delete

Member Function Documentation

◆ AcceptIncomingConnection()

void cuttlefish::ChannelMonitor::AcceptIncomingConnection ( )
private

◆ CloseRemoteConnection()

void cuttlefish::ChannelMonitor::CloseRemoteConnection ( ClientId  client)

◆ MonitorLoop()

void cuttlefish::ChannelMonitor::MonitorLoop ( )
private

◆ OnClientSocketClosed()

void cuttlefish::ChannelMonitor::OnClientSocketClosed ( int  sock)
private

◆ operator=()

ChannelMonitor & cuttlefish::ChannelMonitor::operator= ( const ChannelMonitor )
delete

◆ ReadCommand()

void cuttlefish::ChannelMonitor::ReadCommand ( Client client)
private

◆ removeInvalidClients()

void cuttlefish::ChannelMonitor::removeInvalidClients ( std::vector< std::unique_ptr< Client > > &  clients)
staticprivate

◆ SendRemoteCommand()

void cuttlefish::ChannelMonitor::SendRemoteCommand ( ClientId  client,
std::string &  response 
)

◆ SendUnsolicitedCommand()

void cuttlefish::ChannelMonitor::SendUnsolicitedCommand ( std::string &  response)

◆ SetRemoteClient()

ClientId cuttlefish::ChannelMonitor::SetRemoteClient ( SharedFD  client,
bool  is_accepted 
)

Member Data Documentation

◆ clients_

std::vector<std::unique_ptr<Client> > cuttlefish::ChannelMonitor::clients_
private

◆ modem_

VirtualModemSimulator& cuttlefish::ChannelMonitor::modem_
private

◆ monitor_thread_

std::thread cuttlefish::ChannelMonitor::monitor_thread_
private

◆ read_pipe_

cuttlefish::SharedFD cuttlefish::ChannelMonitor::read_pipe_
private

◆ remote_clients_

std::vector<std::unique_ptr<Client> > cuttlefish::ChannelMonitor::remote_clients_
private

◆ server_

cuttlefish::SharedFD cuttlefish::ChannelMonitor::server_
private

◆ write_pipe_

cuttlefish::SharedFD cuttlefish::ChannelMonitor::write_pipe_
private

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