In the last couple of days - we are seeing that the MQTT connection over websocket to AWS IOT is getting disconnected quite often and doesn't reconnect automatically.
By setting break points in the SDK code - I'm able to see that AWSSRWebsocket is receiving a stream end from server and following line in SDK code is triggered.
[self.delegate webSocket:self didCloseWithCode:AWSSRStatusCodeGoingAway reason:@"Stream end encountered" wasClean:NO];
The code AWSSRStatusCodeGoingAway has value 1001. As per the RFC 6455 - this should occur only if the server is down or in case of browser, if the user moves away from the page.
Also in the AWSIoTMQTTClient.m - above error is causing the - (void)session:(MQTTSession*)session handleEvent:(MQTTSessionEvent)eventCode to be invoked with event code - MQTTSessionEventConnectionClosed.
There is a reconnect timer in the mqtt client - But the reconnectToSession is not getting triggered.
If I explicitly connect back - it is getting connected for few more seconds.
Could this be a server side issue because the code on iOS app is almost 3-4 months old and this has been happening over last few days?
Hi @ramki982 ,
I saw your PR from here https://github.com/aws/aws-sdk-ios/pull/601. What you propose is correct. We are working on fix this and will release it in the future.
Thanks
In the last couple of days - we are seeing that the MQTT connection over websocket to AWS IOT is getting disconnected quite often and doesn't reconnect automatically.
By setting break points in the SDK code - I'm able to see that AWSSRWebsocket is receiving a stream end from server and following line in SDK code is triggered. [self.delegate webSocket:self didCloseWithCode:AWSSRStatusCodeGoingAway reason:@"Stream end encountered" wasClean:NO];
The code AWSSRStatusCodeGoingAway has value 1001. As per the RFC 6455 - this should occur only if the server is down or in case of browser, if the user moves away from the page.
Also in the AWSIoTMQTTClient.m - above error is causing the - (void)session:(MQTTSession*)session handleEvent:(MQTTSessionEvent)eventCode to be invoked with event code - MQTTSessionEventConnectionClosed.
There is a reconnect timer in the mqtt client - But the reconnectToSession is not getting triggered.
If I explicitly connect back - it is getting connected for few more seconds.
Could this be a server side issue because the code on iOS app is almost 3-4 months old and this has been happening over last few days?
thanks Ram