Skip to content

Commit

Permalink
#343 async_client::try_consume_message_until taking single parameter …
Browse files Browse the repository at this point in the history
…fails to compile
  • Loading branch information
fpagliughi committed Nov 21, 2023
1 parent 02cf646 commit cd6dd12
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Version 1.3.0](https://github.com/eclipse/paho.mqtt.cpp/compare/v1.2.0..v1.3.0) - (2023-12-29)

- Fixed building and using library as DLL on Windows with MSVC
- Updated License to Eclipse Public License v2.0
- Updated create and connect options to better deal with MQTT protocol version
- Defaulting connect version to v5 if specified in create options.
Expand Down
2 changes: 1 addition & 1 deletion src/mqtt/async_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ class async_client : public virtual iasync_client
template <class Clock, class Duration>
const_message_ptr try_consume_message_until(const std::chrono::time_point<Clock,Duration>& absTime) {
const_message_ptr msg;
que_->try_get_until(msg, absTime);
que_->try_get_until(&msg, absTime);
return msg;
}

Expand Down
6 changes: 6 additions & 0 deletions test/unit/test_async_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -979,3 +979,9 @@ TEST_CASE("async_client unsubscribe many topics 3 args failure", "[client]")
REQUIRE(MQTTASYNC_DISCONNECTED == return_code);
}

TEST_CASE("async_client consumer timeout", "[client]")
{
// This just compiling shows #343 fixed.
async_client client{GOOD_SERVER_URI, CLIENT_ID};
client.try_consume_message_until(std::chrono::steady_clock::now());
}

0 comments on commit cd6dd12

Please sign in to comment.