Skip to content
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

CubeConnect can't be reconnected automatically when connection is lost #44

Closed
thang510023 opened this issue Dec 4, 2020 · 13 comments
Closed

Comments

@thang510023
Copy link

Hi! I used your chat_sample, login and created chat successfully. Then I tried to turn off Wifi and turn it on again, but it didn't reconnect automatically, it became a loop with the following states:
CubeChatConnection: Chat connection ForcefullyClosed
CubeChatConnection: Chat connection Reconnecting
CubeChatConnection: Chat connection SocketOpening
CubeChatConnection: Chat connection SocketOpened
CubeChatConnection: Chat connection Authenticated
CubeChatConnection: Chat connection ForcefullyClosed
CubeChatConnection: Chat connection Reconnecting
CubeChatConnection: Chat connection SocketOpening
CubeChatConnection: Chat connection SocketOpened

Logs:

[log] ---Xmpp Sending:---
[log] <r xmlns="urn:xmpp:sm:3"/>
[log] ---Xmpp Receiving:---
[log] <a xmlns='urn:xmpp:sm:3' h='6'/>
[log] D/[Connection]: Handle Secured Error  SocketException: OS Error: Software caused connection abort, errno = 103, address = chat.connectycube.com, port = 49388
[log] D/[Connection]: State: XmppConnectionState.ForcefullyClosed
[log] D/[Connection]: Handle secured connection done
[log] D/[Connection]: State: XmppConnectionState.ForcefullyClosed
[log] D/[ReconnectionManager]: Connection forcefully closed!
[log] D/[ReconnectionManager]: TimeOut is: 10000 reconnection counter 0
I/flutter (27784): CB-SDK: CubeChatConnection: Chat connection ForcefullyClosed
[log] D/[ReconnectionManager]: Connection forcefully closed!
I/flutter (27784): CB-SDK: CubeChatConnection: Chat connection ForcefullyClosed
[log] D/[ReconnectionManager]: TimeOut is: 20000 reconnection counter 1
E/flutter (27784): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: SocketException: OS Error: Software caused connection abort, errno = 103, address = chat.connectycube.com, port = 49388
E/flutter (27784): 
[log] D/[Connection]: State: XmppConnectionState.Reconnecting
I/flutter (27784): CB-SDK: CubeChatConnection: Chat connection Reconnecting
[log] D/[Connection]: State: XmppConnectionState.SocketOpening
I/flutter (27784): CB-SDK: CubeChatConnection: Chat connection SocketOpening
[log] D/[Connection]: State: XmppConnectionState.SocketOpened
[log] ---Xmpp Sending:---
I/flutter (27784): CB-SDK: CubeChatConnection: Chat connection SocketOpened
[log] <?xml version='1.0'?>
<stream:stream xmlns='jabber:client' version='1.0' xmlns:stream='http://etherx.jabber.org/streams'
to='chat.connectycube.com'
xml:lang='en'
>

[log] ---Xmpp Receiving:---
[log] <?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' from='chat.connectycube.com' id='ee529c25-8474-4624-affc-e2016c214b01' version='1.0' xml:lang='en'>
[log] D/[Connection]: processInitialStream
[log] ---Xmpp Receiving:---
[log] <stream:features><sm xmlns="urn:xmpp:sm:3"/><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>PLAIN</mechanism><mechanism>ANONYMOUS</mechanism><mechanism>PLAIN_FAST</mechanism></mechanisms><ver xmlns="urn:xmpp:features:rosterver"/><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression></stream:features>
[log] D/[ConnectionNegotiatorManager]: Negotiating features
[log] D/[ConnectionNegotiatorManager]: Found matching negotiator true
[log] D/[StartTlsNegotiator]: negotiating starttls
[log] ---Xmpp Sending:---
[log] <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/>
[log] D/[ConnectionNegotiatorManager]: ACTIVE FEATURE: {name: StartTlsNegotiator, name_space: urn:ietf:params:xml:ns:xmpp-tls, priority: 1, state: NegotiatorState.NEGOTIATING}, isReady: true
[log] ---Xmpp Receiving:---
[log] <proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls"/>
[log] D/[Connection]: startSecureSocket
[log] ---Xmpp Sending:---
[log] <?xml version='1.0'?>
<stream:stream xmlns='jabber:client' version='1.0' xmlns:stream='http://etherx.jabber.org/streams'
to='chat.connectycube.com'
xml:lang='en'
>

