In the case where the device is offline and cannot connect this code runs about 1/minute and fails immediately with "TCP/TLS connect failure". After a few tries however it gets stuck inside AsyncClient::new() which never returns.
Looking at the AsyncClient code it isn't clear where it is getting stuck.
I have the following code to initialize mqtt: (Note: I have broken create_client() into its calls to help identify where it is stuck)
In the case where the device is offline and cannot connect this code runs about 1/minute and fails immediately with "TCP/TLS connect failure". After a few tries however it gets stuck inside AsyncClient::new() which never returns.
Looking at the AsyncClient code it isn't clear where it is getting stuck.