-
Notifications
You must be signed in to change notification settings - Fork 466
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
Client Timing Out After 2 Minutes #106
Comments
Can you recreate this using the pure client library? |
Just on my phone so can't properly investigate right now but this could well be an issue with my fork as I haven't done much testing with the keep-alive mechanisms. Do you have a keepAliveInterval configured on the client, and the equivalent on the server? Failing to reconnect after 3 timeouts is odd in any case though. |
I was on the default The failure to reconnect is odd. If I set the |
@MattyK14 - I've just spotted that a fork of my fork by @clshortfuse has what looks like a better timer implementation (looks like he found a bug or two as well as using background timers). Perhaps you could give his fork a try? @clshortfuse - mind if I pull in your commits if all goes well? (PS: I've now enabled issues on my fork so any future issues specific to my RN version can be opened directly there) |
Go for it. I didn't have time to wrap it up, but it's working fine in my end so far. I did change the ping system IIRC, because I was having issues with the dual pinger system, so you have to watch for breaking changes. The specific reason for changing to native timers was because the JS stack seems to pause when the activity is pause. On ChromeOS, the JS timers wouldn't fire unless the activity had window focus. |
Cheers. I think the rationale behind two timers is:
Right now though it looks like the None of this really explains the problem @MattyK14 is seeing though ;). What server are you using @MattyK14? Are the messages getting through (both ways?) until the disconnect? Edit: The @jpwsutton - any idea what the intention was here? It doesn't make sense to me. |
I'm actually using the react native fork by @rh389 for the same reason @MattyK14 is, namely, for Amazon IoT. I'm more interested the actual error code returned by connectionLost. I know that if you try to perform an action not permitted by your Amazon IoT Policy, it will boot you off the Mqtt connection. Though, usually, you'll get a specific error code. Also, are you sure you are randomizing your Client IDs properly? I believe Amazon will also boot an Mqtt session if somebody else connects with the same Client ID. My bet is on that. Just for reference, this is the configuration I have working (with a few minor code changes):
Edit: As for the |
@clshortfuse I'm currently generating a random UUID for the Client Id. It times out at 2x the @rh389 Yes messages are successfully going both ways until the disconnect! I will try the fork hopefully later this week. Thanks for the input guys. |
After using @clshortfuse's fork I'm not getting timeouts anymore, but AWS IoT is closing the socket after 1.5x the I don't have a chance to pick through the source code, but I guess it's not sending the ping messages? |
This can be closed, I'm pretty sure it was just a RN fork issue - it's covered by robhogan#4 and now fixed. |
Currently using the
react-native
fork to connect to AWS IoT. After every 2 minutes of a connection, the client times out even if there are messages coming in or being published. In theconnectionLost
handler, if the error type is timeout I force it to reconnect but after 3 more reconnections it becomesError: AMQJS0007E Socket error: Unknown socket error.
@rh389
The text was updated successfully, but these errors were encountered: