diff --git a/src/TinyMqtt.cpp b/src/TinyMqtt.cpp index 7a4f49d..f6fe9fe 100644 --- a/src/TinyMqtt.cpp +++ b/src/TinyMqtt.cpp @@ -271,6 +271,17 @@ void MqttClient::loop() // there is no need to send one PingReq per instance. } } +#ifndef TCP_ASYNC + while(client && client->available()>0) + { + message.incoming(client->read()); + if (message.type()) + { + processMessage(&message); + message.reset(); + } + } +#endif } void MqttClient::onConnect(void *mqttclient_ptr, TcpClient*)