| 
    Diag-Client-Lib
    
   | 
 
Client that manages unsecured/ secured tcp connection. More...
#include <tcp_client.h>
Classes | |
| class | TcpClientImpl | 
| Class to provide implementation of tcp client.  More... | |
Public Types | |
| using | Message = boost_support::message::tcp::TcpMessage | 
| Type alias for Tcp message.  More... | |
| using | MessagePtr = boost_support::message::tcp::TcpMessagePtr | 
| Type alias for Tcp message pointer.  More... | |
| using | MessageConstPtr = boost_support::message::tcp::TcpMessageConstPtr | 
| Type alias for Tcp message const pointer.  More... | |
| using | HandlerRead = std::function< void(MessagePtr)> | 
| Tcp function template used for reception.  More... | |
Public Member Functions | |
| TcpClient (std::string_view client_name, std::string_view local_ip_address, std::uint16_t local_port_num) noexcept | |
| Constructs an instance of TcpClient.  More... | |
| TcpClient (const TcpClient &other) noexcept=delete | |
| Deleted copy assignment and copy constructor.  More... | |
| TcpClient & | operator= (const TcpClient &other) noexcept=delete | 
| TcpClient (TcpClient &&other) noexcept | |
| Move assignment and move constructor.  More... | |
| TcpClient & | operator= (TcpClient &&other) noexcept | 
| ~TcpClient () noexcept | |
| Destruct an instance of TcpClient.  More... | |
| void | Initialize () noexcept | 
| Initialize the client.  More... | |
| void | DeInitialize () noexcept | 
| De-initialize the client.  More... | |
| void | SetReadHandler (HandlerRead read_handler) noexcept | 
| Function to set the read handler that is invoked when message is received.  More... | |
| core_type::Result< void > | ConnectToHost (std::string_view host_ip_address, std::uint16_t host_port_num) | 
| Function to connect to remote ip address and port number.  More... | |
| core_type::Result< void > | DisconnectFromHost () | 
| Function to disconnect from remote host if already connected.  More... | |
| auto | IsConnectedToHost () const noexcept -> bool | 
| Function to get the connection status.  More... | |
| core_type::Result< void > | Transmit (MessageConstPtr tcp_message) | 
| Function to transmit the provided tcp message.  More... | |
Private Attributes | |
| std::unique_ptr< TcpClientImpl > | tcp_client_impl_ | 
| Unique pointer to tcp client implementation.  More... | |
Client that manages unsecured/ secured tcp connection.
Definition at line 24 of file tcp_client.h.
| using boost_support::client::tcp::TcpClient::HandlerRead = std::function<void(MessagePtr)> | 
Tcp function template used for reception.
Definition at line 44 of file tcp_client.h.
Type alias for Tcp message.
Definition at line 29 of file tcp_client.h.
| using boost_support::client::tcp::TcpClient::MessageConstPtr = boost_support::message::tcp::TcpMessageConstPtr | 
Type alias for Tcp message const pointer.
Definition at line 39 of file tcp_client.h.
| using boost_support::client::tcp::TcpClient::MessagePtr = boost_support::message::tcp::TcpMessagePtr | 
Type alias for Tcp message pointer.
Definition at line 34 of file tcp_client.h.
      
  | 
  noexcept | 
Constructs an instance of TcpClient.
| [in] | client_name | The name of the client | 
| [in] | local_ip_address | The local ip address | 
| [in] | local_port_num | The local port number | 
Definition at line 214 of file tcp_client.cpp.
      
  | 
  deletenoexcept | 
Deleted copy assignment and copy constructor.
      
  | 
  defaultnoexcept | 
Move assignment and move constructor.
      
  | 
  defaultnoexcept | 
Destruct an instance of TcpClient.
| core_type::Result< void > boost_support::client::tcp::TcpClient::ConnectToHost | ( | std::string_view | host_ip_address, | 
| std::uint16_t | host_port_num | ||
| ) | 
Function to connect to remote ip address and port number.
| [in] | host_ip_address | The host ip address | 
| [in] | host_port_num | The host port number | 
Definition at line 233 of file tcp_client.cpp.
References tcp_client_impl_.
      
  | 
  noexcept | 
De-initialize the client.
Definition at line 227 of file tcp_client.cpp.
References tcp_client_impl_.
| core_type::Result< void > boost_support::client::tcp::TcpClient::DisconnectFromHost | ( | ) | 
Function to disconnect from remote host if already connected.
Definition at line 238 of file tcp_client.cpp.
References tcp_client_impl_.
      
  | 
  noexcept | 
Initialize the client.
Definition at line 225 of file tcp_client.cpp.
References Initialize().
Referenced by Initialize().


      
  | 
  noexcept | 
Function to get the connection status.
Definition at line 242 of file tcp_client.cpp.
References tcp_client_impl_.
      
  | 
  deletenoexcept | 
      
  | 
  noexcept | 
Function to set the read handler that is invoked when message is received.
The ownership of provided read handler is moved
| [in] | read_handler | The handler to be set | 
Definition at line 229 of file tcp_client.cpp.
| core_type::Result< void > boost_support::client::tcp::TcpClient::Transmit | ( | MessageConstPtr | tcp_message | ) | 
Function to transmit the provided tcp message.
| [in] | tcp_message | The tcp message | 
Definition at line 246 of file tcp_client.cpp.
References tcp_client_impl_.
      
  | 
  private | 
Unique pointer to tcp client implementation.
Definition at line 134 of file tcp_client.h.
Referenced by ConnectToHost(), DeInitialize(), DisconnectFromHost(), IsConnectedToHost(), and Transmit().