delight-im / Android-DDP

[UNMAINTAINED] Meteor's Distributed Data Protocol (DDP) for clients on Android
Apache License 2.0
274 stars 54 forks source link

bug fixed which prevents doing a lot of clients connections to server #99

Closed rakirox closed 8 years ago

rakirox commented 8 years ago

For more information: https://github.com/delight-im/Android-DDP/issues/96

ocram commented 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.

Thanks!

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?

rakirox commented 8 years ago

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?

ocram commented 8 years ago

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

rakirox commented 8 years ago

I did a better approach to solve this problem. I'll write it later to discuss it with you @mwaclawek .

ocram commented 8 years ago

This solution here wasn't that bad, was it? Looking forward to see your improved solution :)