48 std::shared_ptr<logging::Logger> logger)
58 std::optional<messages::MessageID>
id = std::nullopt) {
74 logger_,
"No connection now, so wait for connection.");
82 if (
is_sending_.exchange(
true, std::memory_order_acquire)) {
87 connection->async_send(*message);
97 is_sending_.store(
false, std::memory_order_release);
105 is_sending_.store(
false, std::memory_order_release);
119 return connector->connection();
SentMessageQueue sent_messages_
Queue of messages to be sent.
void handle_sent_message()
Handle a sent message.
void send_next()
Send the next message if possible.
void handle_disconnection()
Handle disconnection.
void send(messages::SerializedMessage message, std::optional< messages::MessageID > id=std::nullopt)
Send a message.
MessageSender(std::weak_ptr< ClientConnector > connector, std::shared_ptr< logging::Logger > logger)
Constructor.
std::shared_ptr< transport::IConnection > get_connection()
Get the connection.
std::shared_ptr< logging::Logger > logger_
Logger.
std::weak_ptr< ClientConnector > connector_
Connector.
std::atomic< bool > is_sending_
Whether this client is sending a message.
Class of queues of messages to be sent.
Class of serialized message data.
Definition of ClientConnector class.
Definition of IConnection class.
Definition of Logger class.
#define MSGPACK_RPC_TRACE(LOGGER_PTR,...)
Write a trace log.
Definition of MessageID type.
Namespace of internal implementations.
Definition of SentMessageQueue class.
Definition of SerializedMessage class.