Compare commits

...

8 Commits

Author SHA1 Message Date
fpagliughi
8ef1a1e73b #547 Fixed up some of the v5 examples for proper connect options
Some checks are pending
CMake on multiple platforms / build (Debug, cl, cl, windows-latest) (push) Waiting to run
CMake on multiple platforms / build (Debug, clang, clang++, ubuntu-latest) (push) Waiting to run
CMake on multiple platforms / build (Debug, gcc, g++, ubuntu-latest) (push) Waiting to run
CMake on multiple platforms / build (Release, cl, cl, windows-latest) (push) Waiting to run
CMake on multiple platforms / build (Release, clang, clang++, ubuntu-latest) (push) Waiting to run
CMake on multiple platforms / build (Release, gcc, g++, ubuntu-latest) (push) Waiting to run
2025-05-15 20:05:19 -04:00
fpagliughi
6a1c354df4 Fixed build error after merging maintanence branches. 2025-05-15 17:03:29 -04:00
fpagliughi
3a6fa27d70 Merge branch 'master' into develop 2025-05-15 16:54:19 -04:00
Laurenz Altenmüller
32f75ac62f update TEST_EXTERNAL_SERVER urls
Signed-off-by: Laurenz Altenmüller <git@laure.nz>
2025-05-15 16:53:49 -04:00
Laurenz Altenmüller
dd32cb56f7 Enable build with macOS STL
Signed-off-by: Laurenz Altenmüller <git@laure.nz>
2025-05-15 16:53:46 -04:00
fpagliughi
074917c077 #378 Fixed in the master branch for v1.5.x, from a64d1109cb 2025-05-15 16:49:57 -04:00
Frank Pagliughi
4c7f15d3b9
Merge pull request #544 from frwilckens/master
ssl_options: use std::vector<unsigned char> for the ALPN protocol list in wire format
2025-05-15 16:49:13 -04:00
Friedrich Wilckens
a11ac479be ssl_options: use std::vector<unsigned char> for the ALPN protocol list in wire format
The library used std::basic_string<unsigned char> which requires std::char_traits<unsigned char> and is technically not defined by the standard. libc++ no longer supports it as of LLVM 19.

Signed-off-by: Friedrich Wilckens <frwilckens@gmail.com>
2025-03-16 10:22:38 -07:00
6 changed files with 6 additions and 10 deletions

View File

@ -43,7 +43,6 @@ using namespace std;
const string DFLT_SERVER_URI{"mqtt://localhost:1883"};
const string CLIENT_ID{"PahoCppAsyncConsumeV5"};
// const string TOPIC{"hello"};
const string TOPIC{"#"};
const int QOS = 1;

View File

@ -193,9 +193,7 @@ int main(int argc, char* argv[])
mqtt::async_client cli(serverURI, CLIENT_ID);
auto connOpts = mqtt::connect_options_builder::v5()
.clean_start(true)
.finalize();
auto connOpts = mqtt::connect_options_builder::v5().clean_start(true).finalize();
// Install the callback(s) before connecting.
callback cb(cli, connOpts);

View File

@ -76,7 +76,7 @@ int main(int argc, char* argv[])
// Set up the connect options
auto connOpts = mqtt::connect_options_builder()
auto connOpts = mqtt::connect_options_builder::v5()
.properties({{mqtt::property::SESSION_EXPIRY_INTERVAL, 604800}})
.clean_start(false)
.will(std::move(lwt))

View File

@ -90,10 +90,9 @@ double mult(const std::vector<double>& nums)
int main(int argc, char* argv[])
{
mqtt::create_options createOpts(MQTTVERSION_5);
mqtt::client cli(SERVER_ADDRESS, CLIENT_ID, createOpts);
mqtt::client cli(SERVER_ADDRESS, CLIENT_ID);
auto connOpts = mqtt::connect_options_builder()
auto connOpts = mqtt::connect_options_builder::v5()
.keep_alive_interval(seconds(20))
.clean_start()
.finalize();

View File

@ -84,7 +84,7 @@ int main(int argc, char* argv[])
{
auto serverURI = (argc > 1) ? std::string{argv[1]} : DFLT_SERVER_URI;
mqtt::client cli(serverURI, CLIENT_ID, mqtt::create_options(MQTTVERSION_5));
mqtt::client cli(serverURI, CLIENT_ID);
auto connOpts = mqtt::connect_options_builder::v5()
.automatic_reconnect(seconds(2), seconds(30))

View File

@ -1,6 +1,6 @@
/*******************************************************************************
* Copyright (c) 2016 Guilherme Ferreira <guilherme.maciel.ferreira@gmail.com>
* Copyright (c) 2016-2021 Frank Pagliughi <fpagliughi@mindspring.com>
* Copyright (c) 2016-2025 Frank Pagliughi <fpagliughi@mindspring.com>
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0