28 #ifndef SIMPLETCPCLIENT 29 #define SIMPLETCPCLIENT 74 size_t maxAllowedUnsentAsyncMessages = MAX_UNSENT_ASYNC_MSG_COUNT,
75 size_t memPoolMsgCount = 0);
99 size_t maxAllowedUnsentAsyncMessages = MAX_UNSENT_ASYNC_MSG_COUNT,
100 size_t memPoolMsgCount = 0);
120 bool Connected()
const;
130 void CloseConnection();
139 SendMessageToServerAsync(int32_t messageId,
148 bool SendMessageToServerSync(int32_t messageId,
180 template <
typename T,
typename A = serialize::archives::out_port_bin_t>
184 return m_tcpTypedClient.SendMessageToServerAsync<T, A>(message, messageId, responseAddress);
195 template <
typename T,
typename A = serialize::archives::out_port_bin_t>
199 return m_tcpTypedClient.SendMessageToServerSync<T, A>(message, messageId, responseAddress);
217 size_t NumberOfUnsentAsyncMessages()
const;
232 #endif // SIMPLETCPCLIENT std::function< void(default_received_message_ptr_t)> default_message_dispatcher_t
Typedef to default message dispatcher function object.
Definition: AsioDefines.h:286
Default message handler class.
Definition: MessageUtils.h:55
bool SendMessageToServerAsync(const T &message, int32_t messageId, const defs::connection_t &responseAddress=defs::NULL_CONNECTION)
Send a full message to the server asynchronously.
Definition: SimpleTcpClient.h:181
The core_lib namespace.
Definition: AsioDefines.h:59
A generic bi-directional TCP client.
Definition: TcpTypedClient.h:57
eSendOption
Enumeration to control nagle algorithm.
Definition: AsioDefines.h:82
TcpTypedClient< messages::MessageBuilder > m_tcpTypedClient
Our actual typed TCP client object.
Definition: SimpleTcpClient.h:225
A simple bi-directional TCP client, which uses the class MessageHeader as the message header type...
Definition: SimpleTcpClient.h:45
nagleOn - Send when possible.
std::pair< std::string, uint16_t > connection_t
Typedef describing a network connection as (address, port).
Definition: AsioDefines.h:152
File containing TCP typed client class declaration.
bool SendMessageToServerSync(const T &message, int32_t messageId, const defs::connection_t &responseAddress=defs::NULL_CONNECTION)
Send a full message to the server synchronously.
Definition: SimpleTcpClient.h:196
boost_asio::io_context boost_iocontext_t
Boost IO context convenience typedef.
Definition: AsioDefines.h:46
Default message builder class.
Definition: MessageUtils.h:268
std::vector< char > char_buffer_t
Typedef to generic char buffer based on s std::vector<char>.
Definition: AsioDefines.h:239
const connection_t NULL_CONNECTION
Constant defining a null network connection as ("0.0.0.0", 0).