Closed felipemomm closed 2 years ago
I don't think we can fix this issue in this project. We make use of plain sockets from .net framework only. The behavior of the operating system is not under our control.
Maybe you could translate the DNS name to the IP and pass the IP only to the MQTT client library? Then the lookup can be avoided.
I'm wondering if the .NET socket implementation on iOS is using POSIX sockets or the CFStream API. Anyone know? The gRPC project has identified similar issues with low-level TCP sockets on iOS.
Closing this issue since we cannot do much about it in this library.
Describe the bug
Everything works fine, I can connect to AWS using certificate, etc, however when I remove the internet cable from the router to simulate an internet loss and then I plug it again after 5 minutes, it takes too long to reconnect on iOS. In some cases I can even close the app, open it again and it still takes time to connect.
One option to overcome the issue is disconnecting from the Wifi and connecting it again, in this case, it reconnects fast.
For Android, it reconnects really fast and flawlessly.
I keep retrying every 5s and it throws "System.Net.Sockets.SocketException: Could not resolve host 'myAwsEndpoint'" and after 7-10 minutes, it suddenly reconnects.
In normal situations (without removing the cable, etc), it takes just a few seconds to connect to Aws.
Also, this only happens if the cable is removed. If I just disable the internet only for my iPad in my router admin panel and restore it after some minutes, it reconnects fast and flawlessly.
Is it a known Xamarin/iOS issue?
Which project is your bug related to?
To Reproduce
Steps to reproduce the behavior:
Expected behavior
It should re-connect as soon as possible, not more than a few seconds (that's what happens on Android).
Code example
Just calling: _mqttClient.ConnectAsync(options);
Stack Trace