Skip to content
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.

App crashes on connection change using deepstream #139

Open
DevRahulChokshi opened this issue Sep 3, 2018 · 0 comments
Open

App crashes on connection change using deepstream #139

DevRahulChokshi opened this issue Sep 3, 2018 · 0 comments

Comments

@DevRahulChokshi
Copy link

While I'm changing connection, my app crashes and shows the following stack trace:

E/AndroidRuntime: FATAL EXCEPTION: Timer-3
    Process: com.app.teemchat, PID: 9383
    io.deepstream.DeepstreamException: CONNECTION_ERROR: null
        at io.deepstream.DeepstreamClientAbstract.onError(DeepstreamClientAbstract.java:59)
        at io.deepstream.Connection$1.run(Connection.java:187)
        at java.util.TimerThread.mainLoop(Timer.java:555)
        at java.util.TimerThread.run(Timer.java:505)

client.addConnectionChangeListener(new ConnectionStateListener() {
    @Override
    public void connectionStateChanged(ConnectionState connectionState) throws RuntimeException {
        Log.w(Tag, "ConnectionChange>>> " + connectionState.toString());
        if (connectionState.toString().equalsIgnoreCase(ConnectionState.ERROR.toString())) {
           client.close();
           doLogin();
           }

           if (connectionState.toString().equalsIgnoreCase(ConnectionState.CLOSED.toString())) {
              doLogin();
              }
        }
});

@yasserf yasserf transferred this issue from deepstreamIO/deepstream.io Jun 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant