I have a React-native application that I need to connect using IoT (AWS) using websockets. I am currently using the react-native-paho-mqtt package to connect my application. Here is my code:
function getClient(onConnect, onConnectionFailed, onConnectionLost,
onMessageArrived) {
logger.trace('getClient()');
const clientID = uuidV4();
const client = new Paho.MQTT.Client(signedUrl, clientID);
client.onConnectionLost = onConnectionLost;
client.onMessageArrived = onMessageArrived;
client.connect({
keepAliveInterval: 15,
onSuccess: onConnect,
onFailure: onConnectionFailed,
});
return client;
}
5 minutes after my main connection, I get an error message when I try to connect another client. I get this error: AMQJS0007E Socket error:{0}.. I no longer have error information.
Does anyone know what is happening or how to solve this problem?
source
share