引用网站https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-device-sdk-c-iothubclient我正在用C ++编写一个示例azzure iot代码,以便在linux和windows上运行。
当我在Ubutnu上运行示例代码时,每当调用IoTHubClient_LL_DoWork()API时,我都会遇到以下错误:
Error: Time:Thu May 10 23:56:23 2018 File:/home/azure/azure-iot-sdk-c/c-utility/adapters/httpapi_curl.c Func:HTTPAPI_ExecuteRequest Line:582 curl_easy_perform() failed: Out of memory
Error: Time:Thu May 10 23:56:23 2018 File:/home/azure/azure-iot-sdk-c/c-utility/adapters/httpapi_curl.c Func:HTTPAPI_ExecuteRequest Line:584 (result = HTTPAPI_OPEN_REQUEST_FAILED)
Error: Time:Thu May 10 23:56:23 2018 File:/home/azure/azure-iot-sdk-c/c-utility/src/httpapiex.c Func:HTTPAPIEX_ExecuteRequest Line:475 unable to recover sending to a working state
Error: Time:Thu May 10 23:56:23 2018 File:/home/azure/azure-iot-sdk-c/iothub_client/src/iothubtransporthttp.c Func:DoEvent Line:1684 unable to HTTPAPIEX_SAS_ExecuteRequest
Error: Time:Thu May 10 23:56:23 2018 File:/home/azure/azure-iot-sdk-c/c-utility/adapters/httpapi_curl.c Func:HTTPAPI_ExecuteRequest Line:582 curl_easy_perform() failed: Out of memory
Error: Time:Thu May 10 23:56:23 2018 File:/home/azure/azure-iot-sdk-c/c-utility/adapters/httpapi_curl.c Func:HTTPAPI_ExecuteRequest Line:584 (result = HTTPAPI_OPEN_REQUEST_FAILED)
Error: Time:Thu May 10 23:56:23 2018 File:/home/azure/azure-iot-sdk-c/c-utility/src/httpapiex.c Func:HTTPAPIEX_ExecuteRequest Line:475 unable to recover sending to a working state
Error: Time:Thu May 10 23:56:23 2018 File:/home/azure/azure-iot-sdk-c/iothub_client/src/iothubtransporthttp.c Func:DoMessages Line:2077 unable to HTTPAPIEX_SAS_ExecuteRequest
这些错误可能是什么原因以及如何摆脱它们?
答案 0 :(得分:0)
您是否检查过Linux上是否安装了OpenSSL,或者安装了什么版本?
我发现了一些关于此错误的类似主题,如下所示:
Initializing SSL and libcurl and getting "out of memory"
"CURLE_OUT_OF_MEMORY" error when posting via https
原因可能是由于在使用azure iothub divice客户端之前未使用SSL_library_init()初始化openSSL库。 即使我没有构建开发环境并重现错误,希望对您有所帮助。