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

Reconnecting supported? #2

Open
vimalmistry opened this issue Jan 12, 2020 · 4 comments
Open

Reconnecting supported? #2

vimalmistry opened this issue Jan 12, 2020 · 4 comments

Comments

@vimalmistry
Copy link

Is this package reconnect after disconnect?
Or other way how to keep eye on connection state?

@ConsoleTVs
Copy link
Owner

You can play around onError method to act and reconnect

@fweinaug
Copy link
Contributor

I get an exception when calling connect with an onError callback. Seems like the signature needs to change (Stream uses Function onError) or am I doing something wrong?

Invalid argument(s): handleError callback must take either an Object (the error), or both an Object (the error) and a StackTrace

StackTrace:
#0      _BufferingStreamSubscription.onError (dart:async/stream_impl.dart:152:7)
#1      new _BufferingStreamSubscription (dart:async/stream_impl.dart:115:10)
#2      new _ForwardingStreamSubscription (dart:async/stream_pipe.dart:123:9)
#3      _ForwardingStream._createSubscription (dart:async/stream_pipe.dart:93:16)
#4      _ForwardingStream.listen (dart:async/stream_pipe.dart:88:12)
#5      Websok.listen (package:websok/websok.dart:78:27)
#6      AdonisWebsok.connect (package:adonis_websok/adonis_websok.dart:143:19)

@nhtlquan
Copy link

I get an exception when calling connect with an onError callback. Seems like the signature needs to change (Stream uses Function onError) or am I doing something wrong?

Invalid argument(s): handleError callback must take either an Object (the error), or both an Object (the error) and a StackTrace

StackTrace:
#0      _BufferingStreamSubscription.onError (dart:async/stream_impl.dart:152:7)
#1      new _BufferingStreamSubscription (dart:async/stream_impl.dart:115:10)
#2      new _ForwardingStreamSubscription (dart:async/stream_pipe.dart:123:9)
#3      _ForwardingStream._createSubscription (dart:async/stream_pipe.dart:93:16)
#4      _ForwardingStream.listen (dart:async/stream_pipe.dart:88:12)
#5      Websok.listen (package:websok/websok.dart:78:27)
#6      AdonisWebsok.connect (package:adonis_websok/adonis_websok.dart:143:19)

Me too

@fweinaug
Copy link
Contributor

I just created a PR to fix the exception: #3

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

4 participants