Arduino UNO WiFi keeps reconnecting to MQTT server

Hi! I have this problem with the uno wifi. It keeps reconnecting to the mqtt server.
Here’s the code based on the example provided by UnoWiFiDevEd library:

#include <Wire.h>
#include <UnoWiFiDevEd.h>

#define CONNECTOR “mqtt”
#define TOPIC “sensors/alerts”
#define BOARD_CONNECTED_CODE “101”

void setup() {
Ciao.begin();
}

void loop(){

delay(5000);
Ciao.write(CONNECTOR, TOPIC, BOARD_CONNECTED_CODE);
}

//Code Arduino Wifi

The board is connected to the internet through my router, I made sure of that.
I set broker.hivemq.com as broker to connect to in the settings panel.
All I get in the debug console is:

120473> MQTT: Connect to broker.hivemq.com:1883 0x3fff5da8
120475> MQTT: ip 35.156.1.237
120475> MQTT: connecting…
120529> MQTT: TCP connected to broker.hivemq.com:1883
120529> MQTT: Send type=TYPE_CONNECT id=0000 len=21
120608> MQTT: Recv type=CONNACK id=0000 len=4; Pend type=NULL id=00
120608> MQTT: Recv type=CONNACK id=0000 len=4; Pend type=NULL id=00
124515> MQTT: Connect to broker.hivemq.com:1883 0x3fff91a8
124535> MQTT: ip 52.58.157.180
124535> MQTT: connecting…
124617> MQTT: TCP connected to broker.hivemq.com:1883
124617> MQTT: Send type=TYPE_CONNECT id=0000 len=21
124674> MQTT: Disconnect CB, freeing espconn 0x3fff5da8
124674> MQTT: Disconnected from broker.hivemq.com:1883
124678> MQTT ERROR: recv in invalid state 1
124678> MQTT: Disconnecting from broker.hivemq.com:1883 (0x3fff91a8)
124678> MQTT: Disconnect CB, freeing espconn 0x3fff91a8
126515> MQTT: Connect to broker.hivemq.com:1883 0x3fff5da8
126516> MQTT: ip 35.156.1.237
126516> MQTT: connecting…
126570> MQTT: TCP connected to broker.hivemq.com:1883
126570> MQTT: Send type=TYPE_CONNECT id=0000 len=21
126640> MQTT: Recv type=CONNACK id=0000 len=4; Pend type=NULL id=00
126640> MQTT: Recv type=CONNACK id=0000 len=4; Pend type=NULL id=00

I am facing the same Problem with the Arduino Uno Wifi. Did you able to solve the Problem?

Waiting for an expert reply,

But this is my thoughts: I'm not an expert by any means. But I have been using MQTT with the Pub_Sub.client for a while now.

If I am not mistaken, it should reconnect thus keeping the connection "LIVE". Otherwise, after a period of time, your project will have to "log back in". Think of it as a timed ping just to keep the connection open.

As stated above, I could be way off.