MQTT-C
MQTT-C copied to clipboard
Windows MSYS2 MINGW64: Examples fail with "MQTT_ERROR_SOCKET_ERROR" or "Failed to open socket: : No error"
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?