How to recieve data from Cloud MQTT

hello ravi…your tutorials are way better than others…
actually i am using esp8266 as a mqtt client to upload some data on cloudMQTT server but my problem is that TCP connection gets closed after some time automatically…but this is not the main concern because i know when to send data on cloud so i can establish tcp connection whenever i want… but how can my esp8266 can continuously receive data coming from cloudMQTT…and how can i establish tcp connection forever so that esp8266 won’t miss any data coming from cloudMQTT???

@shitaltestemb This thread may help you. Look at this in ESP8266 Community Forum-

1 Like

Try what @Gangadhar mentioned above.
If that doesnt fix it, You can try sending Ping requests to MQTT broker so that broker keeps connection active. Check for MQTT PING control packets.