This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

mqtt_client_tls_write hangs on writing to TLS socket send(client->transport.tls.sock....)

Hi,

We are using the modem firmware V1.2 and source code ncs v1.2.0.

Problem: we are using the TLS connected socket to amazon cloud and after about 12 minutes of doing:

```

waiting 2 min
connecting to MQTT
sending a few packets
disconnecting from MQTT

```

we get a hang on a specific call out of my reach:
File: mqtt_transport_socket_tls.c

Function: int mqtt_client_tls_write(struct mqtt_client *client, const u8_t *data, u32_t datalen)

Inside the function is a loop and a call here - which the source code isn't revealed for.
ret = send(client->transport.tls.sock, data + offset, datalen - offset, 0);

The last argument - flags - is set to 0 by Nordic, so if there is any problem sending, this call will hang forever.
Linux supports having MSG_DONTWAIT and returncodes to handle situations if they occur but now it's just not working.

We need a fix for this bug.
If the transmit fails, there needs to be a timeout so we can recover and not get hung, which kills the application calling.
If I can produce a trace or whatever needed for this let me know. We are running our custom code so it only works on our custom hw.

/Johan

Parents Reply Children
No Data
Related