A simple TCP/IP socket wrapper using boost::asio.
More...
#include <socket_client_manager.hpp>
|
template<class ConnPol > |
| client_manager (std::size_t min_message_size, std::size_t max_message_size, unsigned short timeout, typename socket_t::socket_priority priority, std::size_t incoming_cpu, ConnPol const &conn_pol) |
| Create a new connection to the specified TCP socket using the TCP/IP protocol. More...
|
|
template<class MsgT > |
void | write (MsgT const &message) |
| Write the whole message to the socket in one go. More...
|
|
template<class MsgT > |
void | read (MsgT &dest) |
| Read the whole message from the socket in one go. More...
|
|
template<class V , std::size_t SrcSz> |
void | read (V(&dest)[SrcSz]) |
| Read the whole message from the socket in one go. More...
|
|
void | stop () |
|
socket_t & | socket () noexcept(true) |
|
std::string | to_string () const noexcept(false) |
|
template<class LkT>
class jmmcg::socket::asio::client_manager< LkT >
A simple TCP/IP socket wrapper using boost::asio.
Definition at line 83 of file socket_client_manager.hpp.
◆ socket_t
◆ client_manager()
template<class LkT >
template<class ConnPol >
Create a new connection to the specified TCP socket using the TCP/IP protocol.
- Parameters
-
min_message_size | The smallest size of message that shall be sent or received using the socket. |
max_message_size | The largest size of message that shall be sent or received using the socket. |
timeout | The linger timeout in seconds. |
conn_pol | The connection policy that may be applied to attempt to connect to the specified endpoint. |
Definition at line 77 of file socket_client_manager_impl.hpp.
◆ read() [1/2]
template<class LkT >
template<class MsgT >
Read the whole message from the socket in one go.
- Parameters
-
dest | The message will be placed into this buffer, which may be grown to accommodate the message. |
Definition at line 96 of file socket_client_manager_impl.hpp.
◆ read() [2/2]
template<class LkT >
template<class V , std::size_t SrcSz>
Read the whole message from the socket in one go.
- Parameters
-
dest | The message will be placed into this stack-based buffer, which must be sufficiently large to accommodate the message read, otherwise UB will result. |
Definition at line 102 of file socket_client_manager_impl.hpp.
◆ socket()
◆ stop()
◆ to_string()
◆ write()
template<class LkT >
template<class MsgT >
Write the whole message to the socket in one go.
- Parameters
-
message | The message to write, that must be as-if a POD. |
Definition at line 90 of file socket_client_manager_impl.hpp.
The documentation for this class was generated from the following files: