Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mosquitto-dev] Building 2.0.18 with thread support - delayed topic sending

Hi Elodie,

It's only the "mosquitto_pub -l" mode that makes use of threads,
mosquitto_sub doesn't use them, so your test likely doesn't indicate they
are working and your code is not.

I have just tested on Windows using "mosquitto_sub -t '#' -v" and
"mosquitto_pub -t test -l", then typing lines on the mosquitto_pub command
line. Each line was received straight away on the subscriber.

This was using the build from
https://github.com/eclipse/mosquitto/actions/runs/8861639343 - for some
reason you have to be logged in to github to be able to download it. The
version number shows as 2.0.18, but there are a few extra fixes not in
2.0.18.

Regards,

Roger

On Thu, 11 Apr 2024, 09:28 Elodie SALZEMANN via mosquitto-dev, <
mosquitto-dev@xxxxxxxxxxx> wrote:

> 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
>
>    - Configure on win32
>
> 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 on x64
>
> Configure CMAKE and then build.
>
> Rebuild on Visual Studio
>
>
>
>
>
> _______________________________________________
> mosquitto-dev mailing list
> mosquitto-dev@xxxxxxxxxxx
> To unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/mosquitto-dev
>


Back to the top