53 :
public std::enable_shared_from_this<TcpConnection>
72 size_t maxAllowedUnsentAsyncMessages = MAX_UNSENT_ASYNC_MSG_COUNT);
87 boost_tcp_t::socket& Socket();
92 const boost_tcp_t::socket& Socket()
const;
99 void CloseConnection();
101 void StartAsyncRead();
118 size_t NumberOfUnsentAsyncMessages()
const;
125 void SetClosing(
bool closing);
130 bool IsClosing()
const;
132 void ProcessCloseSocket();
139 void AsyncReadFromSocket(
size_t amountToRead);
146 void ReadComplete(
const boost_sys::error_code& error,
size_t bytesReceived,
147 size_t bytesExpected);
157 bool IncrementUnsentAsyncCounter();
159 void DecrementUnsentAsyncCounter();
167 bool m_closing{
false};
173 size_t m_minAmountToRead{0};
185 size_t m_maxAllowedUnsentAsyncMessages{MAX_UNSENT_ASYNC_MSG_COUNT};
187 size_t m_numUnsentAsyncMessages{0};
196 #endif // TCPCONNECTION TcpConnections & m_connections
Reference to TCP connections object.
Definition: TcpConnection.h:171
boost_tcp_t::socket m_socket
TCP socket.
Definition: TcpConnection.h:189
std::function< size_t(const char_buffer_t &)> check_bytes_left_to_read_t
Typedef to bytes left to reading checking utility function object.
Definition: AsioDefines.h:288
File containing useful definitions.
std::function< void(const char_buffer_t &)> message_received_handler_t
Typedef to message received handler function object.
Definition: AsioDefines.h:290
std::mutex m_mutex
Access mutex for thread safety.
Definition: TcpConnection.h:163
Class defining a thread synchronisation event.
Definition: SyncEvent.h:70
The core_lib namespace.
Definition: AsioDefines.h:59
TCP connections class to manage the TcpConnection objects.
Definition: TcpConnections.h:52
eSendOption
Enumeration to control nagle algorithm.
Definition: AsioDefines.h:82
nagleOn - Send when possible.
boost_iocontext_t::strand m_strand
I/O context strand.
Definition: TcpConnection.h:169
std::pair< std::string, uint16_t > connection_t
Typedef describing a network connection as (address, port).
Definition: AsioDefines.h:152
boost_asio::io_context boost_iocontext_t
Boost IO context convenience typedef.
Definition: AsioDefines.h:46
File containing declaration of SyncEvent class.
TCP connection class.
Definition: TcpConnection.h:52
std::vector< char > char_buffer_t
Typedef to generic char buffer based on s std::vector<char>.
Definition: AsioDefines.h:239