Closed rakirox closed 8 years ago
Thanks a lot! Contributions of code are definitely welcome :)
Can you please try to apply the following modifications and check if it's still working then? You can update your pull request by pushing the new commits to the same branch.
if (isReconnect)
block aboveif (mWebSocket != null)
blockThanks!
So the actual problem was that the old WebSocket connections weren't closed before the re-connect and thus, after the re-connect, two WebSocket connections were open. Do I understand this correctly?
Looks like that was happening. Now, this is what is happening: 1-Galaxy has 1 client ( the android DDP) 2-Client android disconnects (internet lost) 3-Galaxy still shows 1 client (I have the suspicious because it hasn't received the "good bye message/shake hands/whatever") 4-Client Android reconnects 5-Galaxy shows 2 clients and after few second one client gets disconnected (I'm guessing, when the web sockets sends the "good bye message/shake/whatever")
Sending the new pull request ~~ btw, now it looks like my subscriptions are not working, I don't receive any new/update or remove data from my subscriptions. Any idea?
The behavior that you described is what you expected and does seem to fix the issue, right?
Regarding the subscriptions, does this problem occur (after re-connects) only with your updated code from the pull request or with the latest stable version of this library as well?
If you call a method after the re-connect, does it succeed and affect any data on the server? Are you able to get the result of the method call via a ResultListener
?
What happens if you add data on the server (e.g. with another client) after the re-connect? Does new data arrive then?
Could the problem be related to the following one? https://github.com/delight-im/Android-DDP/issues/74
I did a better approach to solve this problem. I'll write it later to discuss it with you @mwaclawek .
This solution here wasn't that bad, was it? Looking forward to see your improved solution :)
For more information: https://github.com/delight-im/Android-DDP/issues/96