Azure-iot-sdk-c: Error in tlsio_openssl.c - after closing SSH session to a device via device streams

Created on 4 Jan 2021  路  4Comments  路  Source: Azure/azure-iot-sdk-c

Development Machine, OS, Compiler (and Other Relevant Toolchain Info)

Linux ${mydevice} 4.15.0-1098-azure #109~16.04.1-Ubuntu SMP Wed Sep 30 18:53:14 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

SDK Version (Please Give Commit SHA if Manually Compiling)

git log:
commit c3711e52123062a447f0c9aeaa0d4fadc997fc7e
Author: Ewerton Scaboro da Silva ewertons@microsoft.com
Date: Tue Dec 15 09:36:39 2020 -0800

Describe the Bug

after the issue #1767 we have the the issue, that after we close the session, the program stops with an error

steps

  • start on the device "iothub_client_c2d_streaming_proxy_sample"
  • start on the client "Quickstarts\device-streams-service\proxy.js"
  • start putty to connect
  • login
  • exit

log on the device
${myuser}@${mydevice}:~/${somepath}/iothub_client_c2d_streaming_proxy_sample$ ./iothub_client_c2d_streaming_proxy_sample
-> 15:35:51 CONNECT | VER: 4 | KEEPALIVE: 240 | FLAGS: 192 | USERNAME: ${myiothubname}.azure-devices.net/${mydeviceid}/?api-version=2020-09-30&DeviceClientType=iothubclient%2f1.6.0%20(native%3b%20Linux%3b%20x86_64) | PWD: XXXX | CLEAN: 0
<- 15:35:52 CONNACK | SESSION_PRESENT: true | RETURN_CODE: 0x0
-> 15:35:52 SUBSCRIBE | PACKET_ID: 2 | TOPIC_NAME: $iothub/streams/POST/# | QOS: 0 | TOPIC_NAME: $iothub/streams/res/# | QOS: 0
<- 15:35:52 SUBACK | PACKET_ID: 2 | RETURN_CODE: 0 | RETURN_CODE: 0
<- 15:36:07 PUBLISH | IS_DUP: false | RETAIN: 0 | QOS: QOS_VALUE_INVALID | TOPIC_NAME: $iothub/streams/POST/TestStream/?$rid=1&$url=wss%3A%2F%2Fdb-001.northeurope-001.streams.azure-devices.net%3A443%2Fbridges%2Fih%2FIoT${myiothubname}%2Fd%2F${mydeviceid}%2Fsid%2F9fabf543585148b382c6f473da874c2e%2Fr%2Fdevice&$auth=${somesecrettoken} | PAYLOAD_LEN: 0
Received stream request (TestStream)
-> 15:36:07 PUBLISH | IS_DUP: false | RETAIN: 0 | QOS: DELIVER_AT_MOST_ONCE | TOPIC_NAME: $iothub/streams/res/200/?$rid=1
Client connected to the streaming gateway (WS_OPEN_OK)
Reporting traffic statistics every 10 seconds.
[2021-01-04 15:36:08 UTC+0000] Network traffic (in bytes) (sent=0; received=28)
[2021-01-04 15:36:18 UTC+0000] Network traffic (in bytes) (sent=7162; received=3376)
on_ws_peer_closed ()
Error: Time:Mon Jan 4 15:36:18 2021 File:/home/demouser/azure-iot-sdk-c/c-utility/adapters/tlsio_openssl.c Func:decode_ssl_received_bytes Line:876 SSL channel closed in decode_ssl_received_bytes.
Error: Time:Mon Jan 4 15:36:18 2021 File:/home/demouser/azure-iot-sdk-c/c-utility/adapters/tlsio_openssl.c Func:on_underlying_io_bytes_received Line:925 Error in decode_ssl_received_bytes.
-> 15:36:18 DISCONNECT
Press any key to continue

log on the windows client

initiating stream
results received from the device: {
"authorizationToken": "${somesecrettoken} ",
"isAccepted": true,
"uri": "wss://db-001.northeurope-001.streams.azure-devices.net:443/bridges/ih/${myiothubname}/d/${mydeviceid}/sid/${mysid}/r/service"
}
got websocket - creating local server on port 2222
client socket disconnected

IoTSDK device-streaming question

All 4 comments

Hi @gerhard67 ,
this is the behavior for this sample by default.
It demonstrates how an end-to-end connection can happen between endpoints of independent applications with the data flowing through the Streaming Gateway.
However the sample was not designed to be a application to run constantly.
If a customer would like to change its behavior they would need to modify how the g_continueRunning is set (within on_ws_peer_closed) and make the necessary adjustments for the code to be able to accept successive connections.
If that is what you are requesting, that would be an enhancement to the original goal of the sample.

Hi @geebinge . Do you have any other questions regarding this? Thanks.

Hi @geebinge . Do you have any other questions regarding this? Thanks.

Hi Mollie, I have done with Ewerton some home exercise. For this topic I'm fine.

Thanks @geebinge

Was this page helpful?
0 / 5 - 0 ratings