unilink  0.4.3
A simple C++ library for unified async communication
unilink::interface::TcpSocketInterface Class Referenceabstract

An interface abstracting Boost.Asio's tcp::socket for testability. This is an internal interface used for dependency injection and mocking. More...

#include <itcp_socket.hpp>

Inheritance diagram for unilink::interface::TcpSocketInterface:
unilink::transport::BoostTcpSocket

Public Member Functions

virtual ~TcpSocketInterface ()=default
 
virtual void async_read_some (const net::mutable_buffer &buffer, std::function< void(const boost::system::error_code &, std::size_t)> handler)=0
 
virtual void async_write (const net::const_buffer &buffer, std::function< void(const boost::system::error_code &, std::size_t)> handler)=0
 
virtual void shutdown (net::ip::tcp::socket::shutdown_type what, boost::system::error_code &ec)=0
 
virtual void close (boost::system::error_code &ec)=0
 
virtual net::ip::tcp::endpoint remote_endpoint (boost::system::error_code &ec) const =0
 

Detailed Description

An interface abstracting Boost.Asio's tcp::socket for testability. This is an internal interface used for dependency injection and mocking.

Definition at line 34 of file itcp_socket.hpp.

Constructor & Destructor Documentation

◆ ~TcpSocketInterface()

virtual unilink::interface::TcpSocketInterface::~TcpSocketInterface ( )
virtualdefault

Member Function Documentation

◆ async_read_some()

virtual void unilink::interface::TcpSocketInterface::async_read_some ( const net::mutable_buffer &  buffer,
std::function< void(const boost::system::error_code &, std::size_t)>  handler 
)
pure virtual

◆ async_write()

virtual void unilink::interface::TcpSocketInterface::async_write ( const net::const_buffer &  buffer,
std::function< void(const boost::system::error_code &, std::size_t)>  handler 
)
pure virtual

◆ close()

virtual void unilink::interface::TcpSocketInterface::close ( boost::system::error_code &  ec)
pure virtual

◆ remote_endpoint()

virtual net::ip::tcp::endpoint unilink::interface::TcpSocketInterface::remote_endpoint ( boost::system::error_code &  ec) const
pure virtual

◆ shutdown()

virtual void unilink::interface::TcpSocketInterface::shutdown ( net::ip::tcp::socket::shutdown_type  what,
boost::system::error_code &  ec 
)
pure virtual

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