Azure / azure-c-shared-utility

Azure C SDKs common code
Other
111 stars 203 forks source link

socketio_berkeley: recv with MSG_NOSIGNAL causes errno 22 (EINVAL) #605

Closed AndWass closed 1 year ago

AndWass commented 1 year ago

Version: 9e4322c9d88095ed276bf7e4b31b87b82b1c4d86 (used by azure-iot-sdk-c LTS_07_2022_Ref02)

System information: Linux Yocto with kernel 3.18.140

Error output:

[error][azure-iot-sdk-c/c-utility/adapters/socketio_berkeley.c] [socketio_dowork:1068]: Socketio_Failure: Receiving data from endpoint: errno=22.
[error] IoT hub sdk: [azure-iot-sdk-c/umqtt/src/mqtt_client.c] [onOpenComplete:452]: Error: failure opening connection to endpoint
[info] IoT hub: connection status: result = IOTHUB_CLIENT_CONNECTION_UNAUTHENTICATED, reason = IOTHUB_CLIENT_CONNECTION_NO_NETWORK

Manually patching the recv call to pass 0 as flags instead of MSG_NOSIGNAL does not yield the error above and communication is starting to work.

danewalton commented 1 year ago

Hi @AndWass I'll respond on the PR itself and we can discuss the scenario there.