[log] ---Xmpp Receiving:---
[log] <?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' from='chat.connectycube.com' id='ee529c25-8474-4624-affc-e2016c214b01' version='1.0' xml:lang='en'>
[log] D/[Connection]: processInitialStream
[log] ---Xmpp Receiving:---
[log] <stream:features><sm xmlns="urn:xmpp:sm:3"/><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>PLAIN</mechanism><mechanism>ANONYMOUS</mechanism><mechanism>PLAIN_FAST</mechanism></mechanisms><ver xmlns="urn:xmpp:features:rosterver"/><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression></stream:features>
[log] D/[ConnectionNegotiatorManager]: Negotiating features
[log] D/[ConnectionNegotiatorManager]: Found matching negotiator true
[log] ---Xmpp Sending:---
[log] <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="PLAIN">ADI4OTk1MjctNDc2ADEyMzQ1Njc4OTA=</auth>
[log] D/[ConnectionNegotiatorManager]: ACTIVE FEATURE: {name: SaslAuthenticationFeature, name_space: null, priority: 1000, state: NegotiatorState.NEGOTIATING}, isReady: true
[log] ---Xmpp Receiving:---
[log] <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl"/>
I/flutter (27784): CB-SDK: CubeChatConnection: Chat connection Authenticated
[log] ---Xmpp Sending:---
[log] <?xml version='1.0'?>
<stream:stream xmlns='jabber:client' version='1.0' xmlns:stream='http://etherx.jabber.org/streams'
to='chat.connectycube.com'
xml:lang='en'
>

[log] D/[Connection]: State: XmppConnectionState.Authenticated
[log] D/[ConnectionNegotiatorManager]: Found matching negotiator true
[log] ---Xmpp Sending:---
[log] <resume xmlns="urn:xmpp:sm:3" h="6" id="926f0b10-a20a-4127-8c5e-8ada4bd03720"/>
[log] D/[ConnectionNegotiatorManager]: ACTIVE FEATURE: {name: StreamManagementModule, name_space: null, priority: 1000, state: NegotiatorState.NEGOTIATING}, isReady: true
[log] D/[ConnectionNegotiatorManager]: Feature Started Parsing
[log] ---Xmpp Receiving:---
[log] <?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' from='chat.connectycube.com' id='ee529c25-8474-4624-affc-e2016c214b01' version='1.0' xml:lang='en'>
[log] D/[Connection]: processInitialStream
[log] D/[Connection]: Handle secured connection done
I/flutter (27784): CB-SDK: CubeChatConnection: Chat connection ForcefullyClosed
[log] D/[Connection]: State: XmppConnectionState.ForcefullyClosed
[log] D/[ReconnectionManager]: Connection forcefully closed!
[log] D/[ReconnectionManager]: TimeOut is: 10000 reconnection counter 0
[log] D/[Connection]: State: XmppConnectionState.Reconnecting
I/flutter (27784): CB-SDK: CubeChatConnection: Chat connection Reconnecting
[log] D/[Connection]: State: XmppConnectionState.SocketOpening
I/flutter (27784): CB-SDK: CubeChatConnection: Chat connection SocketOpening
[log] D/[Connection]: State: XmppConnectionState.SocketOpened
I/flutter (27784): CB-SDK: CubeChatConnection: Chat connection SocketOpened
[log] ---Xmpp Sending:---
[log] <?xml version='1.0'?>
<stream:stream xmlns='jabber:client' version='1.0' xmlns:stream='http://etherx.jabber.org/streams'
to='chat.connectycube.com'
xml:lang='en'
>
@TatankaConCube
Copy link
Contributor

We didn't add reconnection manager to our chat sample yet. You can do it by yourself, just follow our documentation for it.

@thang510023
Copy link
Author

Before that I tried using manual Reconnect, but it never state == CubeChatConnectionState.Closed

@TatankaConCube
Copy link
Contributor

Ok, I will check in our chat sample.

@amarSuthar437
Copy link

Hi @TatankaConCube i getting same error on this. Same thing happens with me

CubeChatConnection: Chat connection ForcefullyClosed
CubeChatConnection: Chat connection Reconnecting
CubeChatConnection: Chat connection SocketOpening
CubeChatConnection: Chat connection SocketOpened
CubeChatConnection: Chat connection Authenticated
CubeChatConnection: Chat connection ForcefullyClosed
CubeChatConnection: Chat connection Reconnecting
CubeChatConnection: Chat connection SocketOpening
CubeChatConnection: Chat connection SocketOpened

@thang510023
Copy link
Author

Ok, I will check in our chat sample.

Thanks for the quick reply, have you found a solution?

@TatankaConCube
Copy link
Contributor

We plan to publish the new version with fixes next week, I hope we will fix this issue there.

@thang510023
Copy link
Author

thang510023 commented Dec 9, 2020

Thank you, I will wait, I wish you the best!

@thang510023
Copy link
Author

We plan to publish the new version with fixes next week, I hope we will fix this issue there.

After 1 week, have you found a solution to this problem, we need it :(

@TatankaConCube
Copy link
Contributor

yes, we have the solution for this issue, we plan to release the new version in a few days (today or tomorrow)

@thang510023
Copy link
Author

yes, we have the solution for this issue, we plan to release the new version in a few days (today or tomorrow)

You are so great

@TatankaConCube
Copy link
Contributor

@thang510023 today we released the new version, which contains the fix for your issue, please try it.

If the issue was resolved, please close this ticket.

@thang510023
Copy link
Author

Thank you, I will try it now

@thang510023
Copy link
Author

@thang510023 today we released the new version, which contains the fix for your issue, please try it.

If the issue was resolved, please close this ticket.

It was working fine, once again thank you guys, I'll close my ticker now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants