The last PR introduced a bug where the lib tries to reconnect even when the websocket is closed intentionally by calling disconnect()
This is what is happening:
disconnect() is called
onConnectionClosed() is invoked
reconnectTimer is scheduled
reconnectTimer connects to WebSocket again
I think we should somehow distinguish disconnect() called be the user and by the library itself. This would give us an option to know wether we should still want to try to reconnect or not.
@dsrees Could you look at this?