Ant*_*amp 5 mqtt iot react-native
我有一个React-native应用程序,我需要通过websockets与IoT(AWS)连接.我目前使用包react-native-paho-mqtt连接我的应用程序.这是我的代码:
function getClient(onConnect, onConnectionFailed, onConnectionLost,
onMessageArrived) {
logger.trace('getClient()');
const clientID = uuidV4();
// Create a client instance
const client = new Paho.MQTT.Client(signedUrl, clientID); // eslint-disable-line no-undef
// set callback handlers
client.onConnectionLost = onConnectionLost;
client.onMessageArrived = onMessageArrived;
// connect the client
client.connect({
keepAliveInterval: 15,
onSuccess: onConnect,
onFailure: onConnectionFailed,
});
return client;
}
Run Code Online (Sandbox Code Playgroud)
在我的主连接后5分钟,当我尝试连接其他客户端时出现错误.我收到这个错误:AMQJS0007E Socket error:{0}..我没有关于错误的更多信息.
有谁知道发生了什么或如何解决这个问题?
| 归档时间: |
|
| 查看次数: |
345 次 |
| 最近记录: |