-
Notifications
You must be signed in to change notification settings - Fork 888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
An error occurs when the MQTT connection is disconnected #5485
Comments
Hi @LWEN999, thanks for reaching out. Could you please clarify what exactly is the issue or what you want to know? Reading the code, a WebSocket status with code 1001 is mapped to the This is expected. If you want to get more information about this situation, you can enable verbose logging by doing the following: AWSDDLog.sharedInstance.logLevel = .verbose
AWSDDLog.add(AWSDDOSLogger.sharedInstance) |
Currently, after creating an MQTT connection using the SDK, it is found that there are frequent automatic disconnections and reconnections. What causes this? How do you fix it? |
As I mentioned, you're getting those reconnections because the app is receiving |
2025-01-01 14:24:06:488 wuwei-Dev[64510:7677340] WebSocket closed with code:1001 with reason:Stream end encountered Can we find out the cause from the above log? |
Please attach the full logs, i.e. also the entries leading up to On a related note, I've found a SO post with a similar issue that states:
Perhaps this is what's affecting you. |
2025-01-04 12:45:46:100 wuwei-Dev[9497:8946842] AWSIoTMQTTClient: connecting via websocket. Currently, only the above logs are printed |
Describe the bug
After the MQTT connection is established, the listener disconnects and reconnects after a few seconds, and the printed log is
2024-12-29 16:04:44:732 [26786:5024730] WebSocket closed with code:1001 with reason:Stream end encountered
2024-12-29 16:04:44:734 [26786:5024992] MQTT session error, code: 2
2024-12-29 16:04:44:735 [26786:5024992] closing encoder stream.
2024-12-29 16:04:44:735 [26786:5024992] closing decoder stream.
Device: [iPhone16 pro, Simulator]
The text was updated successfully, but these errors were encountered: