@@ -283,7 +283,7 @@ namespace signalr
283283 auto transport = connection->m_transport_factory ->create_transport (
284284 transport_type::websockets, connection->m_logger , connection->m_signalr_client_config );
285285
286- transport->on_receive ([disconnect_cts, connect_request_done, connect_request_lock, logger, weak_connection, callback](const std::string& message, std::exception_ptr exception)
286+ transport->on_receive ([disconnect_cts, connect_request_done, connect_request_lock, logger, weak_connection, callback](std::string& & message, std::exception_ptr exception)
287287 {
288288 if (exception == nullptr )
289289 {
@@ -298,7 +298,7 @@ namespace signalr
298298 auto connection = weak_connection.lock ();
299299 if (connection)
300300 {
301- connection->process_response (message);
301+ connection->process_response (std::move ( message) );
302302 }
303303 }
304304 else
@@ -433,19 +433,19 @@ namespace signalr
433433 });
434434 }
435435
436- void connection_impl::process_response (const std::string& response)
436+ void connection_impl::process_response (std::string& & response)
437437 {
438438 m_logger.log (trace_level::messages,
439439 std::string (" processing message: " ).append (response));
440440
441- invoke_message_received (response);
441+ invoke_message_received (std::move ( response) );
442442 }
443443
444- void connection_impl::invoke_message_received (const std::string& message)
444+ void connection_impl::invoke_message_received (std::string& & message)
445445 {
446446 try
447447 {
448- m_message_received (message);
448+ m_message_received (std::move ( message) );
449449 }
450450 catch (const std::exception &e)
451451 {
@@ -618,7 +618,7 @@ namespace signalr
618618 return m_connection_id;
619619 }
620620
621- void connection_impl::set_message_received (const std::function<void (const std::string&)>& message_received)
621+ void connection_impl::set_message_received (const std::function<void (std::string& &)>& message_received)
622622 {
623623 ensure_disconnected (" cannot set the callback when the connection is not in the disconnected state. " );
624624 m_message_received = message_received;
0 commit comments