Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows MSYS2 MINGW64: Examples fail with "MQTT_ERROR_SOCKET_ERROR" or "Failed to open socket: : No error" #188

Open
KlausMu opened this issue Mar 7, 2024 · 0 comments

Comments

@KlausMu
Copy link

KlausMu commented Mar 7, 2024

Hi,
I am able to compile and run all the tests in WSL2.

With Windows and msys2 mingw64 examples also compile.
./tests works well

./bio_publisher <IP of broker> 1883 test
gives
MQTT_ERROR_SOCKET_ERROR

./simple_publisher <IP of broker> 1883 test
gives
Failed to open socket (getaddrinfo): Die Anwendung hat die Funktion WSAStartup nicht aufgerufen, oder bei dieser Funktion ist ein Fehler aufgetreten. Failed to open socket: : No error

In case of BIO, I could track it down to file mqtt_pal.c line 402
ssize_t tmp = send(fd, (char*)buf + sent, len - sent, flags);
send returns with -1

I don't understand exactly what send is doing, but my guess is that this is a call to some winsock binary.
Do you have any advice on what to do?

Thanks in advance

Edit: this also happens when using
./bio_publisher test.mosquitto.org 1883 test
Isn't this exactly what the test is doing? Why does only bio_publisher fail, but test succeeds?

@KlausMu KlausMu changed the title Windows MSYS2 MINGW64: "MQTT_ERROR_SOCKET_ERROR" or "Failed to open socket: : No error" Windows MSYS2 MINGW64: Examples fail with "MQTT_ERROR_SOCKET_ERROR" or "Failed to open socket: : No error" Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant