| 
    Diag-Client-Lib
    
   | 
 
Server that manages unsecured/ secured tcp connection. More...
#include <tcp_server.h>
Classes | |
| class | TcpServerImpl | 
Public Types | |
| using | TcpSocket = socket::tcp::TcpSocket | 
| Type alias for tcp unsecured socket.  More... | |
| 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 | |
| TcpServer (std::string_view server_name, TcpSocket tcp_socket) noexcept | |
| Constructs an instance of TcpServer.  More... | |
| TcpServer (const TcpServer &other) noexcept=delete | |
| Deleted copy assignment and copy constructor.  More... | |
| TcpServer & | operator= (const TcpServer &other) noexcept=delete | 
| TcpServer (TcpServer &&other) noexcept | |
| Move assignment and move constructor.  More... | |
| TcpServer & | operator= (TcpServer &&other) noexcept | 
| ~TcpServer () noexcept | |
| Destruct an instance of TcpServer.  More... | |
| void | Initialize () noexcept | 
| Initialize the server.  More... | |
| void | DeInitialize () noexcept | 
| De-initialize the server.  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 > | Transmit (MessageConstPtr tcp_message) | 
| Function to transmit the provided tcp message.  More... | |
Private Attributes | |
| std::unique_ptr< TcpServerImpl > | tcp_server_impl_ | 
| Unique pointer to tcp server implementation.  More... | |
Server that manages unsecured/ secured tcp connection.
Definition at line 30 of file tcp_server.h.
| using boost_support::server::tcp::TcpServer::HandlerRead = std::function<void(MessagePtr)> | 
Tcp function template used for reception.
Definition at line 55 of file tcp_server.h.
Type alias for Tcp message.
Definition at line 40 of file tcp_server.h.
| using boost_support::server::tcp::TcpServer::MessageConstPtr = boost_support::message::tcp::TcpMessageConstPtr | 
Type alias for Tcp message const pointer.
Definition at line 50 of file tcp_server.h.
| using boost_support::server::tcp::TcpServer::MessagePtr = boost_support::message::tcp::TcpMessagePtr | 
Type alias for Tcp message pointer.
Definition at line 45 of file tcp_server.h.
Type alias for tcp unsecured socket.
Definition at line 35 of file tcp_server.h.
      
  | 
  explicitnoexcept | 
Constructs an instance of TcpServer.
| [in] | server_name | The name of the server | 
| [in] | tcp_socket | The underlying tcp socket required for communication | 
Definition at line 88 of file tcp_server.cpp.
      
  | 
  deletenoexcept | 
Deleted copy assignment and copy constructor.
      
  | 
  defaultnoexcept | 
Move assignment and move constructor.
      
  | 
  defaultnoexcept | 
Destruct an instance of TcpServer.
      
  | 
  noexcept | 
De-initialize the server.
Definition at line 99 of file tcp_server.cpp.
References tcp_server_impl_.
      
  | 
  noexcept | 
Initialize the server.
Definition at line 97 of file tcp_server.cpp.
References Initialize().
Referenced by Initialize().


      
  | 
  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 101 of file tcp_server.cpp.
| core_type::Result< void > boost_support::server::tcp::TcpServer::Transmit | ( | TcpServer::MessageConstPtr | tcp_message | ) | 
Function to transmit the provided tcp message.
| [in] | tcp_message | The tcp message | 
Definition at line 105 of file tcp_server.cpp.
References tcp_server_impl_.
      
  | 
  private | 
Unique pointer to tcp server implementation.
Definition at line 119 of file tcp_server.h.
Referenced by DeInitialize(), and Transmit().