Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StreamSink is closed #11

Closed
lesnitsky opened this issue Mar 16, 2019 · 3 comments
Closed

StreamSink is closed #11

lesnitsky opened this issue Mar 16, 2019 · 3 comments

Comments

@lesnitsky
Copy link
Contributor

Hi,

I get this error in flutter when device goes in bad network state

Unhandled Exception: Bad state: StreamSink is closed
#0      _StreamSinkImpl.add (dart:_http/http_impl.dart:536:7)
#1      _WebSocketImpl.add (dart:_http/websocket_impl.dart:1213:11)
#2      PhoenixIoConnection.send 
package:phoenix_wings/src/phoenix_io_connection.dart:37
#3      PhoenixSocket.push.<anonymous closure> 
package:phoenix_wings/src/phoenix_socket.dart:221
#4      PhoenixSocket.push 
package:phoenix_wings/src/phoenix_socket.dart:225
#5      PhoenixSocket.sendHeartbeat 
package:phoenix_wings/src/phoenix_socket.dart:214

There is also a piece of custom logic behind, maybe you can suggest what am I doing wrong

    connectivity = new Connectivity();
    final connRes = await connectivity.checkConnectivity();

    connectivity.onConnectivityChanged.listen((ConnectivityResult result) {
      if (result == ConnectivityResult.none) {
        _socket.disconnect();
        onConnectionChange.value = false;
      } else if (!_socket.isConnected) {
        _socket.connect();
        onConnectionChange.value = true;
      }
    });
@mfeckie
Copy link
Owner

mfeckie commented Apr 25, 2019

Is this still an issue?

@lesnitsky
Copy link
Contributor Author

lesnitsky commented Apr 25, 2019 via email

@mfeckie
Copy link
Owner

mfeckie commented Apr 28, 2019

Should be fixed in 0.2.1

@mfeckie mfeckie closed this as completed Apr 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants