parse-community / ParseLiveQuery-Android

Parse LiveQuery client for Android.
Other
84 stars 32 forks source link

Dispatch better disconnect events #39

Closed jhansche closed 7 years ago

jhansche commented 7 years ago

First, the close() call was wrong, because the RFC expects a close reason in the 1000-1999 range, but we were passing 200.

I confirmed that changing to 1000 properly closes the socket, and cleans up the connection (which was otherwise causing a memory leak because it didn't close properly).

This also adds the userInitiated boolean to the onLiveQueryClientDisconnected() callback, so that listeners can choose how to respond based on if it was expected or not (an error disconnect may mean it needs to be reconnected; while an expected disconnect() close should not auto-reconnect)