Greetings,
I'm seeking your suggestions regarding an issue I've encountered.
I have compiled mosquitto version 2.0.18 with pthread and followed the workflow outlined below.
However, upon integrating the x64 release DLL, lib, and include files into my project. Then, Loop_start successfully does not return the code MOSQ_ERR_NOT_SUPPORTED.
However, I encountered an issue with the delayed sending of topics. Despite intending to send a topic (with QoS 2) every second, all messages are sent simultaneously each minute. Additionally, when publishing from a client
to my software (neither in MQTT Explorer), the message arrives after a minute, hinting at a potential timeout problem.
Interestingly, when using mosquitto_pub.exe and mosquitto_sub.exe, the published message is promptly received in the mosquitto_pub terminal. However, I do not receive it directly in my software.
Is this indicative of a problem with my mosquitto build?
Prior to compiling with pthread, I attempted to implement my own thread to handle the loop call every 10ms. However, I encountered sporadic failures during publishing with MOSQ_ERR_ERRNO and unknown reasons. Additionally,
the loop occasionally failed with MOSQ_ERR_ERRNO or other error codes, despite successful reconnections. Any insights or suggestions would be greatly appreciated.
😊
Regards,
Elodie
Building workflow:
Install VCPKG
Clone from
https://github.com/microsoft/vcpkg
bootstrap - vcpkg.bat
vcpkg install pthread:x86-windows
vcpkg install pthread:x64-windows
Set VCPKG in VisualStudio :
set VCPKG_ROOT="C:\path\to\vcpkg"
set PATH=%VCPKG_ROOT%;%PATH%
vcpkg integrate install
Dowload OpenSSL x64 and x86
Download mosquitto source
Configure and Generate VS project
Use Cmake-GUI
Add entry: CMAKE_HAVE_LIBC_PTHREAD BOOL, TRUE
Uncheck: Documentation
Configure OpenSSL entries
C:/Program Files/OpenSSL-Win64/include
C:/Program Files/OpenSSL-Win64
Notes: LibEAY becomes LibCrypto
C:/Program Files (x86)/OpenSSL-Win32/lib/VC/x86/MDd/libcrypto.lib
C:/Program Files (x86)/OpenSSL-Win32/lib/VC/x86/MD/libcrypto.lib
SSLEAY becomes LibSSL
C:/Program Files (x86)/OpenSSL-Win32/lib/VC/x86/MDd/libssl.lib
C:/Program Files (x86)/OpenSSL-Win32/lib/VC/x86/MD/libssl.lib
Use MD and MDd compil options
Configure CMAKE and then build.
Rebuild on Visual Studio
Configure CMAKE and then build.
Rebuild on Visual Studio
Elodie Salzemann
Ingénieure développement logiciel
EDAP TMS
4, rue du Dauphiné - 69120 Vaulx-en-Velin, FRANCE
Tel. +33 (0)4 72 15 31 50 - Fax +33(0)4 72 15 31 51